From 1378dee07e847c8af91aef1afc66ad0026a8cefb Mon Sep 17 00:00:00 2001 From: Peter Andersson Date: Wed, 15 Apr 2015 12:51:48 +0200 Subject: Reintroduce functions for backwards compatibility --- lib/test_server/src/ts.erl | 39 ++++++++++++++++++++++++++++++++++++++- lib/test_server/src/ts_lib.erl | 2 +- 2 files changed, 39 insertions(+), 2 deletions(-) (limited to 'lib/test_server/src') diff --git a/lib/test_server/src/ts.erl b/lib/test_server/src/ts.erl index c2a7afa38b..469593e947 100644 --- a/lib/test_server/src/ts.erl +++ b/lib/test_server/src/ts.erl @@ -33,6 +33,11 @@ cross_cover_analyse/1, compile_testcases/0, compile_testcases/1, help/0]). + +%% Functions kept for backwards compatibility +-export([bench/0, bench/1, bench/2, benchmarks/0, + smoke_test/0, smoke_test/1,smoke_test/2, smoke_tests/0]). + -export([i/0, l/1, r/0, r/1, r/2, r/3]). %%%---------------------------------------------------------------------- @@ -510,7 +515,7 @@ run_category(TestCategory) when is_atom(TestCategory) -> %% run_category/2 run_category(TestCategory, Opts) when is_atom(TestCategory), is_list(Opts) -> - case ts:tests() of + case ts:tests(TestCategory) of [] -> {error, no_tests_available}; Apps -> @@ -529,6 +534,38 @@ run_category(App, TestCategory, Opts) -> Opts1 = [{test_category,TestCategory} | Opts], run_some(Apps, Opts1). +%%----------------------------------------------------------------- +%% Functions kept for backwards compatibility + +bench() -> + run_category(bench, []). +bench(Opts) when is_list(Opts) -> + run_category(bench, Opts); +bench(App) -> + run_category(App, bench, []). +bench(App, Opts) when is_atom(App) -> + run_category(App, bench, Opts); +bench(Apps, Opts) when is_list(Apps) -> + run_category(Apps, bench, Opts). + +benchmarks() -> + tests(bench). + +smoke_test() -> + run_category(smoke, []). +smoke_test(Opts) when is_list(Opts) -> + run_category(smoke, Opts); +smoke_test(App) -> + run_category(App, smoke, []). +smoke_test(App, Opts) when is_atom(App) -> + run_category(App, smoke, Opts); +smoke_test(Apps, Opts) when is_list(Apps) -> + run_category(Apps, smoke, Opts). + +smoke_tests() -> + tests(smoke). + +%%----------------------------------------------------------------- is_list_of_suites(List) -> lists:all(fun(Suite) -> diff --git a/lib/test_server/src/ts_lib.erl b/lib/test_server/src/ts_lib.erl index 45746c444d..d27bc55b3a 100644 --- a/lib/test_server/src/ts_lib.erl +++ b/lib/test_server/src/ts_lib.erl @@ -98,7 +98,7 @@ specialized_specs(Dir,PostFix) -> sort_tests([begin DirPart = filename:dirname(Name), AppTest = hd(lists:reverse(filename:split(DirPart))), - string:substr(AppTest, 1, length(AppTest)-5) + list_to_atom(string:substr(AppTest, 1, length(AppTest)-5)) end || Name <- Specs]). specs(Dir) -> -- cgit v1.2.3