summaryrefslogtreecommitdiff
path: root/src/rebar_qc.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rebar_qc.erl')
-rw-r--r--src/rebar_qc.erl17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/rebar_qc.erl b/src/rebar_qc.erl
index 0920a5b..2531c0a 100644
--- a/src/rebar_qc.erl
+++ b/src/rebar_qc.erl
@@ -30,6 +30,8 @@
-include("rebar.hrl").
+-define(QC_DIR, ".qc").
+
%% ===================================================================
%% Public API
%% ===================================================================
@@ -104,22 +106,25 @@ load_qc_mod(Mod) ->
setup_codepath() ->
CodePath = code:get_path(),
- true = code:add_patha(rebar_utils:test_dir()),
- true = code:add_patha(rebar_utils:ebin_dir()),
+ true = code:add_patha(qc_dir()),
+ true = code:add_pathz(rebar_utils:ebin_dir()),
CodePath.
+qc_dir() ->
+ filename:join(rebar_utils:get_cwd(), ?QC_DIR).
+
run(Config, QC, QCOpts) ->
?DEBUG("qc_opts: ~p~n", [QCOpts]),
- ok = filelib:ensure_dir(?TEST_DIR ++ "/foo"),
+ ok = filelib:ensure_dir(filename:join(qc_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
+ %% Compile erlang code to ?QC_DIR, using a tweaked config
%% with appropriate defines, and include all the test modules
%% as well.
- {ok, _SrcErls} = rebar_erlc_compiler:test_compile(Config, "qc"),
+ {ok, _SrcErls} = rebar_erlc_compiler:test_compile(Config, "qc", ?QC_DIR),
case CompileOnly of
"true" ->
@@ -150,7 +155,7 @@ qc_module(QC=triq, _QCOpts, M) ->
qc_module(QC=eqc, QCOpts, M) -> QC:module(QCOpts, M).
find_prop_mods() ->
- Beams = rebar_utils:find_files(?TEST_DIR, ".*\\.beam\$"),
+ Beams = rebar_utils:find_files(?QC_DIR, ".*\\.beam\$"),
[M || M <- [rebar_utils:erl_to_mod(Beam) || Beam <- Beams], has_prop(M)].
has_prop(Mod) ->