<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hello,<br>
<br>
Thanks for the bug report and provided fix. I'll include it in the
next release. <br>
<br>
I'm a bit uncertain what you mean with the first issue though. The
code is already the way you propose it to be:
<a class="moz-txt-link-freetext" href="https://github.com/erlang/otp/blob/bb1734e95a5f6a7315819c24bc1fdd799534c787/lib/common_test/src/cth_surefire.erl#L86">https://github.com/erlang/otp/blob/bb1734e95a5f6a7315819c24bc1fdd799534c787/lib/common_test/src/cth_surefire.erl#L86</a><br>
<br>
Lukas<br>
<br>
On 05/05/12 14:01, Jóvan Sean Dippenaar wrote:
<blockquote
cite="mid:E58097EA-732F-49AB-9A41-6F3F2EF92035@aeonmind.co.za"
type="cite">
<pre wrap="">Errors in Common Test 1.6.1 - cth_surefire.erl
cth_surefire.erl has a two errors :
1. " on_tc_fail( TC, Res, State)" should be "on_tc_fail(_Tc, Res, State)", as the TC causes a bad match on inside the function with regards to the TC record.
this causes surefire results to generate .xml which indicate passed tests when in actual fact the tests have failed.
2. failures in "init_per_suite" cause "on_tc_skip" to be called which is correct up until "on_tc_skip" is called for "end_per_suite" as well. This also means that
"post_end_per_suite" is never called, which is the problem. As "post_end_per_suite" takes all test cases results and places in State#state{ test_suites ).
This is important as the xml generation on terminate iterates thru the test suites.
here's a fix :
on_tc_skip(Tc, Res, State) ->
TCs = State#state.test_cases,
[TC | RestTCs ] = TCs,
{CurTC, CurRestTCs} = case TC#testcase.failure of
passed -> {TC, RestTCs};
_OtherFailure ->
Name = atom_to_list(Tc),
NTC = new_tc_rec(Name, State#state{timer = now()}),
{NTC, TCs}
end,
NewTC = CurTC#testcase{
failure = {skipped, lists:flatten(io_lib:format("~p",[Res])) }
},
NewState = State#state{ test_cases = [NewTC | CurRestTCs]},
case Tc of
end_per_suite ->
Suite = get_suite(NewState, TCs),
AltState = NewState#state{ test_cases = [], test_suites = [Suite | NewState#state.test_suites]},
AltState;
_Other ->
NewState
end.
/ Jovan Sean Dippenaar - Aeonmind Enterprises
</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">
</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
erlang-bugs mailing list
<a class="moz-txt-link-abbreviated" href="mailto:erlang-bugs@erlang.org">erlang-bugs@erlang.org</a>
<a class="moz-txt-link-freetext" href="http://erlang.org/mailman/listinfo/erlang-bugs">http://erlang.org/mailman/listinfo/erlang-bugs</a>
</pre>
</blockquote>
</body>
</html>