5a7e21de1bad9fd13400dcaf89c236cf2c16e277
[platform/upstream/cryptsetup.git] / tests / Makefile.am
1 TESTS = 00modules-test \
2         api-test \
3         api-test-2 \
4         compat-test \
5         compat-test2 \
6         loopaes-test \
7         align-test \
8         align-test2 \
9         discards-test \
10         mode-test \
11         password-hash-test \
12         tcrypt-compat-test \
13         luks1-compat-test \
14         device-test \
15         keyring-test \
16         keyring-compat-test \
17         luks2-validation-test \
18         luks2-integrity-test \
19         vectors-test \
20         blockwise-compat \
21         bitlk-compat-test
22
23 if VERITYSETUP
24 TESTS += verity-compat-test
25 endif
26
27 if REENCRYPT
28 TESTS += reencryption-compat-test reencryption-compat-test2 luks2-reencryption-test
29 endif
30
31 if INTEGRITYSETUP
32 TESTS += integrity-compat-test
33 endif
34
35 EXTRA_DIST = compatimage.img.xz compatv10image.img.xz \
36         compatimage2.img.xz \
37         conversion_imgs.tar.xz \
38         luks2_keyslot_unassigned.img.xz \
39         img_fs_ext4.img.xz img_fs_vfat.img.xz img_fs_xfs.img.xz \
40         valid_header_file.xz \
41         luks2_valid_hdr.img.xz \
42         luks2_header_requirements.xz \
43         luks2_header_requirements_free.xz \
44         luks2_mda_images.tar.xz \
45         evil_hdr-payload_overwrite.xz \
46         evil_hdr-stripes_payload_dmg.xz \
47         evil_hdr-luks_hdr_damage.xz \
48         evil_hdr-small_luks_device.xz \
49         evil_hdr-keyslot_overlap.xz \
50         tcrypt-images.tar.xz \
51         luks1-images.tar.xz \
52         00modules-test \
53         compat-test \
54         compat-test2 \
55         loopaes-test align-test discards-test mode-test password-hash-test \
56         align-test2 verity-compat-test \
57         reencryption-compat-test \
58         reencryption-compat-test2 \
59         luks2-reencryption-test \
60         tcrypt-compat-test \
61         luks1-compat-test \
62         luks2-validation-test generators \
63         luks2-integrity-test \
64         device-test \
65         keyring-test \
66         keyring-compat-test \
67         integrity-compat-test \
68         cryptsetup-valg-supps valg.sh valg-api.sh \
69         blockwise-compat \
70         blkid-luks2-pv.img.xz \
71         Makefile.localtest \
72         bitlk-compat-test \
73         bitlk-images.tar.xz
74
75 CLEANFILES = cryptsetup-tst* valglog* *-fail-*.log
76 clean-local:
77         -rm -rf tcrypt-images luks1-images luks2-images bitlk-images conversion_imgs luks2_valid_hdr.img blkid-luks2-pv-img blkid-luks2-pv-img.bcp
78
79 differ_SOURCES = differ.c
80 differ_CFLAGS = $(AM_CFLAGS) -Wall -O2
81
82 api_test_SOURCES = api-test.c api_test.h test_utils.c
83 api_test_LDADD = $(LDADD) ../libcryptsetup.la
84 api_test_LDFLAGS = $(AM_LDFLAGS) -static
85 api_test_CFLAGS = -g -Wall -O0 $(AM_CFLAGS) -I$(top_srcdir)/lib/ -I$(top_srcdir)/lib/luks1
86 api_test_CPPFLAGS = $(AM_CPPFLAGS) -include config.h
87
88 api_test_2_SOURCES = api-test-2.c api_test.h test_utils.c
89 api_test_2_LDADD = $(LDADD) ../libcryptsetup.la
90 api_test_2_LDFLAGS = $(AM_LDFLAGS) -static
91 api_test_2_CFLAGS = -g -Wall -O0 $(AM_CFLAGS) -I$(top_srcdir)/lib/ -I$(top_srcdir)/lib/luks1
92 api_test_2_CPPFLAGS = $(AM_CPPFLAGS) -include config.h
93
94 vectors_test_SOURCES = crypto-vectors.c
95 vectors_test_LDADD = ../libcrypto_backend.la @CRYPTO_LIBS@ @LIBARGON2_LIBS@
96 vectors_test_LDFLAGS = $(AM_LDFLAGS) -static
97 vectors_test_CFLAGS = $(AM_CFLAGS) -I$(top_srcdir)/lib/crypto_backend/ @CRYPTO_CFLAGS@
98 vectors_test_CPPFLAGS = $(AM_CPPFLAGS) -include config.h
99
100 unit_utils_io_SOURCES = unit-utils-io.c
101 unit_utils_io_LDADD = ../libutils_io.la
102 unit_utils_io_LDFLAGS = $(AM_LDFLAGS) -static
103 unit_utils_io_CFLAGS = $(AM_CFLAGS) -I$(top_srcdir)/lib
104 unit_utils_io_CPPFLAGS = $(AM_CPPFLAGS) -include config.h
105
106 check_PROGRAMS = api-test api-test-2 differ vectors-test unit-utils-io
107
108 conversion_imgs:
109         @tar xJf conversion_imgs.tar.xz
110
111 compatimage.img:
112         @xz -k -d compatimage.img.xz
113
114 valgrind-check: api-test api-test-2 differ
115         @VALG=1 ./compat-test2
116         @VALG=1 ./luks2-validation-test
117         @VALG=1 ./verity-compat-test
118         @VALG=1 ./integrity-compat-test
119         @INFOSTRING="api-test-000" ./valg-api.sh ./api-test
120         @INFOSTRING="api-test-002" ./valg-api.sh ./api-test-2
121         @VALG=1 ./luks2-reencryption-test
122         @VALG=1 ./compat-test
123
124 .PHONY: valgrind-check