]> rtime.felk.cvut.cz Git - omk.git/blobdiff - tests/Makefile
Run tests directly with snippets instead of with the preprocessed rules
[omk.git] / tests / Makefile
index 0656290fc658469803cbf615ab3043727582066a..748b82abeaebfc64c0582ac3213e6d400916d665 100644 (file)
@@ -4,23 +4,20 @@ default-config extra_rules_subdirs header-files headers-generated     \
 headers-generated-default-cflags headers-nonexisting hooks             \
 idl ignore_errors includes invocation_dir libraries no-print-directory \
 no_vpath omk_config override-config parallel_make programs             \
-programs-cflags programs-cxxflags programs-cflags-cmdline programs-defs        \
+programs-cflags programs-cxxflags programs-defs        \
 programs-test_PROGRAMS qt qt-qmake shlibs sources_dir                  \
 sources_in_subdirectory sources_list subdirs_first                     \
-subdirs_first-force-subdir use_leaf_makefiles vxworks whole_tree
+subdirs_first-force-subdir use_leaf_makefiles vxworks whole_tree omkize
 
+RULES=$(shell cd ../rules; ls)
 
 all test:
-       $(MAKE) -C ..
        ./wvtestrun $(MAKE) wvtest
 
-wvtest: $(wvtest_SCRIPTS:%=run-%)
+ALL_TESTS = $(foreach rule,$(RULES),$(foreach script,$(wvtest_SCRIPTS),$(rule)/$(script)))
 
-RULES=$(shell cd ../rules; ls)
+.PHONY: $(ALL_TESTS) wvtest
+wvtest: $(ALL_TESTS)
 
-run-%: %
-ifeq ($(OMK_RULES),)
-       LC_ALL=C for i in $(RULES); do OMK_RULES=$$i ./$* || exit 1; done
-else
-       LC_ALL=C ./$*
-endif
+$(ALL_TESTS):
+       LC_ALL=C OMK_RULES=$(patsubst %/,%,$(dir $@)) ./$(notdir $@)