summaryrefslogtreecommitdiff
path: root/src/rebar_prv_common_test.erl
diff options
context:
space:
mode:
authorTristan Sloughter <tristan.sloughter@gmail.com>2015-04-11 16:52:08 -0500
committerTristan Sloughter <tristan.sloughter@gmail.com>2015-04-11 16:52:08 -0500
commit39908fb5118444daa5c6e3f6787524021aa60fbd (patch)
tree2d921b75f020dc11bd65ee249993d297e1cab337 /src/rebar_prv_common_test.erl
parentc3026cc8ced2bf44f3b816089c4d28b34c4356eb (diff)
parentd1569a9d46979275117290ab3ea07b631907e6d2 (diff)
Merge pull request #333 from talentdeficit/ct_root_suite_fix
disallow suites in project root
Diffstat (limited to 'src/rebar_prv_common_test.erl')
-rw-r--r--src/rebar_prv_common_test.erl6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/rebar_prv_common_test.erl b/src/rebar_prv_common_test.erl
index 7602906..d183317 100644
--- a/src/rebar_prv_common_test.erl
+++ b/src/rebar_prv_common_test.erl
@@ -70,6 +70,8 @@ format_error({failures_running_tests, {Failed, AutoSkipped}}) ->
io_lib:format("Failures occured running tests: ~b", [Failed+AutoSkipped]);
format_error({error_running_tests, Reason}) ->
io_lib:format("Error running tests: ~p", [Reason]);
+format_error(suite_at_project_root) ->
+ io_lib:format("Test suites can't be located in project root", []);
format_error({error, Reason}) ->
io_lib:format("Unknown error: ~p", [Reason]).
@@ -269,6 +271,10 @@ find_suite_dirs(Suites) ->
lists:usort(AllDirs).
copy(State, Target) ->
+ case reduce_path(Target) == rebar_state:dir(State) of
+ true -> erlang:error(suite_at_project_root);
+ false -> ok
+ end,
case retarget_path(State, Target) of
%% directory lies outside of our project's file structure so
%% don't copy it