4 TEST_UNIT_CFLAGS = $(CFLAGS) -Iinclude $(LDFLAGS) -lcheck $(LIBCHECK_CFLAGS) -Werror -Wdeclaration-after-statement -fsanitize=address -fsanitize=undefined -ftest-coverage -fprofile-arcs -ggdb
6 TEST_GENERIC_QUEUE = test/queues/test_generic_queue
7 TEST_GENERIC_QUEUE_SRC = test/queues/test_generic_queue.c queues/generic_queue.c
9 TEST_LINKED_LIST = test/lists/test_linked_list
10 TEST_LINKED_LIST_SRC = test/lists/test_linked_list.c lists/linked_list.c
12 TEST_STDSTRING = test/string/test_stdstring
13 TEST_STDSTRING_SRC = test/string/test_stdstring.c string/stdstring.c encodings/encoding_utf.c \
16 TEST_UTILS = test/utils/test_utils
17 TEST_UTILS_SRC = test/utils/test_utils.c utils/md5.c encodings/encoding_crc32.c \
18 streams/file_stream.c vfs/vfs_implementation.c file/file_path.c \
19 compat/compat_strl.c time/rtime.c string/stdstring.c encodings/encoding_utf.c
21 TEST_HASH = test/hash/test_hash
22 TEST_HASH_SRC = test/hash/test_hash.c hash/lrc_hash.c \
23 streams/file_stream.c vfs/vfs_implementation.c file/file_path.c \
24 compat/compat_strl.c time/rtime.c string/stdstring.c encodings/encoding_utf.c
27 # Build and execute tests in order, to avoid coverage file collision
29 $(CC) $(TEST_UNIT_CFLAGS) $(TEST_STDSTRING_SRC) -o $(TEST_STDSTRING)
31 lcov -c -d . -o `dirname $(TEST_STDSTRING)`/coverage.info
33 $(CC) $(TEST_UNIT_CFLAGS) $(TEST_UTILS_SRC) -o $(TEST_UTILS)
35 lcov -c -d . -o `dirname $(TEST_UTILS)`/coverage.info
37 $(CC) $(TEST_UNIT_CFLAGS) $(TEST_HASH_SRC) -o $(TEST_HASH)
39 lcov -c -d . -o `dirname $(TEST_HASH)`/coverage.info
41 $(CC) $(TEST_UNIT_CFLAGS) $(TEST_LINKED_LIST_SRC) -o $(TEST_LINKED_LIST)
43 lcov -c -d . -o `dirname $(TEST_LINKED_LIST)`/coverage.info
45 $(CC) $(TEST_UNIT_CFLAGS) $(TEST_GENERIC_QUEUE_SRC) -o $(TEST_GENERIC_QUEUE)
47 lcov -c -d . -o `dirname $(TEST_GENERIC_QUEUE)`/coverage.info
49 lcov -o test/coverage.info \
50 -a test/utils/coverage.info \
51 -a test/string/coverage.info \
52 -a test/lists/coverage.info \
53 -a test/queues/coverage.info
54 genhtml -o test/coverage/ test/coverage.info