diff options
author | Loïc Hoguin <[email protected]> | 2018-12-06 18:25:09 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2018-12-06 18:25:09 +0100 |
commit | 754bad09421c70034242f4370c633e177a869151 (patch) | |
tree | 5d8e4faed1d6f204cd65a537f8f7eb58bacd975e /plugins/triq.mk | |
parent | 44fe1e993f16c98ed41c01e4511c0367e14e9637 (diff) | |
download | erlang.mk-754bad09421c70034242f4370c633e177a869151.tar.gz erlang.mk-754bad09421c70034242f4370c633e177a869151.tar.bz2 erlang.mk-754bad09421c70034242f4370c633e177a869151.zip |
Add cover support for PropEr and Triq
Diffstat (limited to 'plugins/triq.mk')
-rw-r--r-- | plugins/triq.mk | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/plugins/triq.mk b/plugins/triq.mk index 9d5a30f..8791e2c 100644 --- a/plugins/triq.mk +++ b/plugins/triq.mk @@ -9,17 +9,21 @@ ifeq ($(filter triq,$(DEPS) $(TEST_DEPS)),triq) tests:: triq define triq_check.erl + $(call cover.erl) code:add_pathsa([ "$(call core_native_path,$(CURDIR)/ebin)", "$(call core_native_path,$(DEPS_DIR)/*/ebin)", "$(call core_native_path,$(TEST_DIR))"]), - try - case $(1) of + try begin + CoverSetup(), + Res = case $(1) of all -> [true] =:= lists:usort([triq:check(M) || M <- [$(call comma_list,$(3))]]); module -> triq:check($(2)); function -> triq:check($(2)) - end - of + end, + CoverExport("$(COVER_DATA_DIR)/triq.coverdata"), + Res + end of true -> halt(0); _ -> halt(1) catch error:undef -> @@ -30,15 +34,15 @@ endef ifdef t ifeq (,$(findstring :,$(t))) -triq: test-build +triq: test-build cover-data-dir $(verbose) $(call erlang,$(call triq_check.erl,module,$(t))) else -triq: test-build +triq: test-build cover-data-dir $(verbose) echo Testing $(t)/0 $(verbose) $(call erlang,$(call triq_check.erl,function,$(t)())) endif else -triq: test-build +triq: test-build cover-data-dir $(eval MODULES := $(patsubst %,'%',$(sort $(notdir $(basename \ $(wildcard ebin/*.beam) $(call core_find,$(TEST_DIR)/,*.beam)))))) $(gen_verbose) $(call erlang,$(call triq_check.erl,all,undefined,$(MODULES))) |