aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-03-06 19:08:59 +0100
committerLoïc Hoguin <[email protected]>2015-03-06 19:08:59 +0100
commit70e18a0ffcaa7ab347798418b950252dc525f612 (patch)
treedbc22e3da4757d4c115cf1ed7e5c7356ba7f6ca6
parent0d1a555a287f0d1c91c3880e18570e0b5d5d8a50 (diff)
downloaderlang.mk-70e18a0ffcaa7ab347798418b950252dc525f612.tar.gz
erlang.mk-70e18a0ffcaa7ab347798418b950252dc525f612.tar.bz2
erlang.mk-70e18a0ffcaa7ab347798418b950252dc525f612.zip
Fix an error message when there is no test/ folder
-rw-r--r--erlang.mk4
-rw-r--r--plugins/eunit.mk4
2 files changed, 8 insertions, 0 deletions
diff --git a/erlang.mk b/erlang.mk
index a0cf657..93cf174 100644
--- a/erlang.mk
+++ b/erlang.mk
@@ -1123,6 +1123,9 @@ distclean-escript:
ifeq ($(strip $(TEST_DIR)),)
TAGGED_EUNIT_TESTS = {dir,"ebin"}
else
+ifeq ($(wildcard $(TEST_DIR)),)
+TAGGED_EUNIT_TESTS = {dir,"ebin"}
+else
# All modules in TEST_DIR
TEST_DIR_MODS = $(notdir $(basename $(shell find $(TEST_DIR) -type f -name *.beam)))
# All modules in 'ebin'
@@ -1132,6 +1135,7 @@ EUNIT_EBIN_MODS = $(notdir $(basename $(shell find ebin -type f -name *.beam)))
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
+endif
EUNIT_OPTS ?= verbose
diff --git a/plugins/eunit.mk b/plugins/eunit.mk
index c59883d..3f198cb 100644
--- a/plugins/eunit.mk
+++ b/plugins/eunit.mk
@@ -9,6 +9,9 @@
ifeq ($(strip $(TEST_DIR)),)
TAGGED_EUNIT_TESTS = {dir,"ebin"}
else
+ifeq ($(wildcard $(TEST_DIR)),)
+TAGGED_EUNIT_TESTS = {dir,"ebin"}
+else
# All modules in TEST_DIR
TEST_DIR_MODS = $(notdir $(basename $(shell find $(TEST_DIR) -type f -name *.beam)))
# All modules in 'ebin'
@@ -18,6 +21,7 @@ EUNIT_EBIN_MODS = $(notdir $(basename $(shell find ebin -type f -name *.beam)))
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
+endif
EUNIT_OPTS ?= verbose