Browse Source

Only autodetect if we have a test directory.

Sedrik 11 years ago
parent
commit
e8d3f9c8e1
2 changed files with 10 additions and 2 deletions
  1. 5 1
      erlang.mk
  2. 5 1
      plugins/ct.mk

+ 5 - 1
erlang.mk

@@ -232,7 +232,11 @@ CT_RUN = ct_run \
 	-dir test \
 	-logdir logs
 
-CT_SUITES ?= $(sort $(subst _SUITE.erl,,$(shell find test -type f -name \*_SUITE.erl -exec basename {} \;)))
+ifneq ($(wildcard test/),)
+	CT_SUITES ?= $(sort $(subst _SUITE.erl,,$(shell find test -type f -name \*_SUITE.erl -exec basename {} \;)))
+else
+	CT_SUITES ?=
+endif
 
 define test_target
 test_$(1): ERLC_OPTS = $(TEST_ERLC_OPTS)

+ 5 - 1
plugins/ct.mk

@@ -6,7 +6,11 @@
 # Configuration.
 
 CT_OPTS ?=
-CT_SUITES ?= $(sort $(subst _SUITE.erl,,$(shell find test -type f -name \*_SUITE.erl -exec basename {} \;)))
+ifneq ($(wildcard test/),)
+	CT_SUITES ?= $(sort $(subst _SUITE.erl,,$(shell find test -type f -name \*_SUITE.erl -exec basename {} \;)))
+else
+	CT_SUITES ?=
+endif
 
 TEST_ERLC_OPTS ?= +debug_info +warn_export_vars +warn_shadow_vars +warn_obsolete_guard
 TEST_ERLC_OPTS += -DTEST=1 -DEXTRA=1 +'{parse_transform, eunit_autoexport}'