2014-12-02 09:52:45 +00:00
|
|
|
%% -*- erlang-indent-level: 4;indent-tabs-mode: nil -*-
|
|
|
|
%% ex: ts=4 sw=4 et
|
2011-01-26 02:00:53 +00:00
|
|
|
-module(ct2_rt).
|
|
|
|
|
|
|
|
-compile(export_all).
|
|
|
|
|
|
|
|
|
|
|
|
files() ->
|
|
|
|
[{create, "ebin/foo.app", app(foo)},
|
|
|
|
{copy, "../../rebar", "rebar"},
|
2012-09-03 09:39:51 +00:00
|
|
|
{copy, "foo.test.spec", "foo.test.spec"},
|
2014-12-07 08:12:06 +00:00
|
|
|
{copy, "deps/bar.test.spec", "deps/bar.test.spec"},
|
2011-01-26 02:00:53 +00:00
|
|
|
{copy, "foo_SUITE.erl", "test/foo_SUITE.erl"}].
|
|
|
|
|
|
|
|
run(_Dir) ->
|
2014-12-07 08:12:06 +00:00
|
|
|
Ref = retest:sh("./rebar compile ct -vvv", [async]),
|
|
|
|
{ok, [[CTRunCmd]]} = retest:sh_expect(Ref, "^\"ct_run.*",
|
|
|
|
[global, {capture, first, binary}]),
|
|
|
|
{match, _} = re:run(CTRunCmd, "foo.test.spec", [global]),
|
|
|
|
%% deps/bar.test.spec should be ignored by rebar_ct:collect_glob/3
|
|
|
|
nomatch = re:run(CTRunCmd, "bar.test.spec", [global]),
|
2011-01-26 02:00:53 +00:00
|
|
|
ok.
|
|
|
|
|
|
|
|
%%
|
|
|
|
%% Generate the contents of a simple .app file
|
|
|
|
%%
|
|
|
|
app(Name) ->
|
|
|
|
App = {application, Name,
|
|
|
|
[{description, atom_to_list(Name)},
|
|
|
|
{vsn, "1"},
|
|
|
|
{modules, []},
|
|
|
|
{registered, []},
|
|
|
|
{applications, [kernel, stdlib]}]},
|
|
|
|
io_lib:format("~p.\n", [App]).
|