summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDave Smith <dizzyd@dizzyd.com>2009-12-08 15:52:53 -0700
committerDave Smith <dizzyd@dizzyd.com>2009-12-08 15:52:53 -0700
commitb088139ed09c16816155eb79560b64878ebc2ab6 (patch)
treeb2fbd0647c3258a747a2e69363f3b245358fa894 /src
parentffa0cda467ce851ff57aa23b92ab8f3fd679fb33 (diff)
Remove unnecessary debug in _core; adding EQC flag for eunit builds
Diffstat (limited to 'src')
-rw-r--r--src/rebar_core.erl1
-rw-r--r--src/rebar_eunit.erl26
2 files changed, 24 insertions, 3 deletions
diff --git a/src/rebar_core.erl b/src/rebar_core.erl
index d39a425..61e9dee 100644
--- a/src/rebar_core.erl
+++ b/src/rebar_core.erl
@@ -43,7 +43,6 @@ run(["version"]) ->
?CONSOLE("Version ~s built ~s\n", [Vsn, ?BUILD_TIME]),
ok;
run(Args) ->
- ?CONSOLE("Args: ~p\n", [Args]),
%% Filter all the flags (i.e. string of form key=value) from the
%% command line arguments. What's left will be the commands to run.
Commands = filter_flags(Args, []),
diff --git a/src/rebar_eunit.erl b/src/rebar_eunit.erl
index d63ff92..69f8a0a 100644
--- a/src/rebar_eunit.erl
+++ b/src/rebar_eunit.erl
@@ -91,9 +91,17 @@ clean(Config, File) ->
%% ===================================================================
compile_erl(Source, Config) ->
+ case is_quickcheck_avail() of
+ true ->
+ EqcOpts = [{d, 'EQC'}];
+ false ->
+ EqcOpts = []
+ end,
+
ErlOpts = rebar_config:get_list(Config, erl_opts, []),
EunitOpts = rebar_config:get_list(Config, eunit_compile_opts, []),
- Opts = [{i, "include"}, {outdir, ?EUNIT_DIR}, {d, 'TEST'}, debug_info, report] ++ ErlOpts ++ EunitOpts,
+ Opts = [{i, "include"}, {outdir, ?EUNIT_DIR}, {d, 'TEST'}, debug_info, report] ++
+ ErlOpts ++ EunitOpts ++ EqcOpts,
case compile:file(Source, Opts) of
{ok, _} ->
ok;
@@ -101,6 +109,20 @@ compile_erl(Source, Config) ->
?FAIL
end.
-
+is_quickcheck_avail() ->
+ case erlang:get(is_quickcheck_avail) of
+ undefined ->
+ case code:lib_dir(eqc, include) of
+ {error, bad_name} ->
+ IsAvail = false;
+ Dir ->
+ IsAvail = filelib:is_file(filename:join(Dir, "eqc.hrl"))
+ end,
+ erlang:put(is_quickcheck_avail, IsAvail),
+ ?DEBUG("Quickcheck availability: ~p\n", [IsAvail]),
+ IsAvail;
+ IsAvail ->
+ IsAvail
+ end.