Rename GP_Pixel_Access to GP_GetPutPixel
[gfxprim.git] / tests.mk
blob5dbcc80d3c25dbc99bfbc5dd9fc0491791d07859
1 .PHONY: tests runtests
4 # List of test targets (testsuite incl. automatically)
6 ifndef TESTS
7 TESTS=
8 endif
11 # Testsuite with automated collection of tests
12 # All .test.c files are scraped for GP_TEST definitions
15 ifdef TESTSUITE
16 # a bit crude way to link with test minilibrary
17 GP_TESTLIB_SRCS=${TOPDIR}/tests/common/GP_Tests.c
18 CSOURCES+=${GP_TESTLIB_SRCS}
20 # generated suite creation code
21 TESTSUITE_GEN=collected_tests.gen.c # also fixed in the code generator
22 GENSOURCES+=${TESTSUITE_GEN}
24 TESTSUITE_SRCS=$(wildcard *.test.c) ${TESTSUITE_GEN} ${GP_TESTLIB_SRCS}
25 INCLUDE+=../tests/common
26 TESTSUITE_OBJS=$(patsubst %.c,%.o,$(TESTSUITE_SRCS))
27 CLEAN+=${TESTSUITE}
28 TESTS+=${TESTSUITE}
30 ${TESTSUITE}: ${TESTSUITE_OBJS}
31 ifdef VERBOSE
32 $(CC) $(CFLAGS) $(LDFLAGS) -Wl,--start-group $(LDLIBS) $^ -Wl,--end-group -o $@
33 else
34 @echo "LD $@"
35 @$(CC) $(CFLAGS) $(LDFLAGS) -Wl,--start-group $(LDLIBS) $^ -Wl,--end-group -o $@
36 endif # VERBOSE
38 endif # TESTSUITE
40 tests: $(TESTS)
42 runtests: tests
43 for test in $(TESTS); do LD_LIBRARY_PATH=../../build ./"$$test" -v ; done
45 # WARN: avoid double includion?
46 include $(TOPDIR)/gen.mk