diff options
Diffstat (limited to 'plugins/proper.mk')
-rw-r--r-- | plugins/proper.mk | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/plugins/proper.mk b/plugins/proper.mk index b749d9e..6262199 100644 --- a/plugins/proper.mk +++ b/plugins/proper.mk @@ -9,6 +9,7 @@ ifeq ($(filter proper,$(DEPS) $(TEST_DEPS)),proper) tests:: proper define proper_check.erl + $(call cover.erl) code:add_pathsa([ "$(call core_native_path,$(CURDIR)/ebin)", "$(call core_native_path,$(DEPS_DIR)/*/ebin)", @@ -24,13 +25,16 @@ define proper_check.erl end || {F, 0} <- M:module_info(exports)]) end, - try - case $(1) of + try begin + CoverSetup(), + Res = case $(1) of all -> [true] =:= lists:usort([Module(M) || M <- [$(call comma_list,$(3))]]); module -> Module($(2)); function -> proper:quickcheck($(2), nocolors) - end - of + end, + CoverExport("$(COVER_DATA_DIR)/proper.coverdata"), + Res + end of true -> halt(0); _ -> halt(1) catch error:undef -> @@ -41,15 +45,15 @@ endef ifdef t ifeq (,$(findstring :,$(t))) -proper: test-build +proper: test-build cover-data-dir $(verbose) $(call erlang,$(call proper_check.erl,module,$(t))) else -proper: test-build +proper: test-build cover-data-dir $(verbose) echo Testing $(t)/0 $(verbose) $(call erlang,$(call proper_check.erl,function,$(t)())) endif else -proper: test-build +proper: 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 proper_check.erl,all,undefined,$(MODULES))) |