diff options
author | Lukas Larsson <[email protected]> | 2012-05-30 17:59:18 +0200 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2012-05-30 17:59:18 +0200 |
commit | 46b41cd8d1c72b240ed34c52c71efa583fab9585 (patch) | |
tree | 332b8ce7ad6f4af2b633bd14cd8315e808be6ca3 /lib | |
parent | 8be5d558a7e9a0a949f2a38c0c531ea3e9c9f45a (diff) | |
download | otp-46b41cd8d1c72b240ed34c52c71efa583fab9585.tar.gz otp-46b41cd8d1c72b240ed34c52c71efa583fab9585.tar.bz2 otp-46b41cd8d1c72b240ed34c52c71efa583fab9585.zip |
Fix bug where auto skipped tcs would disappear
Diffstat (limited to 'lib')
-rw-r--r-- | lib/common_test/src/cth_surefire.erl | 9 |
1 files 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, "<?xml version=\"1.0\" encoding= \"UTF-8\" ?>", []), io:format(D, to_xml(State), []), catch file:sync(D), |