Fixed the build error for riscv64 arch using gcc 13
[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 luks2-reencryption-mangle-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         luks2-reencryption-mangle-test \
61         tcrypt-compat-test \
62         luks1-compat-test \
63         luks2-validation-test generators \
64         luks2-integrity-test \
65         device-test \
66         keyring-test \
67         keyring-compat-test \
68         integrity-compat-test \
69         cryptsetup-valg-supps valg.sh valg-api.sh \
70         blockwise-compat \
71         blkid-luks2-pv.img.xz \
72         Makefile.localtest \
73         bitlk-compat-test \
74         bitlk-images.tar.xz
75
76 CLEANFILES = cryptsetup-tst* valglog* *-fail-*.log
77 clean-local:
78         -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
79
80 LDADD = $(LTLIBINTL)
81
82 differ_SOURCES = differ.c
83 differ_CFLAGS = $(AM_CFLAGS) -Wall -O2
84
85 api_test_SOURCES = api-test.c api_test.h test_utils.c
86 api_test_LDADD = $(LDADD) ../libcryptsetup.la
87 api_test_LDFLAGS = $(AM_LDFLAGS) -static
88 api_test_CFLAGS = -g -Wall -O0 $(AM_CFLAGS) -I$(top_srcdir)/lib/ -I$(top_srcdir)/lib/luks1
89 api_test_CPPFLAGS = $(AM_CPPFLAGS) -include config.h
90
91 api_test_2_SOURCES = api-test-2.c api_test.h test_utils.c
92 api_test_2_LDADD = $(LDADD) ../libcryptsetup.la
93 api_test_2_LDFLAGS = $(AM_LDFLAGS) -static
94 api_test_2_CFLAGS = -g -Wall -O0 $(AM_CFLAGS) -I$(top_srcdir)/lib/ -I$(top_srcdir)/lib/luks1
95 api_test_2_CPPFLAGS = $(AM_CPPFLAGS) -include config.h
96
97 vectors_test_SOURCES = crypto-vectors.c
98 vectors_test_LDADD = ../libcrypto_backend.la @CRYPTO_LIBS@ @LIBARGON2_LIBS@
99 vectors_test_LDFLAGS = $(AM_LDFLAGS) -static
100 vectors_test_CFLAGS = $(AM_CFLAGS) -I$(top_srcdir)/lib/crypto_backend/ @CRYPTO_CFLAGS@
101 vectors_test_CPPFLAGS = $(AM_CPPFLAGS) -include config.h
102
103 unit_utils_io_SOURCES = unit-utils-io.c
104 unit_utils_io_LDADD = ../libutils_io.la
105 unit_utils_io_LDFLAGS = $(AM_LDFLAGS) -static
106 unit_utils_io_CFLAGS = $(AM_CFLAGS) -I$(top_srcdir)/lib
107 unit_utils_io_CPPFLAGS = $(AM_CPPFLAGS) -include config.h
108
109 check_PROGRAMS = api-test api-test-2 differ vectors-test unit-utils-io
110
111 conversion_imgs:
112         @tar xJf conversion_imgs.tar.xz
113
114 compatimage.img:
115         @xz -k -d compatimage.img.xz
116
117 valgrind-check: api-test api-test-2 differ
118         @VALG=1 ./compat-test
119         @VALG=1 ./compat-test2
120         @VALG=1 ./luks2-validation-test
121         @VALG=1 ./verity-compat-test
122         @VALG=1 ./integrity-compat-test
123         @INFOSTRING="api-test-000" ./valg-api.sh ./api-test
124         @INFOSTRING="api-test-002" ./valg-api.sh ./api-test-2
125         @VALG=1 ./luks2-reencryption-test
126         @VALG=1 ./luks2-reencryption-mangle-test
127         @VALG=1 ./bitlk-compat-test
128         @grep -l "ERROR SUMMARY: [^0] errors" valglog* || echo "No leaks detected."
129
130 .PHONY: valgrind-check