aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2014-03-24 14:01:40 +0100
committerLoïc Hoguin <[email protected]>2014-03-24 14:02:51 +0100
commit6b06eee0e7a4e752de15972226b9a6f63d6378c1 (patch)
treec04232693faa4df9ee6721adeeb23a5e59f1b09a
parent798be5a31f133eb05e13334387ccd90b42861069 (diff)
downloaderlang.mk-6b06eee0e7a4e752de15972226b9a6f63d6378c1.tar.gz
erlang.mk-6b06eee0e7a4e752de15972226b9a6f63d6378c1.tar.bz2
erlang.mk-6b06eee0e7a4e752de15972226b9a6f63d6378c1.zip
Add TEST_ERLC_OPTS option
-rw-r--r--README.md5
-rw-r--r--erlang.mk9
2 files changed, 11 insertions, 3 deletions
diff --git a/README.md b/README.md
index bec67d9..88f6223 100644
--- a/README.md
+++ b/README.md
@@ -180,6 +180,11 @@ the same folder as expected.
documented in one place; follow the links to get to the options for
the various operations of the documentation generation.
+`TEST_ERLC_OPTS` allows you to change the `erlc` compilation
+options that are used for building the project for testing, but
+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.
diff --git a/erlang.mk b/erlang.mk
index 093a269..7da0151 100644
--- a/erlang.mk
+++ b/erlang.mk
@@ -209,11 +209,14 @@ clean-docs:
$(foreach dep,$(TEST_DEPS),$(eval $(call dep_target,$(dep))))
+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}'
+
build-test-deps: $(ALL_TEST_DEPS_DIRS)
@for dep in $(ALL_TEST_DEPS_DIRS) ; do $(MAKE) -C $$dep; done
build-tests: build-test-deps
- $(gen_verbose) erlc -v $(ERLC_OPTS) -o test/ \
+ $(gen_verbose) erlc -v $(TEST_ERLC_OPTS) -o test/ \
$(wildcard test/*.erl test/*/*.erl) -pa ebin/
CT_OPTS ?=
@@ -228,7 +231,7 @@ CT_RUN = ct_run \
CT_SUITES ?=
define test_target
-test_$(1): ERLC_OPTS += -DTEST=1 +'{parse_transform, eunit_autoexport}'
+test_$(1): ERLC_OPTS = $(TEST_ERLC_OPTS)
test_$(1): clean deps app build-tests
@if [ -d "test" ] ; \
then \
@@ -240,7 +243,7 @@ endef
$(foreach test,$(CT_SUITES),$(eval $(call test_target,$(test))))
-tests: ERLC_OPTS += -DTEST=1 +'{parse_transform, eunit_autoexport}'
+tests: ERLC_OPTS = $(TEST_ERLC_OPTS)
tests: clean deps app build-tests
@if [ -d "test" ] ; \
then \