summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml1
-rw-r--r--Makefile2
-rw-r--r--inttest/tdeps1/tdeps1_rt.erl17
-rw-r--r--inttest/tdeps2/tdeps2_rt.erl19
-rwxr-xr-xpriv/templates/simplenode.nodetool2
-rw-r--r--src/rebar_ct.erl26
-rw-r--r--src/rebar_port_compiler.erl3
7 files changed, 55 insertions, 15 deletions
diff --git a/.travis.yml b/.travis.yml
index c01e70c..191d337 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,5 +1,6 @@
language: erlang
otp_release:
+ - R16B
- R15B01
- R15B
- R14B04
diff --git a/Makefile b/Makefile
index 851edc2..1144d5e 100644
--- a/Makefile
+++ b/Makefile
@@ -38,6 +38,6 @@ deps:
test:
@$(REBAR) eunit
- @$(RETEST) inttest
+ @$(RETEST) -v inttest
travis: clean debug xref clean all deps test
diff --git a/inttest/tdeps1/tdeps1_rt.erl b/inttest/tdeps1/tdeps1_rt.erl
index 9f21c81..3de1a2b 100644
--- a/inttest/tdeps1/tdeps1_rt.erl
+++ b/inttest/tdeps1/tdeps1_rt.erl
@@ -23,12 +23,23 @@ files() ->
{copy, "c.hrl", "repo/c/include/c.hrl"}
].
+apply_cmds([], _Params) ->
+ ok;
+apply_cmds([Cmd | Rest], Params) ->
+ io:format("Running: ~s (~p)\n", [Cmd, Params]),
+ {ok, _} = retest_sh:run(Cmd, Params),
+ apply_cmds(Rest, Params).
+
run(_Dir) ->
%% Initialize the b/c apps as git repos so that dependencies pull
%% properly
- GitCmd = "/bin/sh -c \"git init && git add -A && git commit -a -m 'Initial commit'\"",
- {ok, _} = retest_sh:run(GitCmd, [{dir, "repo/b"}]),
- {ok, _} = retest_sh:run(GitCmd, [{dir, "repo/c"}]),
+ GitCmds = ["git init",
+ "git add -A",
+ "git config user.email 'tdeps@example.com'",
+ "git config user.name 'tdeps'",
+ "git commit -a -m 'Initial Commit'"],
+ apply_cmds(GitCmds, [{dir, "repo/b"}]),
+ apply_cmds(GitCmds, [{dir, "repo/c"}]),
{ok, _} = retest_sh:run("./rebar get-deps compile", []),
diff --git a/inttest/tdeps2/tdeps2_rt.erl b/inttest/tdeps2/tdeps2_rt.erl
index dca5f03..987567e 100644
--- a/inttest/tdeps2/tdeps2_rt.erl
+++ b/inttest/tdeps2/tdeps2_rt.erl
@@ -31,12 +31,23 @@ files() ->
{copy, "c.hrl", "repo/c/include/c.hrl"}
].
+apply_cmds([], _Params) ->
+ ok;
+apply_cmds([Cmd | Rest], Params) ->
+ io:format("Running: ~s (~p)\n", [Cmd, Params]),
+ {ok, _} = retest_sh:run(Cmd, Params),
+ apply_cmds(Rest, Params).
+
run(_Dir) ->
- %% Initialize the b/c apps as mercurial repos so that dependencies pull
+ %% Initialize the b/c apps as git repos so that dependencies pull
%% properly
- GitCmd = "/bin/sh -c \"git init && git add -A && git commit -a -m 'Initial commit'\"",
- {ok, _} = retest_sh:run(GitCmd, [{dir, "repo/b"}]),
- {ok, _} = retest_sh:run(GitCmd, [{dir, "repo/c"}]),
+ GitCmds = ["git init",
+ "git add -A",
+ "git config user.email 'tdeps@example.com'",
+ "git config user.name 'tdeps'",
+ "git commit -a -m 'Initial Commit'"],
+ ok = apply_cmds(GitCmds, [{dir, "repo/b"}]),
+ ok = apply_cmds(GitCmds, [{dir, "repo/c"}]),
{ok, _} = retest_sh:run("./rebar -v get-deps compile", []),
ok.
diff --git a/priv/templates/simplenode.nodetool b/priv/templates/simplenode.nodetool
index 54ee6d6..ce06c6a 100755
--- a/priv/templates/simplenode.nodetool
+++ b/priv/templates/simplenode.nodetool
@@ -6,8 +6,6 @@
%% nodetool: Helper Script for interacting with live nodes
%%
%% -------------------------------------------------------------------
--mode(compile).
-
main(Args) ->
ok = start_epmd(),
%% Extract the args
diff --git a/src/rebar_ct.erl b/src/rebar_ct.erl
index d5b1d26..9951f8e 100644
--- a/src/rebar_ct.erl
+++ b/src/rebar_ct.erl
@@ -108,8 +108,16 @@ run_test(TestDir, LogDir, Config, _File) ->
" 2>&1 | tee -a " ++ RawLog
end,
- rebar_utils:sh(Cmd ++ Output, [{env,[{"TESTDIR", TestDir}]}]),
- check_log(Config, RawLog).
+ case rebar_utils:sh(Cmd ++ Output, [{env,[{"TESTDIR", TestDir}]}, return_on_error]) of
+ {ok,_} ->
+ %% in older versions of ct_run, this could have been a failure
+ %% that returned a non-0 code. Check for that!
+ check_success_log(Config, RawLog);
+ {error,Res} ->
+ %% In newer ct_run versions, this may be a sign of a good compile
+ %% that failed cases. In older version, it's a worse error.
+ check_fail_log(Config, RawLog, Cmd ++ Output, Res)
+ end.
clear_log(LogDir, RawLog) ->
case filelib:ensure_dir(filename:join(LogDir, "index.html")) of
@@ -124,7 +132,16 @@ clear_log(LogDir, RawLog) ->
%% calling ct with erl does not return non-zero on failure - have to check
%% log results
-check_log(Config, RawLog) ->
+check_success_log(Config, RawLog) ->
+ check_log(Config, RawLog, fun(Msg) -> ?CONSOLE("DONE.\n~s\n", [Msg]) end).
+
+check_fail_log(Config, RawLog, Command, {Rc, Output}) ->
+ check_log(Config, RawLog, fun(_Msg) ->
+ ?ABORT("~s failed with error: ~w and output:~n~s~n",
+ [Command, Rc, Output])
+ end).
+
+check_log(Config,RawLog,Fun) ->
{ok, Msg} =
rebar_utils:sh("grep -e 'TEST COMPLETE' -e '{error,make_failed}' "
++ RawLog, [{use_stdout, false}]),
@@ -142,9 +159,10 @@ check_log(Config, RawLog) ->
?FAIL;
true ->
- ?CONSOLE("DONE.\n~s\n", [Msg])
+ Fun(Msg)
end.
+
%% Show the log if it hasn't already been shown because verbose was on
show_log(Config, RawLog) ->
?CONSOLE("Showing log\n", []),
diff --git a/src/rebar_port_compiler.erl b/src/rebar_port_compiler.erl
index 36d741d..0abb044 100644
--- a/src/rebar_port_compiler.erl
+++ b/src/rebar_port_compiler.erl
@@ -100,7 +100,8 @@ compile(Config, AppFile) ->
[] ->
ok;
Specs ->
- SharedEnv = rebar_config:get_env(Config, ?MODULE),
+ SharedEnv = rebar_config:get_env(Config, rebar_deps) ++
+ rebar_config:get_env(Config, ?MODULE),
%% Compile each of the sources
NewBins = compile_sources(Config, Specs, SharedEnv),