From 46b41cd8d1c72b240ed34c52c71efa583fab9585 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 30 May 2012 17:59:18 +0200 Subject: Fix bug where auto skipped tcs would disappear --- lib/common_test/src/cth_surefire.erl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/common_test/src/cth_surefire.erl b/lib/common_test/src/cth_surefire.erl index 7bb6d65a9a..d04a8b07db 100644 --- a/lib/common_test/src/cth_surefire.erl +++ b/lib/common_test/src/cth_surefire.erl @@ -89,7 +89,12 @@ on_tc_fail(_TC, Res, State) -> {fail,lists:flatten(io_lib:format("~p",[Res]))} }, State#state{ test_cases = [NewTC | tl(TCs)]}. +on_tc_skip(Tc,{Type,Reason} = Res, State) when Type == tc_auto_skip -> + do_tc_skip(Res, end_tc(Tc,[],Res,init_tc(State,[]))); on_tc_skip(_Tc, Res, State) -> + do_tc_skip(Res, State). + +do_tc_skip(Res, State) -> TCs = State#state.test_cases, TC = hd(State#state.test_cases), NewTC = TC#testcase{ @@ -101,7 +106,7 @@ init_tc(State, Config) when is_list(Config) == false -> State#state{ timer = now(), tc_log = "" }; init_tc(State, Config) -> State#state{ timer = now(), - tc_log = proplists:get_value(tc_logfile, Config)}. + tc_log = proplists:get_value(tc_logfile, Config, [])}. end_tc(Func, Config, Res, State) when is_atom(Func) -> end_tc(atom_to_list(Func), Config, Res, State); @@ -138,7 +143,7 @@ close_suite(#state{ test_cases = TCs } = State) -> test_suites = [Suite | State#state.test_suites]}. terminate(State = #state{ test_cases = [] }) -> - {ok,D} = file:open(State#state.filepath,[write]), + {ok,D} = file:open(State#state.filepath,[write,{encoding,utf8}]), io:format(D, "", []), io:format(D, to_xml(State), []), catch file:sync(D), -- cgit v1.2.3