diff options
author | Tristan Sloughter <tristan.sloughter@gmail.com> | 2015-03-03 18:02:01 -0600 |
---|---|---|
committer | Tristan Sloughter <tristan.sloughter@gmail.com> | 2015-03-03 18:02:01 -0600 |
commit | cdca70dfecec5295a8e7328755a4af2f670237df (patch) | |
tree | 5744dec9fa26856fc451de997d56361ba14fc6dc /src | |
parent | 5fb6bc680a153766184f1f4f9f30b5cc9484d98d (diff) | |
parent | 1c56941225d943ca64df6cb304b2ba73b96c4b17 (diff) |
Merge pull request #211 from talentdeficit/ct_fixes
ct fixes
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_prv_common_test.erl | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/rebar_prv_common_test.erl b/src/rebar_prv_common_test.erl index b12ffde..8e72b7c 100644 --- a/src/rebar_prv_common_test.erl +++ b/src/rebar_prv_common_test.erl @@ -75,7 +75,7 @@ run_test(CTOpts, false) -> receive Result -> handle_quiet_results(CTOpts, Result) end. ct_opts(_State) -> - DefaultLogsDir = filename:join(["_build", "logs"]), + DefaultLogsDir = filename:join([rebar_dir:get_cwd(), "_build", "logs"]), [{dir, undefined, "dir", string, help(dir)}, %% comma-seperated list {suite, undefined, "suite", string, help(suite)}, %% comma-seperated list {group, undefined, "group", string, help(group)}, %% comma-seperated list @@ -317,28 +317,27 @@ resolve_ct_opts(State, CmdLineOpts) -> [{auto_compile, false}|lists:keydelete(dir, 1, Opts)]. compile_tests(State, TestApps, InDirs) -> - State1 = replace_src_dirs(State, InDirs), F = fun(AppInfo) -> AppDir = rebar_app_info:dir(AppInfo), S = case rebar_app_info:state(AppInfo) of undefined -> C = rebar_config:consult(AppDir), - rebar_state:new(State1, C, AppDir); + rebar_state:new(State, C, AppDir); AppState -> AppState end, - ok = rebar_erlc_compiler:compile(S, + ok = rebar_erlc_compiler:compile(replace_src_dirs(S, InDirs), ec_cnv:to_list(rebar_app_info:dir(AppInfo)), ec_cnv:to_list(rebar_app_info:out_dir(AppInfo))) end, lists:foreach(F, TestApps), - compile_bare_tests(State1, TestApps). + compile_bare_tests(State, TestApps, InDirs). -compile_bare_tests(State, TestApps) -> +compile_bare_tests(State, TestApps, InDirs) -> F = fun(App) -> rebar_app_info:dir(App) == rebar_dir:get_cwd() end, case lists:filter(F, TestApps) of %% compile just the `test` directory of the base dir - [] -> rebar_erlc_compiler:compile(State, + [] -> rebar_erlc_compiler:compile(replace_src_dirs(State, InDirs), rebar_dir:get_cwd(), rebar_dir:base_dir(State)); %% already compiled `./test` so do nothing |