aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md5
-rw-r--r--erlang.mk2
-rw-r--r--plugins/ct.mk2
3 files changed, 5 insertions, 4 deletions
diff --git a/README.md b/README.md
index 88f6223..de968d5 100644
--- a/README.md
+++ b/README.md
@@ -186,8 +186,9 @@ also the tests themselves. Unlike `ERLC_OPTS` it doesn't consider
warnings to be errors and does not warn when `export_all` is used.
`CT_SUITES` is the list of common_test suites to run when you use
-the `make tests` command. If your suite module is named `ponies_SUITE`
-then you only need to put `ponies` in the list.
+the `make tests` command. The default behaviour is to autodetect your
+common_test suites. If you only want to run the tests in `ponies_SUITE`
+you should set this variable to `ponies`.
`CT_OPTS` allows you to specify extra common_test options.
diff --git a/erlang.mk b/erlang.mk
index d29632c..006047f 100644
--- a/erlang.mk
+++ b/erlang.mk
@@ -232,7 +232,7 @@ CT_RUN = ct_run \
-dir test \
-logdir logs
-CT_SUITES ?=
+CT_SUITES ?= $(sort $(subst _SUITE.erl,,$(shell find test -type f -name \*_SUITE.erl -exec basename {} \;)))
define test_target
test_$(1): ERLC_OPTS = $(TEST_ERLC_OPTS)
diff --git a/plugins/ct.mk b/plugins/ct.mk
index a6d8f52..a27cc46 100644
--- a/plugins/ct.mk
+++ b/plugins/ct.mk
@@ -6,7 +6,7 @@
# Configuration.
CT_OPTS ?=
-CT_SUITES ?=
+CT_SUITES ?= $(sort $(subst _SUITE.erl,,$(shell find test -type f -name \*_SUITE.erl -exec basename {} \;)))
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}'