summaryrefslogtreecommitdiff
path: root/inttest/ct2/ct2_rt.erl
blob: f9d2b199f4f28bb0d4dfe392f6c2fd5f1b0846aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
%% -*- erlang-indent-level: 4;indent-tabs-mode: nil -*-
%% ex: ts=4 sw=4 et
-module(ct2_rt).

-compile(export_all).


files() ->
    [{create, "ebin/foo.app", app(foo)},
     {copy, "../../rebar", "rebar"},
     {copy, "foo.test.spec", "foo.test.spec"},
     {copy, "deps/bar.test.spec", "deps/bar.test.spec"},
     {copy, "foo_SUITE.erl", "test/foo_SUITE.erl"}].

run(_Dir) ->
    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]),
    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]).