aboutsummaryrefslogtreecommitdiffstats
path: root/lib/eunit/src/eunit_surefire.erl
diff options
context:
space:
mode:
authorHenrik Nord <[email protected]>2011-09-28 15:03:38 +0200
committerHenrik Nord <[email protected]>2011-09-28 15:03:49 +0200
commitb1736de28b8b4138c7282c780fafd984046dd53e (patch)
tree52a18f08e137ca2e2dc0ebea361a879e139a85f0 /lib/eunit/src/eunit_surefire.erl
parentae097a5161b79f16f8b9a2d8f73e5e2f1792edec (diff)
parentc78dae078936252a605630170b81dcd3e09382fa (diff)
downloadotp-b1736de28b8b4138c7282c780fafd984046dd53e.tar.gz
otp-b1736de28b8b4138c7282c780fafd984046dd53e.tar.bz2
otp-b1736de28b8b4138c7282c780fafd984046dd53e.zip
Merge branch 'rc/eunit-2.2.1' into dev
* rc/eunit-2.2.1: removed some never-matching clauses reported by dialyzer updated author e-mails and homepages removed cvs keywords from files removed files that should not be checked in OTP-9591
Diffstat (limited to 'lib/eunit/src/eunit_surefire.erl')
-rw-r--r--lib/eunit/src/eunit_surefire.erl12
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/eunit/src/eunit_surefire.erl b/lib/eunit/src/eunit_surefire.erl
index 6e0a447105..2a6cbca14d 100644
--- a/lib/eunit/src/eunit_surefire.erl
+++ b/lib/eunit/src/eunit_surefire.erl
@@ -13,9 +13,7 @@
%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
%% USA
%%
-%% $Id: $
-%%
-%% @author Micka�l R�mond <[email protected]>
+%% @author Micka�l R�mond <[email protected]>
%% @copyright 2009 Micka�l R�mond, Paul Guyot
%% @see eunit
%% @doc Surefire reports for EUnit (Format used by Maven and Atlassian
@@ -58,7 +56,7 @@
{
name :: chars(),
description :: chars(),
- result :: ok | {failed, tuple()} | {aborted, tuple()} | {skipped, tuple()},
+ result :: ok | {failed, tuple()} | {aborted, tuple()} | {skipped, term()},
time :: integer(),
output :: binary()
}).
@@ -311,7 +309,6 @@ write_testcase(
output = Output},
FileDescriptor) ->
DescriptionAttr = case Description of
- <<>> -> [];
[] -> [];
_ -> [<<" description=\"">>, escape_attr(Description), <<"\"">>]
end,
@@ -320,7 +317,6 @@ write_testcase(
<<"\" name=\"">>, escape_attr(Name), <<"\"">>,
DescriptionAttr],
ContentAndEndTag = case {Result, Output} of
- {ok, []} -> [<<"/>">>, ?NEWLINE];
{ok, <<>>} -> [<<"/>">>, ?NEWLINE];
_ -> [<<">">>, ?NEWLINE, format_testcase_result(Result), format_testcase_output(Output), ?INDENT, <<"</testcase>">>, ?NEWLINE]
end,
@@ -369,7 +365,6 @@ format_testcase_result({skipped, Term}) ->
%% Empty output is simply the empty string.
%% Other output is inside a <system-out> xml tag.
%% ----------------------------------------------------------------------------
-format_testcase_output([]) -> [];
format_testcase_output(Output) ->
[?INDENT, ?INDENT, <<"<system-out>">>, escape_text(Output), ?NEWLINE, ?INDENT, ?INDENT, <<"</system-out>">>, ?NEWLINE].
@@ -387,8 +382,6 @@ format_time_s([Digit1, Digit2, Digit3 | Tail]) -> [lists:reverse(Tail), $., Digi
%% Escape a suite's name to generate the filename.
%% Remark: we might overwrite another testsuite's file.
%% ----------------------------------------------------------------------------
-escape_suitename([Head | _T] = List) when is_list(Head) ->
- escape_suitename(lists:flatten(List));
escape_suitename(Binary) when is_binary(Binary) ->
escape_suitename(binary_to_list(Binary));
escape_suitename("module '" ++ String) ->
@@ -396,7 +389,6 @@ escape_suitename("module '" ++ String) ->
escape_suitename(String) ->
escape_suitename(String, []).
-escape_suitename(Binary, Acc) when is_binary(Binary) -> escape_suitename(binary_to_list(Binary), Acc);
escape_suitename([], Acc) -> lists:reverse(Acc);
escape_suitename([$ | Tail], Acc) -> escape_suitename(Tail, [$_ | Acc]);
escape_suitename([$' | Tail], Acc) -> escape_suitename(Tail, Acc);