mirror of
https://github.com/correl/rebar.git
synced 2024-11-23 19:19:54 +00:00
Add support for customising common test directory
This patch allows users to specify the directory in which common_test source files can be found. Most common_test suites are integration, rather than unit tests and keeping the sources apart from test sources for other frameworks such as eunit and PropEr is a useful feature.
This commit is contained in:
parent
bd349bd2c4
commit
286a2a88a4
4 changed files with 9 additions and 2 deletions
|
@ -6,7 +6,8 @@
|
|||
files() ->
|
||||
[{create, "ebin/a1.app", app(a1)},
|
||||
{copy, "../../rebar", "rebar"},
|
||||
{copy, "test_SUITE.erl", "test/test_SUITE.erl"}].
|
||||
{copy, "rebar.config", "rebar.config"},
|
||||
{copy, "test_SUITE.erl", "itest/test_SUITE.erl"}].
|
||||
|
||||
run(_Dir) ->
|
||||
{ok, _} = retest:sh("./rebar compile ct"),
|
||||
|
|
2
inttest/ct1/rebar.config
Normal file
2
inttest/ct1/rebar.config
Normal file
|
@ -0,0 +1,2 @@
|
|||
|
||||
{ct_dir, "itest"}.
|
|
@ -86,6 +86,9 @@
|
|||
|
||||
%% == Common Test ==
|
||||
|
||||
%% Override the default "test" directory in which SUITEs are located
|
||||
{ct_dir, "itest"}.
|
||||
|
||||
%% Option to pass extra parameters when launching Common Test
|
||||
{ct_extra_params, "-boot start_sasl -s myapp"}.
|
||||
|
||||
|
|
|
@ -46,7 +46,8 @@
|
|||
%% ===================================================================
|
||||
|
||||
ct(Config, File) ->
|
||||
run_test_if_present("test", Config, File).
|
||||
TestDir = rebar_config:get_local(Config, ct_dir, "test"),
|
||||
run_test_if_present(TestDir, Config, File).
|
||||
|
||||
%% ===================================================================
|
||||
%% Internal functions
|
||||
|
|
Loading…
Reference in a new issue