summaryrefslogtreecommitdiffstats
path: root/tests/Makefile.localtest
blob: 29a62f398c03dfa5f96dbab214897194f1c4fa38 (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
#
# Makefile to run tests with system binaries
# USE: make -f Makefile.localtest tests CRYPTSETUP_PATH=/sbin
#
CPPFLAGS=-I../lib/ -I../lib/luks1 -DHAVE_DECL_DM_TASK_RETRY_REMOVE -DKERNEL_KEYRING -DHAVE_SYS_SYSMACROS_H -DNO_CRYPTSETUP_PATH
CFLAGS=-O2 -g -Wall
LDLIBS=-lcryptsetup -ldevmapper
TESTS=$(wildcard *-test *-test2) api-test api-test-2

differ: differ.o
	$(CC) -o $@ $^

api-test: api-test.o test_utils.o
	$(CC) -o $@ $^ $(LDLIBS)

api-test-2: api-test-2.o test_utils.o
	$(CC) -o $@ $^ $(LDLIBS)

tests: differ $(TESTS)
	@for test in $(sort $(TESTS)); do \
		echo [$$test]; \
		./$$test; \
		[ $$? -ne 77 -a $$? -ne 0 ] && exit 1; \
		true; \
	done;

clean:
	rm -f *.o differ api-test api-test-2

.PHONY: clean