summaryrefslogtreecommitdiff
path: root/test/rebar_eunit_SUITE.erl
diff options
context:
space:
mode:
authoralisdair sullivan <alisdairsullivan@yahoo.ca>2015-10-15 23:32:43 -0700
committeralisdair sullivan <alisdairsullivan@yahoo.ca>2015-10-26 21:57:32 -0700
commitd1409d0b3b2f7fe5c491f866ef983dd7df7d0f42 (patch)
treed9267423c504dd0b61fd189396fa0cebf816ec67 /test/rebar_eunit_SUITE.erl
parent621d8a94856df629a94fac7a77b68fd841267510 (diff)
refactor `rebar_erlc_compiler`
* modify compiler interface to work on either application objects or directories containing source files * compile all sources in `src_dirs` to the application `ebin` dir and all sources in `extra_src_dirs` to a directory mirroring it's position in the app's `_build` directory. for example, `apps/foo/more` would compile to `_build/default/lib/foo/more` for `extra_src_dirs` in the root of a project with multiple applications (so orphan directories that don't "belong" to an application) compile to `_build/default/extras/more` * copy directories specified in `extra_src_dirs` into the `_build` directory so tools like `ct` and `xref` that expect source to be in a particular location still work * clean compiled artifacts from all `extra_src_dirs` * alter `eunit`, `ct` and `cover` to work with the new directory structure * billions of new tests
Diffstat (limited to 'test/rebar_eunit_SUITE.erl')
-rw-r--r--test/rebar_eunit_SUITE.erl18
1 files changed, 13 insertions, 5 deletions
diff --git a/test/rebar_eunit_SUITE.erl b/test/rebar_eunit_SUITE.erl
index 903bd96..609be51 100644
--- a/test/rebar_eunit_SUITE.erl
+++ b/test/rebar_eunit_SUITE.erl
@@ -125,7 +125,9 @@ basic_app_files(Config) ->
AppDir = ?config(apps, Config),
lists:foreach(fun(F) -> true = ec_file:exists(filename:join([AppDir, "_build", "test", "lib", "basic_app", "ebin", F])) end,
- ["basic_app.app", "basic_app.beam", "basic_app_tests.beam", "basic_app_tests_helper.beam"]).
+ ["basic_app.app", "basic_app.beam"]),
+ lists:foreach(fun(F) -> true = ec_file:exists(filename:join([AppDir, "_build", "test", "lib", "basic_app", "test", F])) end,
+ ["basic_app_tests.beam", "basic_app_tests_helper.beam"]).
%% check that the correct tests are exported from modules for project
%% note that this implies `TEST` is set correctly
@@ -171,10 +173,14 @@ multi_app_files(Config) ->
AppDir = ?config(apps, Config),
lists:foreach(fun(F) -> true = ec_file:exists(filename:join([AppDir, "_build", "test", "lib", "multi_app_bar", "ebin", F])) end,
- ["multi_app_bar.app", "multi_app_bar.beam", "multi_app_bar_tests.beam", "multi_app_bar_tests_helper.beam"]),
+ ["multi_app_bar.app", "multi_app_bar.beam"]),
lists:foreach(fun(F) -> true = ec_file:exists(filename:join([AppDir, "_build", "test", "lib", "multi_app_baz", "ebin", F])) end,
- ["multi_app_baz.app", "multi_app_baz.beam", "multi_app_baz_tests.beam", "multi_app_baz_tests_helper.beam"]),
- lists:foreach(fun(F) -> true = ec_file:exists(filename:join([AppDir, "_build", "test", "test", F])) end,
+ ["multi_app_baz.app", "multi_app_baz.beam"]),
+ lists:foreach(fun(F) -> true = ec_file:exists(filename:join([AppDir, "_build", "test", "lib", "multi_app_bar", "test", F])) end,
+ ["multi_app_bar_tests.beam", "multi_app_bar_tests_helper.beam"]),
+ lists:foreach(fun(F) -> true = ec_file:exists(filename:join([AppDir, "_build", "test", "lib", "multi_app_baz", "test", F])) end,
+ ["multi_app_baz_tests.beam", "multi_app_baz_tests_helper.beam"]),
+ lists:foreach(fun(F) -> true = ec_file:exists(filename:join([AppDir, "_build", "test", "extras", "test", F])) end,
["multi_app_tests.beam", "multi_app_tests_helper.beam"]).
%% check that the correct tests are exported from modules for project
@@ -202,7 +208,9 @@ multi_app_testset(Config) ->
AppDir = ?config(apps, Config),
Result = ?config(result, Config),
- Set = {ok, [{application, multi_app_bar}, {application, multi_app_baz}, {dir, filename:join([AppDir, "_build", "test", "test"])}]},
+ Set = {ok, [{application, multi_app_bar},
+ {application, multi_app_baz},
+ {dir, filename:join([AppDir, "test"])}]},
Set = rebar_prv_eunit:prepare_tests(Result).