Add handling to rebar plugin to detect the presence of EQC.

This commit is contained in:
Jon Anderson 2014-05-13 14:02:57 -04:00
parent 6fd07010d7
commit 847617c8e9

View File

@ -95,5 +95,19 @@ compilation_config(Conf) ->
ErlOpts = proplists:get_value(erl_opts, element(3, Conf)), ErlOpts = proplists:get_value(erl_opts, element(3, Conf)),
ErlOpts1 = proplists:delete(src_dirs, ErlOpts), ErlOpts1 = proplists:delete(src_dirs, ErlOpts),
ErlOpts2 = [{parse_transform,lager_transform},{outdir, option(test_output, Conf)}, {src_dirs, option(test_paths, Conf)} | ErlOpts1], ErlOpts2 = [{parse_transform,lager_transform},{outdir, option(test_output, Conf)}, {src_dirs, option(test_paths, Conf)} | ErlOpts1],
io:format("erl_opts: ~p~n", [ErlOpts2]), case eqc_present() of
rebar_config:set(C2, erl_opts, ErlOpts2). true ->
ErlOpts3 = [{d, 'EQC'},{d, 'TEST'} | ErlOpts2];
false ->
ErlOpts3 = [{d, 'TEST'} | ErlOpts2]
end,
io:format("erl_opts: ~p~n", [ErlOpts3]),
rebar_config:set(C2, erl_opts, ErlOpts3).
eqc_present() ->
case catch eqc:version() of
{'EXIT', {undef, _}} ->
false;
_ ->
true
end.