tests: Add printf encoding/decoding module tests
[mech_eap.git] / tests / Makefile
1 TESTS=test-base64 test-md4 test-md5 test-milenage test-ms_funcs \
2         test-bitfield \
3         test-rsa-sig-ver \
4         test-sha1 \
5         test-sha256 test-aes test-asn1 test-x509 test-x509v3 test-list test-rc4
6
7 all: $(TESTS)
8
9 ifndef CC
10 CC=gcc
11 endif
12
13 ifndef LDO
14 LDO=$(CC)
15 endif
16
17 ifndef CFLAGS
18 CFLAGS = -MMD -O2 -Wall -g
19 endif
20
21 CFLAGS += -I../src
22 CFLAGS += -I../src/utils
23
24 SLIBS = ../src/utils/libutils.a
25
26 DLIBS = ../src/crypto/libcrypto.a \
27         ../src/tls/libtls.a
28
29 LIBS = $(SLIBS) $(DLIBS)
30 LLIBS = -Wl,--start-group $(DLIBS) -Wl,--end-group $(SLIBS)
31
32 # glibc < 2.17 needs -lrt for clock_gettime()
33 LLIBS += -lrt
34
35 ../src/utils/libutils.a:
36         $(MAKE) -C ../src/utils
37
38 ../src/crypto/libcrypto.a:
39         $(MAKE) -C ../src/crypto
40
41 ../src/tls/libtls.a:
42         $(MAKE) -C ../src/tls
43
44
45 test-aes: test-aes.o $(LIBS)
46         $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
47
48 test-asn1: test-asn1.o $(LIBS)
49         $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
50
51 test-base64: test-base64.o $(LIBS)
52         $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
53
54 test-bitfield: test-bitfield.o $(LIBS)
55         $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
56
57 test-https: test-https.o $(LIBS)
58         $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS)
59
60 test-list: test-list.o $(LIBS)
61         $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
62
63 test-md4: test-md4.o $(LIBS)
64         $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
65
66 test-md5: test-md5.o $(LIBS)
67         $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
68
69 test-milenage: test-milenage.o $(LIBS)
70         $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
71
72 test-ms_funcs: test-ms_funcs.o $(LIBS)
73         $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
74
75 test-rc4: test-rc4.o $(LIBS)
76         $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
77
78 test-rsa-sig-ver: test-rsa-sig-ver.o $(LIBS)
79         $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS)
80
81 test-sha1: test-sha1.o $(LIBS)
82         $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
83
84 test-sha256: test-sha256.o $(LIBS)
85         $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
86
87 test-x509: test-x509.o $(LIBS)
88         $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS)
89
90 test-x509v3: test-x509v3.o $(LIBS)
91         $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS)
92
93
94 run-tests: $(TESTS)
95         ./test-aes
96         ./test-bitfield
97         ./test-list
98         ./test-md4
99         ./test-md5
100         ./test-milenage
101         ./test-rsa-sig-ver
102         ./test-sha1
103         ./test-sha256
104         @echo
105         @echo All tests completed successfully.
106
107 clean:
108         $(MAKE) -C ../src clean
109         rm -f $(TESTS) *~ *.o *.d
110         rm -f test-https
111         rm -f test_x509v3_nist.out.*
112         rm -f test_x509v3_nist2.out.*
113
114 -include $(OBJS:%.o=%.d)