1 # wvtest_SCRIPTS .. list of scripts producing wvtest output
2 # wvtest_PROGRAMS .. list of the testing programs producing wvtest output
5 WVTEST_LIBRARY = wvtest
8 # Documentation: wvtest_PROGRAMS is amost equivalent to test_PROGRAMS.
9 # The two differences are that the program is automatically linked
10 # with $(WVTEST_LIBRARY) and it is run during "make wvtest".
11 test_PROGRAMS += $(wvtest_PROGRAMS)
13 # Documentation: If your project uses wvtest, it is recomended to put
14 # the "test: wvtest" rule to config.target.
16 $(Q)$(MAKERULES_DIR)/wvtestrun $(MAKE) wvtest-pass
20 $(eval $(call omk_pass_template,wvtest-pass,$$(LOCAL_BUILD_DIR),,$(wvtest_SCRIPTS)$(wvtest_PROGRAMS)))
22 # Usage: $(call wvtest_template,<shell command>)
23 define wvtest_template
24 wvtest-pass-local: wvtest-run-$(1)
25 .PHONY: wvtest-run-$(1)
27 $(Q)echo "Testing \"Run $(1)\" in Makefile.rules:"
28 $(Q)mkdir -p $(1).wvtest
29 $(Q)cd $(1).wvtest && \
30 PATH=$$(USER_BIN_DIR):$$$$PATH LD_LIBRARY_PATH=$$(USER_LIB_DIR):$$$$LD_LIBRARY_PATH \
32 $(notdir $(1))_LIBS += $$(WVTEST_LIBRARY)
35 # Documentation: Write the test so, that it can be run from arbitrary
36 # directory, i.e. in case of a script ensure that the wvtest library
37 # is sourced like this:
39 # . $(dirname $0)/wvtest.sh
41 $(foreach script,$(wvtest_SCRIPTS),$(eval $(call wvtest_template,$(SOURCES_DIR)/$(script))))
43 USER_TESTS_DIR := $(OUTPUT_DIR)/_compiled/bin-tests
44 $(foreach prog,$(wvtest_PROGRAMS),$(eval $(call wvtest_template,$(USER_TESTS_DIR)/$(prog))))