4 # List of test targets (testsuite incl. automatically)
11 # Testsuite with automated collection of tests
12 # All .test.c files are scraped for GP_TEST definitions
16 # a bit crude way to link with test minilibrary
17 GP_TESTLIB_SRCS
=$(wildcard ${TOPDIR}/tests
/common
/*.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 CLEAN
+=${TESTSUITE_GEN}
24 ${TESTSUITE_GEN}: $(filter-out ${TESTSUITE_GEN},${GENSOURCES}) ${GENHEADERS}
26 ${PYTHON} ${TOPDIR}/pylib
/bin
/generate_collected_tests.py
-t
$(TEMPLATE_DIR
) "." "$@"
29 @
${PYTHON} ${TOPDIR}/pylib
/bin
/generate_collected_tests.py
-t
$(TEMPLATE_DIR
) "." "$@"
33 TESTSUITE_SRCS
=$(wildcard *.
test.c
) ${GENSOURCES} ${GENHEADERS} ${GP_TESTLIB_SRCS} ${TESTSUITE_GEN}
34 INCLUDE
+=..
/tests
/common
35 TESTSUITE_OBJS
=$(patsubst %.c
,%.o
,$(TESTSUITE_SRCS
))
36 CLEAN
+=${TESTSUITE} ${TESTSUITE_OBJS}
39 ${TESTSUITE}: ${TESTSUITE_OBJS}
41 $(CC
) $(CFLAGS
) $(LDFLAGS
) -Wl
,--start-group
$(LDLIBS
) $^
-Wl
,--end-group
-o
$@
44 @
$(CC
) $(CFLAGS
) $(LDFLAGS
) -Wl
,--start-group
$(LDLIBS
) $^
-Wl
,--end-group
-o
$@
52 for
test in
$(TESTS
); do LD_LIBRARY_PATH
=..
/..
/build .
/"$$test"; done
54 # WARN: avoid double includion?
55 include $(TOPDIR
)/gen.mk