Initial cleanup pass on rebar_ct; removing other targets in favor of "ct" (ala how eunit support works)

This commit is contained in:
Dave Smith 2010-06-22 15:43:09 -06:00
parent c2b58ac62f
commit 8d14f3193d

View file

@ -37,11 +37,7 @@
%% -------------------------------------------------------------------
-module(rebar_ct).
-export([test/2,
int_test/2,
perf_test/2]).
-compile([export_all]).
-export([ct/2]).
-include("rebar.hrl").
@ -49,14 +45,9 @@
%% Public API
%% ===================================================================
test(Config, File) ->
ct(Config, File) ->
run_test_if_present("test", Config, File).
int_test(Config, File) ->
run_test_if_present("int_test", Config, File).
perf_test(Config, File) ->
run_test_if_present("perf_test", Config, File).
%% ===================================================================
%% Internal functions
@ -134,9 +125,9 @@ show_log(RawLog) ->
end.
make_cmd(TestDir, _Config) ->
{ok, Cwd} = file:get_cwd(),
Cwd = rebar_utils:get_cwd(),
LogDir = filename:join(Cwd, "logs"),
Ebin = filename:join(Cwd, "ebin"),
EbinDir = filename:absname(filename:join(Cwd, "ebin")),
IncludeDir = filename:join(Cwd, "include"),
case filelib:is_dir(IncludeDir) of
true ->
@ -145,17 +136,17 @@ make_cmd(TestDir, _Config) ->
Include = ""
end,
Cmd = lists:flatten(io_lib:format("erl " % should we expand ERL_PATH?
Cmd = ?FMT("erl " % should we expand ERL_PATH?
" -noshell -pa \"~s\" ~s"
" -s ct_run script_start -s erlang halt"
" -name test@~s"
" -logdir \"~s\""
" -env TEST_DIR \"~s\"",
[Ebin,
[EbinDir,
Include,
net_adm:localhost(),
LogDir,
filename:join(Cwd, TestDir)])) ++
filename:join(Cwd, TestDir)]) ++
get_ct_config_file(TestDir) ++
get_config_file(TestDir) ++
get_suite(TestDir) ++