aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2014-03-26 15:42:29 +0100
committerDan Gudmundsson <[email protected]>2014-03-26 15:42:29 +0100
commit978f3cbfa9eb46dcb6987e2b0ce5b4b7727dd17b (patch)
tree4dea247532bf9199b0360824fb81239ee1b166df /lib
parentc5e3c774bd12cc15a04dd9880cad6eb66d2541be (diff)
parent32f8a87f9b60668d09be276e8b6fdf2f34cfa880 (diff)
downloadotp-978f3cbfa9eb46dcb6987e2b0ce5b4b7727dd17b.tar.gz
otp-978f3cbfa9eb46dcb6987e2b0ce5b4b7727dd17b.tar.bz2
otp-978f3cbfa9eb46dcb6987e2b0ce5b4b7727dd17b.zip
Merge branch 'dgud/test_server/throw_skip'
* dgud/test_server/throw_skip: test_server: Allow init_per_ function to throw skip
Diffstat (limited to 'lib')
-rw-r--r--lib/test_server/src/test_server.erl10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/test_server/src/test_server.erl b/lib/test_server/src/test_server.erl
index 82672521f7..9b05bddf63 100644
--- a/lib/test_server/src/test_server.erl
+++ b/lib/test_server/src/test_server.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -1208,6 +1208,10 @@ do_init_per_testcase(Mod, Args) ->
"a Config list.\n",[]},
{skip,{failed,{Mod,init_per_testcase,bad_return}}}
catch
+ throw:{Skip,Reason} when Skip =:= skip; Skip =:= skipped ->
+ {skip,Reason};
+ exit:{Skip,Reason} when Skip =:= skip; Skip =:= skipped ->
+ {skip,Reason};
throw:Other ->
set_loc(erlang:get_stacktrace()),
Line = get_loc(),
@@ -1378,6 +1382,10 @@ ts_tc(M, F, A) ->
Result = try
apply(M, F, A)
catch
+ throw:{skip, Reason} -> {skip, Reason};
+ throw:{skipped, Reason} -> {skip, Reason};
+ exit:{skip, Reason} -> {skip, Reason};
+ exit:{skipped, Reason} -> {skip, Reason};
Type:Reason ->
Stk = erlang:get_stacktrace(),
set_loc(Stk),