summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTomas Janousek <tomi@nomi.cz>2014-06-20 16:58:49 +0200
committerLuis Rascão <luis.rascao@gmail.com>2016-02-19 18:48:25 +0000
commita1d8d3d28631a29e716b44264ddfe7c1303d095b (patch)
tree7e7ebc2e0e6019dc1cadb66d09d6f599b1172811 /src
parent022afd4b08fe024520849e50fd2bd03294fe210a (diff)
downloadrebar-a1d8d3d28631a29e716b44264ddfe7c1303d095b.tar.gz
Fix eunit_surefire crash with rebar eunit tests=...
This fixes the following crash: > =ERROR REPORT==== 20-Jun-2014::16:35:38 === > Error in process <0.40.0> with exit value: {function_clause,[{eunit_surefire,escape_suitename,[undefined,[]],[{file,"eunit_surefire.erl"},{line,416}]},{eunit_surefire,write_report,2,[{file,"eunit_surefire.erl"},{line,258}]},{lists,foreach,2,[{file,"lists.erl"},{line,1336}]},{...
Diffstat (limited to 'src')
-rw-r--r--src/rebar_eunit.erl7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/rebar_eunit.erl b/src/rebar_eunit.erl
index f1e2ac3..6026740 100644
--- a/src/rebar_eunit.erl
+++ b/src/rebar_eunit.erl
@@ -461,7 +461,7 @@ make_test_primitives(RawTests) ->
%% Generator
MakePrimitive(generator, M, F2)
end,
- [NewFunction|Acc]
+ [eunit_module_suite(M, NewFunction)|Acc]
end,
lists:foldl(F, [], RawTests).
@@ -473,6 +473,11 @@ pre15b02_eunit_primitive(test, M, F) ->
pre15b02_eunit_primitive(generator, M, F) ->
{generator, eunit_test:function_wrapper(M, F)}.
+% Add a test group for eunit_surefire to be able to deduce the testsuite.
+% Calling eunit:test({module, M}) does exactly this as well.
+eunit_module_suite(M, X) ->
+ {"module '" ++ atom_to_list(M) ++ "'", X}.
+
%%
%% == run tests ==
%%