summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZandra <zandra@erlang.org>2016-04-18 16:09:56 +0200
committerZandra <zandra@erlang.org>2016-04-27 13:36:11 +0200
commit6452c3c2a8ccadd10403df3415015311515e1fa6 (patch)
treed7fdae8d634275569aec917aeb3d77becc89ebbe
parentfea24ae8d37b33e97ef1897d0d3b6cdb2338c051 (diff)
downloaderlang-6452c3c2a8ccadd10403df3415015311515e1fa6.tar.gz
fix cht_surefire bug when pre_init_per_suite fails
When pre_init_per_suite fails before reaching the cth_surefire pre_init_per_suite unexpected XML was produced. This commit fixes that.
-rw-r--r--lib/common_test/src/cth_surefire.erl3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/common_test/src/cth_surefire.erl b/lib/common_test/src/cth_surefire.erl
index 31a8e1c076..d6e855c02c 100644
--- a/lib/common_test/src/cth_surefire.erl
+++ b/lib/common_test/src/cth_surefire.erl
@@ -82,7 +82,8 @@ init(Path, Opts) ->
url_base = proplists:get_value(url_base,Opts),
timer = ?now }.
-pre_init_per_suite(Suite,SkipOrFail,State) when is_tuple(SkipOrFail) ->
+pre_init_per_suite(Suite,SkipOrFail,#state{ test_cases = [] } = State)
+ when is_tuple(SkipOrFail) ->
{SkipOrFail, init_tc(State#state{curr_suite = Suite,
curr_suite_ts = ?now},
SkipOrFail) };