diff options
author | alisdair sullivan <alisdair.sullivan@askuity.com> | 2016-03-03 14:45:47 -0800 |
---|---|---|
committer | alisdair sullivan <alisdair.sullivan@askuity.com> | 2016-03-03 14:45:47 -0800 |
commit | d75fa758d86fa062164671e0154ed1b05691b0f9 (patch) | |
tree | a8b67f0b4306954ccaff4fc3bdbbf3fa6a7c6937 /src | |
parent | 925ecefc12fffd4075f5dd6d1a9c31ae07610e9b (diff) |
Revert "define the 'EUNIT' macro in the test profile"
This reverts commit 4c32c52b557c66ac6e6764efb1ed9135c00a3c20.
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar3.erl | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/rebar3.erl b/src/rebar3.erl index ab7d35a..c1a1ae4 100644 --- a/src/rebar3.erl +++ b/src/rebar3.erl @@ -337,19 +337,18 @@ state_from_global_config(Config, GlobalConfigFile) -> test_state(State) -> ErlOpts = rebar_state:get(State, erl_opts, []), - TestOpts = safe_define_test_macro(ErlOpts, 'TEST'), - MoreTestOpts = safe_define_test_macro(ErlOpts, 'EUNIT'), - [{extra_src_dirs, ["test"]}, {erl_opts, TestOpts ++ MoreTestOpts}]. + TestOpts = safe_define_test_macro(ErlOpts), + [{extra_src_dirs, ["test"]}, {erl_opts, TestOpts}]. -safe_define_test_macro(Opts, Macro) -> +safe_define_test_macro(Opts) -> %% defining a compile macro twice results in an exception so - %% make sure 'TEST' or 'EUNIT' is only defined once - case test_defined(Opts, Macro) of + %% make sure 'TEST' is only defined once + case test_defined(Opts) of true -> []; - false -> [{d, Macro}] + false -> [{d, 'TEST'}] end. -test_defined([{d, Macro}|_], Macro) -> true; -test_defined([{d, Macro, true}|_], Macro) -> true; -test_defined([_|Rest], Macro) -> test_defined(Rest, Macro); -test_defined([], _) -> false. +test_defined([{d, 'TEST'}|_]) -> true; +test_defined([{d, 'TEST', true}|_]) -> true; +test_defined([_|Rest]) -> test_defined(Rest); +test_defined([]) -> false. |