diff options
author | Peter Andersson <[email protected]> | 2011-09-01 16:32:36 +0200 |
---|---|---|
committer | Peter Andersson <[email protected]> | 2011-09-23 12:24:54 +0200 |
commit | 6668a91b365b8390d8eb369f7d6c6294711a1fef (patch) | |
tree | aeeb629d8dd9c8a3e0b01ae17f32580e782e64d6 /lib/common_test/src/ct_framework.erl | |
parent | 8d9b760e7fafec40787be6de5994240f1540d12a (diff) | |
download | otp-6668a91b365b8390d8eb369f7d6c6294711a1fef.tar.gz otp-6668a91b365b8390d8eb369f7d6c6294711a1fef.tar.bz2 otp-6668a91b365b8390d8eb369f7d6c6294711a1fef.zip |
Various corrections and updates to improve error handling and reporting
OTP-8933
Diffstat (limited to 'lib/common_test/src/ct_framework.erl')
-rw-r--r-- | lib/common_test/src/ct_framework.erl | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl index b730f1e46e..29caa27d94 100644 --- a/lib/common_test/src/ct_framework.erl +++ b/lib/common_test/src/ct_framework.erl @@ -245,7 +245,12 @@ add_defaults(Mod,Func,FuncInfo,DoInit) -> Error = {error,_} -> {SuiteInfo,Error}; MergedInfo -> {SuiteInfo,MergedInfo} end; - {'EXIT',Reason} -> + {'EXIT',Reason} -> + ErrStr = io_lib:format("~n*** ERROR *** " + "~w:suite/0 failed: ~p~n", + [Mod,Reason]), + io:format(ErrStr, []), + io:format(user, ErrStr, []), {suite0_failed,{exited,Reason}}; SuiteInfo when is_list(SuiteInfo) -> case lists:all(fun(E) when is_tuple(E) -> true; @@ -261,9 +266,19 @@ add_defaults(Mod,Func,FuncInfo,DoInit) -> MergedInfo -> {SuiteInfo1,MergedInfo} end; false -> + ErrStr = io_lib:format("~n*** ERROR *** " + "Invalid return value from " + "~w:suite/0: ~p~n", [Mod,SuiteInfo]), + io:format(ErrStr, []), + io:format(user, ErrStr, []), {suite0_failed,bad_return_value} end; - _ -> + SuiteInfo -> + ErrStr = io_lib:format("~n*** ERROR *** " + "Invalid return value from " + "~w:suite/0: ~p~n", [Mod,SuiteInfo]), + io:format(ErrStr, []), + io:format(user, ErrStr, []), {suite0_failed,bad_return_value} end. |