Skip to content

Commit 9e5cf80

Browse files
committed
Merge pull request #604 from basho/bugfix/jra/listkeys-eqfsm-ifdef
Detect EQC in riak_tests and set EQC in rebar plugin
2 parents bda1b5c + 847617c commit 9e5cf80

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-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.

tests/verify_listkeys_eqcfsm.erl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
-module(verify_listkeys_eqcfsm).
22
-compile(export_all).
33

4+
-ifdef(EQC).
45
-include_lib("eqc/include/eqc.hrl").
56
-include_lib("eqc/include/eqc_fsm.hrl").
67
-include_lib("eunit/include/eunit.hrl").
@@ -239,3 +240,4 @@ sort_keys({error, _}=Error) ->
239240
sort_keys(Keys) ->
240241
lists:usort(Keys).
241242

243+
-endif. % EQC

0 commit comments

Comments
 (0)