Skip to content

Commit

Permalink
Wrap PULSE with ifdef and don't import eq/2
Browse files Browse the repository at this point in the history
Only define PULSE properties if PULSE exists and don't explicitly
import `eqc_statem:eq/2` as it is already imported on later EQC
verisons.
  • Loading branch information
rzezeski committed Jan 21, 2014
1 parent d0e621c commit 8ee058b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/sidejob_eqc.erl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
-record(state, {limit, width, restarts = 0, workers = []}).
-record(worker, {pid, scheduler, queue, status = ready, cmd}).

-import(eqc_statem, [eq/2, tag/2]).
-import(eqc_statem, [tag/2]).

-define(RESOURCE, resource).
-define(SLEEP, 1).
Expand Down Expand Up @@ -314,6 +314,7 @@ prop_par() ->
R == ok))
end)).

-ifdef(PULSE).
prop_pulse() ->
?SETUP(fun() -> N = erlang:system_flag(schedulers_online, 1),
fun() -> erlang:system_flag(schedulers_online, N) end end,
Expand All @@ -326,6 +327,7 @@ prop_pulse() ->
aggregate(command_names(Cmds),
pretty_commands(?MODULE, Cmds, HSR,
R == ok))))).
-endif.

kill_all_pids(Pid) when is_pid(Pid) -> exit(Pid, kill);
kill_all_pids([H|T]) -> kill_all_pids(H), kill_all_pids(T);
Expand All @@ -338,6 +340,7 @@ cleanup() ->
% error_logger:tty(true),
application:start(sidejob).

-ifdef(PULSE).
the_prop() -> prop_pulse().

test({N, h}) -> test({N * 60, min});
Expand Down Expand Up @@ -375,6 +378,7 @@ pulse_instrument(File) ->
code:purge(Mod),
code:load_file(Mod),
Mod.
-endif.

-ifdef(PULSE).
eqc_test_() ->
Expand Down

0 comments on commit 8ee058b

Please sign in to comment.