try to cleanup the mess in the input code
[pcsx_rearmed.git] / deps / libretro-common / Makefile.test
1
2 OBJDIR = ../obj-unix
3
4 TEST_UNIT_CFLAGS = $(CFLAGS) -Iinclude $(LDFLAGS) -lcheck $(LIBCHECK_CFLAGS) -Werror -Wdeclaration-after-statement -fsanitize=address -fsanitize=undefined -ftest-coverage -fprofile-arcs -ggdb
5
6 TEST_GENERIC_QUEUE = test/queues/test_generic_queue
7 TEST_GENERIC_QUEUE_SRC = test/queues/test_generic_queue.c queues/generic_queue.c
8
9 TEST_LINKED_LIST = test/lists/test_linked_list
10 TEST_LINKED_LIST_SRC = test/lists/test_linked_list.c lists/linked_list.c
11
12 TEST_STDSTRING = test/string/test_stdstring
13 TEST_STDSTRING_SRC = test/string/test_stdstring.c string/stdstring.c encodings/encoding_utf.c \
14                      compat/compat_strl.c
15
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
20
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
25
26 all:
27         # Build and execute tests in order, to avoid coverage file collision
28         # string
29         $(CC) $(TEST_UNIT_CFLAGS) $(TEST_STDSTRING_SRC) -o $(TEST_STDSTRING)
30         $(TEST_STDSTRING)
31         lcov -c -d . -o `dirname $(TEST_STDSTRING)`/coverage.info
32         # utils
33         $(CC) $(TEST_UNIT_CFLAGS) $(TEST_UTILS_SRC) -o $(TEST_UTILS)
34         $(TEST_UTILS)
35         lcov -c -d . -o `dirname $(TEST_UTILS)`/coverage.info
36         # utils
37         $(CC) $(TEST_UNIT_CFLAGS) $(TEST_HASH_SRC) -o $(TEST_HASH)
38         $(TEST_HASH)
39         lcov -c -d . -o `dirname $(TEST_HASH)`/coverage.info
40         # list
41         $(CC) $(TEST_UNIT_CFLAGS) $(TEST_LINKED_LIST_SRC) -o $(TEST_LINKED_LIST)
42         $(TEST_LINKED_LIST)
43         lcov -c -d . -o `dirname $(TEST_LINKED_LIST)`/coverage.info
44         # queue
45         $(CC) $(TEST_UNIT_CFLAGS) $(TEST_GENERIC_QUEUE_SRC) -o $(TEST_GENERIC_QUEUE)
46         $(TEST_GENERIC_QUEUE)
47         lcov -c -d . -o `dirname $(TEST_GENERIC_QUEUE)`/coverage.info
48         
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
55
56 clean:
57         rm -f *.gcda *.gcno
58