summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTuncer Ayaz <tuncer.ayaz@gmail.com>2012-07-31 16:39:25 +0200
committerTuncer Ayaz <tuncer.ayaz@gmail.com>2012-07-31 16:39:25 +0200
commitc9ddb8325a22ddd48b79208f8236ad8c18ebe651 (patch)
tree7a5d760fe09187855996aef4ab88e79a063d778a /src
parentad2e94b96b262ca72cd5b93c16b973a28dff9a95 (diff)
Quote EUnit User's guide about _tests.beam handling
Diffstat (limited to 'src')
-rw-r--r--src/rebar_eunit.erl12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/rebar_eunit.erl b/src/rebar_eunit.erl
index 114ef3d..9b525d8 100644
--- a/src/rebar_eunit.erl
+++ b/src/rebar_eunit.erl
@@ -78,6 +78,18 @@ eunit(Config, _AppFile) ->
%% eunit won't doubly run them and so cover only calculates
%% coverage on production code. However, keep "*_tests" modules
%% that are not automatically included by eunit.
+ %%
+ %% From 'Primitives' in the EUnit User's Guide
+ %% http://www.erlang.org/doc/apps/eunit/chapter.html
+ %% "In addition, EUnit will also look for another module whose
+ %% name is ModuleName plus the suffix _tests, and if it exists,
+ %% all the tests from that module will also be added. (If
+ %% ModuleName already contains the suffix _tests, this is not
+ %% done.) E.g., the specification {module, mymodule} will run all
+ %% tests in the modules mymodule and mymodule_tests. Typically,
+ %% the _tests module should only contain test cases that use the
+ %% public interface of the main module (and no other code)."
+
AllBeamFiles = rebar_utils:beams(?TEST_DIR),
{BeamFiles, TestBeamFiles} =
lists:partition(fun(N) -> string:str(N, "_tests.beam") =:= 0 end,