Skip to content

Commit

Permalink
make eqc test less chatty
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulf Wiger committed Sep 12, 2010
1 parent 95a6320 commit f0807c9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
Binary file modified rebar
Binary file not shown.
5 changes: 3 additions & 2 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ ERLC += +debug_info

#EQC ?= /host/dev/eqc-1.16

EQC_ERLC = $(ERLC) -pa $(EQC)/ebin -I ../include
EQC_ERL = erl -pz ../ebin -pz $(EQC)/ebin -pz ./Unit-Quick-Files -kernel error_logger silent -sasl errlog_type error
EQC_ERLC = $(ERLC) -pa $(EQC)/ebin -I ../include -DEQC
EQC_ERL = erl -pz ../ebin -pz $(EQC)/ebin -pz ./Unit-Quick-Files


SOURCES = $(wildcard *.erl)

Expand Down
15 changes: 9 additions & 6 deletions src/Unit-Quick-Files/gproc_eqc.erl
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,14 @@

%% external API

%% UW: renamed to avoid confusion with eunit
good_number_of_tests() ->
3000.

%% hook to run from eunit. Note: a small number of tests.
%% I recommend running at least 3000 to get to interesting stuff.
%%
gproc_test_() ->
{timeout, 60, [fun() -> run(3000) end]}.
{timeout, 60, [fun() -> run(100) end]}.

%% When run from eunit, we need to set the group leader so that EQC
%% reporting (the dots) are made visible - that is, if that's what we want.
Expand All @@ -69,15 +73,15 @@ verbose_run(N) ->
%% 3000 tests seems like a large number, but this seems to be needed
%% to reach enough variation in the tests.
all_tests() ->
eqc:module({numtests, 3000}, ?MODULE).
eqc:module({numtests, good_number_of_tests()}, ?MODULE).

run() ->
run(3000).
run(good_number_of_tests()).

run(Num) ->
error_logger:delete_report_handler(error_logger_tty_h),
eqc:quickcheck(eqc:numtests(Num, prop_gproc())).


%% Command generator, S is the state
command(S) ->
oneof(
Expand Down Expand Up @@ -525,7 +529,6 @@ prop_gproc() ->

%% helpers
start_app() ->
application:start(sasl),
case application:start(gproc) of
{error, {already_started,_}} ->
stop_app(),
Expand Down

0 comments on commit f0807c9

Please sign in to comment.