From 49f56f9dc37499b6ebb365d2304eee940d57801d Mon Sep 17 00:00:00 2001 From: Peter Andersson Date: Mon, 23 Nov 2015 16:56:47 +0100 Subject: Make abort_if_missing_suites option work in all io modes --- lib/common_test/src/ct_run.erl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/common_test/src') diff --git a/lib/common_test/src/ct_run.erl b/lib/common_test/src/ct_run.erl index ae91601f67..97994d8d6f 100644 --- a/lib/common_test/src/ct_run.erl +++ b/lib/common_test/src/ct_run.erl @@ -2071,9 +2071,11 @@ final_skip([Skip|Skips], Final) -> final_skip([], Final) -> lists:reverse(Final). +continue(_MakeErrors, true) -> + false; continue([], _) -> true; -continue(_MakeErrors, AbortIfMissingSuites) -> +continue(_MakeErrors, _AbortIfMissingSuites) -> io:nl(), OldGl = group_leader(), case set_group_leader_same_as_shell() of @@ -2101,7 +2103,7 @@ continue(_MakeErrors, AbortIfMissingSuites) -> true end; false -> % no shell process to use - not AbortIfMissingSuites + true end. set_group_leader_same_as_shell() -> -- cgit v1.2.3 From 6d2bac38720ec27763a0cea2ae48060d501fce62 Mon Sep 17 00:00:00 2001 From: Peter Andersson Date: Tue, 24 Nov 2015 00:11:45 +0100 Subject: Let missing suites affect ct:run_test/1 return and ct_run exit status --- lib/common_test/src/ct_run.erl | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'lib/common_test/src') diff --git a/lib/common_test/src/ct_run.erl b/lib/common_test/src/ct_run.erl index 97994d8d6f..0b646ffd07 100644 --- a/lib/common_test/src/ct_run.erl +++ b/lib/common_test/src/ct_run.erl @@ -1771,7 +1771,18 @@ compile_and_run(Tests, Skip, Opts, Args) -> {Tests1,Skip1} -> ReleaseSh = proplists:get_value(release_shell, Args), ct_util:set_testdata({release_shell,ReleaseSh}), - possibly_spawn(ReleaseSh == true, Tests1, Skip1, Opts) + TestResult = + possibly_spawn(ReleaseSh == true, Tests1, Skip1, Opts), + case TestResult of + {Ok,Errors,Skipped} -> + NoOfMakeErrors = + lists:foldl(fun({_,BadMods}, X) -> + X + length(BadMods) + end, 0, SuiteMakeErrors), + {Ok,Errors+NoOfMakeErrors,Skipped}; + ErrorResult -> + ErrorResult + end catch _:BadFormat -> {error,BadFormat} @@ -2071,10 +2082,10 @@ final_skip([Skip|Skips], Final) -> final_skip([], Final) -> lists:reverse(Final). -continue(_MakeErrors, true) -> - false; continue([], _) -> true; +continue(_MakeErrors, true) -> + false; continue(_MakeErrors, _AbortIfMissingSuites) -> io:nl(), OldGl = group_leader(), @@ -2107,7 +2118,6 @@ continue(_MakeErrors, _AbortIfMissingSuites) -> end. set_group_leader_same_as_shell() -> - %%! Locate the shell process... UGLY!!! GS2or3 = fun(P) -> case process_info(P,initial_call) of {initial_call,{group,server,X}} when X == 2 ; X == 3 -> -- cgit v1.2.3