From 4db90bafef5a7c3dab9a0cb35a3937e0021da959 Mon Sep 17 00:00:00 2001 From: Magnus Klaar Date: Fri, 6 Jan 2012 18:33:41 +0100 Subject: Deprecate ct suite= option for suites= option --- priv/shell-completion/bash/rebar | 2 +- src/rebar.erl | 2 +- src/rebar_ct.erl | 29 +++++++++++++++++------------ 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/priv/shell-completion/bash/rebar b/priv/shell-completion/bash/rebar index 7fce89f..f974e93 100644 --- a/priv/shell-completion/bash/rebar +++ b/priv/shell-completion/bash/rebar @@ -11,7 +11,7 @@ _rebar() cmdsnvars="check-deps clean compile create create-app create-node \ ct doc delete-deps eunit get-deps generate generate-upgrade \ help list-deps list-templates update-deps version xref overlay \ - apps= case= force=1 jobs= suite= verbose=1 appid= previous_release= \ + apps= case= force=1 jobs= suites= verbose=1 appid= previous_release= \ root_dir= skip_deps=true skip_apps= template= template_dir=" if [[ ${cur} == --* ]] ; then diff --git a/src/rebar.erl b/src/rebar.erl index ca646b1..5abf823 100644 --- a/src/rebar.erl +++ b/src/rebar.erl @@ -259,7 +259,7 @@ generate-upgrade previous_release=path Build an upgrade package generate-appups previous_release=path Generate appup files eunit [suite=foo] Run eunit [test/foo_tests.erl] tests -ct [suite=] [case=] Run common_test suites in ./test +ct [suites=] [case=] Run common_test suites in ./test xref Run cross reference analysis diff --git a/src/rebar_ct.erl b/src/rebar_ct.erl index 70524af..626144e 100644 --- a/src/rebar_ct.erl +++ b/src/rebar_ct.erl @@ -32,7 +32,7 @@ %% %% Global options: %% verbose=1 - show output from the common_test run as it goes -%% suite="foo"" - runs /foo_SUITE +%% suites="foo,bar" - runs /foo_SUITE and /bar_SUITE %% case="mycase" - runs individual test case foo_SUITE:mycase %% ------------------------------------------------------------------- -module(rebar_ct). @@ -106,7 +106,7 @@ check_log(RawLog) -> ?FAIL; true -> - ?CONSOLE("DONE. ~s\n", [Msg]) + ?CONSOLE("DONE.\n~s\n", [Msg]) end. %% Show the log if it hasn't already been shown because verbose was on @@ -243,18 +243,23 @@ get_config_file(TestDir) -> end. get_suite(TestDir) -> - case rebar_config:get_global(suite, undefined) of + case rebar_utils:get_deprecated_global(suite, suites, "soon") of undefined -> " -dir " ++ TestDir; - Suite -> - Filename = filename:join(TestDir, Suite ++ "_SUITE.erl"), - case filelib:is_regular(Filename) of - false -> - ?ERROR("Suite ~s not found\n", [Suite]), - ?FAIL; - true -> - " -suite " ++ Filename - end + Suites -> + Suites1 = string:tokens(Suites, ","), + Suites2 = [find_suite_path(Suite, TestDir) || Suite <- Suites1], + string:join([" -suite"] ++ Suites2, " ") + end. + +find_suite_path(Suite, TestDir) -> + Path = filename:join(TestDir, Suite ++ "_SUITE.erl"), + case filelib:is_regular(Path) of + false -> + ?ERROR("Suite ~s not found\n", [Suite]), + ?FAIL; + true -> + Path end. get_case() -> -- cgit v1.1