Просмотр исходного кода

Fix an error message when there is no test/ folder

Loïc Hoguin 10 лет назад
Родитель
Сommit
70e18a0ffc
2 измененных файлов с 8 добавлено и 0 удалено
  1. 4 0
      erlang.mk
  2. 4 0
      plugins/eunit.mk

+ 4 - 0
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
 

+ 4 - 0
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