diff options
author | Jeremy Raymond <jeraymond@gmail.com> | 2010-04-22 22:35:16 -0400 |
---|---|---|
committer | Jeremy Raymond <jeraymond@gmail.com> | 2010-04-22 22:35:16 -0400 |
commit | 87bca27644d4429add86dd274148dda9ae52eed4 (patch) | |
tree | ba847612238ea7833a94dda035f520e57b2f325b /src | |
parent | dbfd2a08cdd3ae7f22bb9c120dff9871d9ec9a36 (diff) |
Copy src files to .eunit so that cover can always find them
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_eunit.erl | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/rebar_eunit.erl b/src/rebar_eunit.erl index 1cfd14d..3fd68a4 100644 --- a/src/rebar_eunit.erl +++ b/src/rebar_eunit.erl @@ -63,6 +63,12 @@ eunit(Config, _File) -> %% {eunit_compile_opts, [{src_dirs, ["test"]}]} TestErls = rebar_utils:find_files("test", ".*\\.erl\$"), + %% Copy source files to eunit dir for cover in case they are not directly + %% in src but in a subdirectory of src. Cover only looks in cwd and ../src + %% for source files. + SrcErls = rebar_utils:find_files("src", ".*\\.erl\$"), + ok = rebar_file_utils:cp_r(SrcErls, ?EUNIT_DIR), + %% Compile erlang code to ?EUNIT_DIR, using a tweaked config %% with appropriate defines for eunit, and include all the test modules %% as well. |