From 5999ef1c962c5018b74dac5fdc8c79e7cc390374 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Fri, 17 Apr 2015 08:33:41 -0500 Subject: ct: compile tests from test dir to outdir instead of compiling copies --- src/rebar_prv_common_test.erl | 12 ++++++------ 1 file 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), -- cgit v1.1