summaryrefslogtreecommitdiffstats
path: root/src/tests/asn.1/Makefile.in
blob: 14585e3d6b09eb0e4e0ef07fb53e4a1c03351a7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
mydir=tests/asn.1
BUILDTOP=$(REL)..$(S)..
PROG_LIBPATH=-L$(TOPLIBD)
PROG_RPATH=$(KRB5_LIBDIR)
LDAP=@LDAP@

RUN_SETUP = @KRB5_RUN_ENV@

SRCS= $(srcdir)/krb5_encode_test.c $(srcdir)/krb5_decode_test.c \
	$(srcdir)/krb5_decode_leak.c $(srcdir)/ktest.c \
	$(srcdir)/ktest_equal.c $(srcdir)/utility.c \
	$(srcdir)/trval.c $(srcdir)/t_trval.c

all:: krb5_encode_test krb5_decode_test krb5_decode_leak t_trval

LOCALINCLUDES = -I$(srcdir)/../../lib/krb5/asn.1

ENCOBJS = krb5_encode_test.o ktest.o ktest_equal.o utility.o trval.o

krb5_encode_test: $(ENCOBJS) $(KRB5_BASE_DEPLIBS)
	$(CC_LINK) -o krb5_encode_test $(ENCOBJS) $(KRB5_BASE_LIBS)

DECOBJS = krb5_decode_test.o ktest.o ktest_equal.o utility.o

krb5_decode_test: $(DECOBJS) $(KRB5_BASE_DEPLIBS)
	$(CC_LINK) -o krb5_decode_test $(DECOBJS) $(KRB5_BASE_LIBS)

LEAKOBJS = krb5_decode_leak.o ktest.o ktest_equal.o utility.o

krb5_decode_leak: $(LEAKOBJS) $(KRB5_BASE_DEPLIBS)
	$(CC_LINK) -o krb5_decode_leak $(LEAKOBJS) $(KRB5_BASE_LIBS)

t_trval: t_trval.o
	$(CC) -o t_trval $(ALL_CFLAGS) t_trval.o

check:: check-encode check-encode-trval check-decode check-leak

# Does not actually test for leaks unless using valgrind or a similar
# tool, but does exercise a bunch of code.
check-leak: krb5_decode_leak
	KRB5_CONFIG=$(top_srcdir)/config-files/krb5.conf ; \
		export KRB5_CONFIG ;\
		$(RUN_SETUP) $(VALGRIND) ./krb5_decode_leak

check-decode: krb5_decode_test
	KRB5_CONFIG=$(top_srcdir)/config-files/krb5.conf ; \
		export KRB5_CONFIG ;\
		$(RUN_SETUP) $(VALGRIND) ./krb5_decode_test

expected_encode.out: reference_encode.out ldap_encode.out
	if test "$(LDAP)" = yes; then \
	  cat $(srcdir)/reference_encode.out $(srcdir)/ldap_encode.out > expected_encode.out; \
	else \
	  cat $(srcdir)/reference_encode.out > expected_encode.out; \
	fi

expected_trval.out: trval_reference.out ldap_trval.out
	if test "$(LDAP)" = yes; then \
	  cat $(srcdir)/trval_reference.out $(srcdir)/ldap_trval.out > expected_trval.out; \
	else \
	  cat $(srcdir)/trval_reference.out > expected_trval.out; \
	fi

check-encode: krb5_encode_test expected_encode.out
	KRB5_CONFIG=$(top_srcdir)/config-files/krb5.conf ; \
		export KRB5_CONFIG ;\
		$(RUN_SETUP) $(VALGRIND) ./krb5_encode_test > test.out
	cmp test.out expected_encode.out

check-encode-trval: krb5_encode_test expected_trval.out
	KRB5_CONFIG=$(top_srcdir)/config-files/krb5.conf ; \
		export KRB5_CONFIG ;\
		$(RUN_SETUP) $(VALGRIND) ./krb5_encode_test -t > trval.out
	cmp trval.out expected_trval.out

install::

clean::
	rm -f *~ *.o krb5_encode_test krb5_decode_test krb5_decode_leak test.out trval t_trval expected_encode.out expected_trval.out trval.out


################ Dependencies ################
krb5_decode_test.o: ktest.h utility.h ktest_equal.h debug.h
krb5_encode_test.o: utility.h ktest.h debug.h
trval.o: trval.c
ktest.o: ktest.h utility.h
ktest_equal.o: ktest_equal.h
#utility.o: utility.h
#utility.h: krbasn1.h asn1buf.h
##############################################