mirror of
https://github.com/correl/rebar.git
synced 2024-11-23 19:19:54 +00:00
Updating integration tests
--HG-- extra : rebase_source : c0bfcfbbbca005eee2a3434cbe25494399b07532
This commit is contained in:
parent
3df1d4292a
commit
299f3045be
3 changed files with 16 additions and 8 deletions
|
@ -11,7 +11,8 @@ files() ->
|
||||||
{copy, "../rebar", "rebar"}].
|
{copy, "../rebar", "rebar"}].
|
||||||
|
|
||||||
run(_Dir) ->
|
run(_Dir) ->
|
||||||
{ok, _} = retest:sh("./rebar compile").
|
{ok, _} = retest:sh("./rebar compile"),
|
||||||
|
ok.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
-module(a).
|
-module(a).
|
||||||
|
|
||||||
|
-compile(export_all).
|
||||||
|
|
||||||
-include_lib("b/include/b.hrl").
|
-include_lib("b/include/b.hrl").
|
||||||
|
|
||||||
|
hello() ->
|
||||||
|
io:format("~s\n", [?HELLO]).
|
||||||
|
|
||||||
|
|
|
@ -8,22 +8,22 @@
|
||||||
files() ->
|
files() ->
|
||||||
[
|
[
|
||||||
%% A application
|
%% A application
|
||||||
{create, "ebin/a.app", app(a)},
|
{create, "ebin/a.app", app(a, [a])},
|
||||||
{copy, "a.rebar.config", "rebar.config"},
|
{copy, "a.rebar.config", "rebar.config"},
|
||||||
{copy, "a.erl", "src/a.erl"},
|
{copy, "a.erl", "src/a.erl"},
|
||||||
{copy, "../../rebar", "rebar"},
|
{copy, "../../rebar", "rebar"},
|
||||||
|
|
||||||
%% B application
|
%% B application
|
||||||
{create, "repo/b/src/b.app.src", app(b)},
|
{create, "repo/b/ebin/b.app", app(b, [])},
|
||||||
{copy, "b.rebar.config", "repo/b/rebar.config"},
|
{copy, "b.rebar.config", "repo/b/rebar.config"},
|
||||||
{copy, "b.hrl", "repo/b/include/b.hrl"},
|
{copy, "b.hrl", "repo/b/include/b.hrl"},
|
||||||
|
|
||||||
%% C application
|
%% C application
|
||||||
{create, "repo/c/ebin/c.app", app(c)},
|
{create, "repo/c/ebin/c.app", app(c, [])},
|
||||||
{copy, "c.hrl", "repo/c/include/c.hrl"}
|
{copy, "c.hrl", "repo/c/include/c.hrl"}
|
||||||
].
|
].
|
||||||
|
|
||||||
run(_Dir) ->
|
run(Dir) ->
|
||||||
%% Initialize the b/c apps as mercurial repos so that dependencies pull
|
%% Initialize the b/c apps as mercurial repos so that dependencies pull
|
||||||
%% properly
|
%% properly
|
||||||
HgCmd = "/bin/sh -c \"hg init && hg add && hg commit -m 'Initial commit'\"",
|
HgCmd = "/bin/sh -c \"hg init && hg add && hg commit -m 'Initial commit'\"",
|
||||||
|
@ -31,7 +31,9 @@ run(_Dir) ->
|
||||||
{ok, _} = retest_sh:run(HgCmd, [{dir, "repo/c"}]),
|
{ok, _} = retest_sh:run(HgCmd, [{dir, "repo/c"}]),
|
||||||
|
|
||||||
|
|
||||||
{ok, _} = retest_sh:run("./rebar -v get-deps compile", []),
|
{ok, _} = retest_sh:run("./rebar get-deps compile", []),
|
||||||
|
|
||||||
|
true = filelib:is_file("ebin/a.beam"),
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
|
|
||||||
|
@ -39,11 +41,11 @@ run(_Dir) ->
|
||||||
%%
|
%%
|
||||||
%% Generate the contents of a simple .app file
|
%% Generate the contents of a simple .app file
|
||||||
%%
|
%%
|
||||||
app(Name) ->
|
app(Name, Modules) ->
|
||||||
App = {application, Name,
|
App = {application, Name,
|
||||||
[{description, atom_to_list(Name)},
|
[{description, atom_to_list(Name)},
|
||||||
{vsn, "1"},
|
{vsn, "1"},
|
||||||
{modules, []},
|
{modules, Modules},
|
||||||
{registered, []},
|
{registered, []},
|
||||||
{applications, [kernel, stdlib]}]},
|
{applications, [kernel, stdlib]}]},
|
||||||
io_lib:format("~p.\n", [App]).
|
io_lib:format("~p.\n", [App]).
|
||||||
|
|
Loading…
Reference in a new issue