aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2014-07-25 14:46:09 +0200
committerLoïc Hoguin <[email protected]>2014-07-25 14:46:09 +0200
commitb0c5f662f45fbbb72d9e96f8514fcb56a5c83aab (patch)
tree33a7a7cb58216bca21a7cf55d2d0a83a96a0778e
parent5d521d2b8d58a9a93c75a559115aceacd0d1a429 (diff)
parent2fa298126ef0a338be67f2f59d3c15963dc30f8c (diff)
downloaderlang.mk-b0c5f662f45fbbb72d9e96f8514fcb56a5c83aab.tar.gz
erlang.mk-b0c5f662f45fbbb72d9e96f8514fcb56a5c83aab.tar.bz2
erlang.mk-b0c5f662f45fbbb72d9e96f8514fcb56a5c83aab.zip
Merge branch 'auto-detect-ct-suites' of git://github.com/sedrik/erlang.mk
-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 3ff5c65..ca30ca6 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}'