summaryrefslogtreecommitdiff
path: root/src/rebar_qc.erl
diff options
context:
space:
mode:
authorTuncer Ayaz <tuncer.ayaz@gmail.com>2012-08-09 18:37:26 +0200
committerTuncer Ayaz <tuncer.ayaz@gmail.com>2012-08-09 18:37:26 +0200
commite47d643ea3b490fd4835629e86d90fa3121122de (patch)
tree3393baa4fc23a36086c34a51eaa2991b667224a3 /src/rebar_qc.erl
parentb5e0d6d5db19fef0b17e585354f75f57267df142 (diff)
Use separate dirs for eunit and qc
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) ->