summaryrefslogtreecommitdiff
path: root/src/rebar_qc.erl
diff options
context:
space:
mode:
authorTuncer Ayaz <tuncer.ayaz@gmail.com>2012-08-09 13:25:01 +0200
committerTuncer Ayaz <tuncer.ayaz@gmail.com>2012-08-09 14:04:53 +0200
commit803f6e8ecd6ef2e40e97cce6b514dd44279cd0f9 (patch)
treed8e7d468742ec56b89099faac68258ff0881a698 /src/rebar_qc.erl
parent87904ceef2ecde73e6563cba10b821041382d330 (diff)
Replace test-compile with compile_only=true option
Diffstat (limited to 'src/rebar_qc.erl')
-rw-r--r--src/rebar_qc.erl11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/rebar_qc.erl b/src/rebar_qc.erl
index 051400f..1800540 100644
--- a/src/rebar_qc.erl
+++ b/src/rebar_qc.erl
@@ -114,11 +114,22 @@ run(Config, QC, QCOpts) ->
ok = filelib:ensure_dir(?TEST_DIR ++ "/foo"),
CodePath = setup_codepath(),
+ CompileOnly = rebar_utils:get_experimental_global(Config, compile_only,
+ false),
%% Compile erlang code to ?TEST_DIR, using a tweaked config
%% with appropriate defines, and include all the test modules
%% as well.
{ok, _SrcErls} = rebar_erlc_compiler:test_compile(Config),
+ case CompileOnly of
+ "true" ->
+ true = code:set_path(CodePath),
+ ?CONSOLE("Compiled modules for qc~n", []);
+ false ->
+ run1(QC, QCOpts, CodePath)
+ end.
+
+run1(QC, QCOpts, CodePath) ->
TestModule = fun(M) -> qc_module(QC, QCOpts, M) end,
case lists:flatmap(TestModule, find_prop_mods()) of
[] ->