summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoralisdair sullivan <alisdairsullivan@yahoo.ca>2015-04-11 14:45:08 -0700
committeralisdair sullivan <alisdairsullivan@yahoo.ca>2015-04-11 14:46:24 -0700
commitd1569a9d46979275117290ab3ea07b631907e6d2 (patch)
tree2d921b75f020dc11bd65ee249993d297e1cab337 /src
parentc3026cc8ced2bf44f3b816089c4d28b34c4356eb (diff)
disallow suites in project root
fixes #331
Diffstat (limited to 'src')
-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