mirror of
https://github.com/correl/rebar.git
synced 2024-11-24 03:00:14 +00:00
Initial cleanup pass on rebar_ct; removing other targets in favor of "ct" (ala how eunit support works)
This commit is contained in:
parent
c2b58ac62f
commit
8d14f3193d
1 changed files with 50 additions and 59 deletions
|
@ -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) ++
|
||||||
|
|
Loading…
Reference in a new issue