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