diff options
author | Viktor Söderqvist <[email protected]> | 2015-01-24 18:16:00 +0100 |
---|---|---|
committer | Viktor Söderqvist <[email protected]> | 2015-01-24 18:16:00 +0100 |
commit | dcb821ca1adaec189cdc99509a47fb59bc4e8d5a (patch) | |
tree | 73e41e7289f8846754ead1d1c34b57107d5344c3 /plugins/eunit.mk | |
parent | 11dd48fba8b4b3d9783be7727feed45729987738 (diff) | |
download | erlang.mk-dcb821ca1adaec189cdc99509a47fb59bc4e8d5a.tar.gz erlang.mk-dcb821ca1adaec189cdc99509a47fb59bc4e8d5a.tar.bz2 erlang.mk-dcb821ca1adaec189cdc99509a47fb59bc4e8d5a.zip |
Combined coverage report for eunit and ct
Diffstat (limited to 'plugins/eunit.mk')
-rw-r--r-- | plugins/eunit.mk | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/plugins/eunit.mk b/plugins/eunit.mk index c59883d..b1ebe43 100644 --- a/plugins/eunit.mk +++ b/plugins/eunit.mk @@ -6,18 +6,19 @@ # Configuration +# All modules in TEST_DIR ifeq ($(strip $(TEST_DIR)),) -TAGGED_EUNIT_TESTS = {dir,"ebin"} +TEST_DIR_MODS = else -# All modules in TEST_DIR TEST_DIR_MODS = $(notdir $(basename $(shell find $(TEST_DIR) -type f -name *.beam))) +endif + # All modules in 'ebin' EUNIT_EBIN_MODS = $(notdir $(basename $(shell find ebin -type f -name *.beam))) # Only those modules in TEST_DIR with no matching module in 'ebin'. # This is done to avoid some tests being executed twice. EUNIT_MODS = $(filter-out $(patsubst %,%_tests,$(EUNIT_EBIN_MODS)),$(TEST_DIR_MODS)) -TAGGED_EUNIT_TESTS = {dir,"ebin"} $(foreach mod,$(EUNIT_MODS),$(shell echo $(mod) | sed -e 's/\(.*\)/{module,\1}/g')) -endif +TAGGED_EUNIT_TESTS = $(foreach mod,$(EUNIT_EBIN_MODS) $(EUNIT_MODS),{module,$(mod)}) EUNIT_OPTS ?= verbose @@ -38,10 +39,16 @@ help:: # Plugin-specific targets. +EUNIT_RUN_BEFORE ?= +EUNIT_RUN_AFTER ?= EUNIT_RUN = $(ERL) \ -pa $(TEST_DIR) $(DEPS_DIR)/*/ebin \ -pz ebin \ - -eval 'case eunit:test([$(call str-join,$(TAGGED_EUNIT_TESTS))], [$(EUNIT_OPTS)]) of ok -> halt(0); error -> halt(1) end.' + $(EUNIT_RUN_BEFORE) \ + -eval 'case eunit:test([$(call str-join,$(TAGGED_EUNIT_TESTS))],\ + [$(EUNIT_OPTS)]) of ok -> ok; error -> halt(1) end.' \ + $(EUNIT_RUN_AFTER) \ + -eval 'halt(0).' eunit: test-build $(gen_verbose) $(EUNIT_RUN) |