summaryrefslogtreecommitdiff
path: root/lib/megaco/test
diff options
context:
space:
mode:
authorMicael Karlberg <bmk@erlang.org>2020-01-21 17:33:49 +0100
committerMicael Karlberg <bmk@erlang.org>2020-01-21 17:33:49 +0100
commit5c85744d3b4cd2ed00efa7a7f07dbe94215cfd62 (patch)
tree605e4c9daa122234cf32be4145974db0040feb12 /lib/megaco/test
parent4abd39618d555a5b0bf01eb6bbb0128c3f6dd60b (diff)
downloaderlang-5c85744d3b4cd2ed00efa7a7f07dbe94215cfd62.tar.gz
[megaco|test] Check for system events
If a test case run by try_tc fails, we check for system events, and if any are found, we issue a skip instead.
Diffstat (limited to 'lib/megaco/test')
-rw-r--r--lib/megaco/test/megaco_test_lib.erl24
1 files changed, 19 insertions, 5 deletions
diff --git a/lib/megaco/test/megaco_test_lib.erl b/lib/megaco/test/megaco_test_lib.erl
index eede29a69e..063ba1d3ea 100644
--- a/lib/megaco/test/megaco_test_lib.erl
+++ b/lib/megaco/test/megaco_test_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2019. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2020. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -616,8 +616,15 @@ try_tc(TCName, Name, Verbosity, Pre, Case, Post)
C:E:S ->
p("try_tc -> case failed: try post"),
(catch Post(State)),
- p("try_tc -> case failed: done"),
- {error, {case_catched, C, E, S}}
+ case megaco_test_global_sys_monitor:events() of
+ [] ->
+ p("try_tc -> case failed: done"),
+ {error, {case_catched, C, E, S}};
+ SysEvs ->
+ p("try_tc -> case failed with system event(s): "
+ "~n ~p", [SysEvs]),
+ {skip, "TC failure with system events"}
+ end
end
catch
throw:{skip, _} = SKIP:_ ->
@@ -627,8 +634,15 @@ try_tc(TCName, Name, Verbosity, Pre, Case, Post)
p("try_tc -> pre (exit) skip"),
SKIP;
C:E:S ->
- p("try_tc -> pre failed: done"),
- {error, {pre_catched, C, E, S}}
+ case megaco_test_global_sys_monitor:events() of
+ [] ->
+ p("try_tc -> pre failed: done"),
+ {error, {pre_catched, C, E, S}};
+ SysEvs ->
+ p("try_tc -> pre failed with system event(s): "
+ "~n ~p", [SysEvs]),
+ {skip, "TC pre failure with system events"}
+ end
end.