summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Sloughter <t@crashfast.com>2015-04-17 08:33:41 -0500
committerTristan Sloughter <t@crashfast.com>2015-04-17 09:26:21 -0500
commit5999ef1c962c5018b74dac5fdc8c79e7cc390374 (patch)
tree2b6a7d4cc3ef56b18963ebc1d376d2958cc8ff3a
parent3126e7eb5561abea4a6674dbb528a550a2869cec (diff)
ct: compile tests from test dir to outdir instead of compiling copies
-rw-r--r--src/rebar_prv_common_test.erl12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/rebar_prv_common_test.erl b/src/rebar_prv_common_test.erl
index c1e263e..1d5806b 100644
--- a/src/rebar_prv_common_test.erl
+++ b/src/rebar_prv_common_test.erl
@@ -242,7 +242,7 @@ copy_and_compile_test_suites(State, Opts) ->
Dirs = find_suite_dirs(AllSuites),
lists:foreach(fun(S) ->
NewPath = copy(State, S),
- compile_dir(State, NewPath)
+ compile_dir(State, S, NewPath)
end, Dirs),
NewSuites = lists:map(fun(S) -> retarget_path(State, S) end, AllSuites),
[{suite, NewSuites}|lists:keydelete(suite, 1, Opts)]
@@ -254,12 +254,12 @@ copy_and_compile_test_dirs(State, Opts) ->
%% dir is a single directory
Dir when is_list(Dir), is_integer(hd(Dir)) ->
NewPath = copy(State, Dir),
- [{dir, compile_dir(State, NewPath)}|lists:keydelete(dir, 1, Opts)];
+ [{dir, compile_dir(State, Dir, NewPath)}|lists:keydelete(dir, 1, Opts)];
%% dir is a list of directories
Dirs when is_list(Dirs) ->
NewDirs = lists:map(fun(Dir) ->
NewPath = copy(State, Dir),
- compile_dir(State, NewPath)
+ compile_dir(State, Dir, NewPath)
end, Dirs),
[{dir, NewDirs}|lists:keydelete(dir, 1, Opts)]
end.
@@ -294,11 +294,11 @@ copy(State, Target) ->
NewTarget
end.
-compile_dir(State, Dir) ->
+compile_dir(State, Dir, OutDir) ->
NewState = replace_src_dirs(State, [Dir]),
- ok = rebar_erlc_compiler:compile(NewState, rebar_dir:base_dir(State), Dir),
+ ok = rebar_erlc_compiler:compile(NewState, rebar_dir:base_dir(State), OutDir),
ok = maybe_cover_compile(State, Dir),
- Dir.
+ OutDir.
retarget_path(State, Path) ->
ProjectApps = rebar_state:project_apps(State),