Skip to content

Commit 847617c

Browse files
committed
Add handling to rebar plugin to detect the presence of EQC.
1 parent 6fd0701 commit 847617c

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/rebar_riak_test_plugin.erl

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,19 @@ compilation_config(Conf) ->
9595
ErlOpts = proplists:get_value(erl_opts, element(3, Conf)),
9696
ErlOpts1 = proplists:delete(src_dirs, ErlOpts),
9797
ErlOpts2 = [{parse_transform,lager_transform},{outdir, option(test_output, Conf)}, {src_dirs, option(test_paths, Conf)} | ErlOpts1],
98-
io:format("erl_opts: ~p~n", [ErlOpts2]),
99-
rebar_config:set(C2, erl_opts, ErlOpts2).
98+
case eqc_present() of
99+
true ->
100+
ErlOpts3 = [{d, 'EQC'},{d, 'TEST'} | ErlOpts2];
101+
false ->
102+
ErlOpts3 = [{d, 'TEST'} | ErlOpts2]
103+
end,
104+
io:format("erl_opts: ~p~n", [ErlOpts3]),
105+
rebar_config:set(C2, erl_opts, ErlOpts3).
106+
107+
eqc_present() ->
108+
case catch eqc:version() of
109+
{'EXIT', {undef, _}} ->
110+
false;
111+
_ ->
112+
true
113+
end.

0 commit comments

Comments
 (0)