diff options
author | Peter Andersson <[email protected]> | 2013-08-14 23:38:12 +0200 |
---|---|---|
committer | Peter Andersson <[email protected]> | 2013-09-02 12:14:01 +0200 |
commit | 614ba49d9ff9c75466bc3bba5b25a2e583e09217 (patch) | |
tree | 4a8553c8460e43fb025468ec11f8e5bb0020b790 /lib/common_test/src/ct_util.erl | |
parent | b1b6087d7f52b4ac88c90b52be7b66f0e894e565 (diff) | |
download | otp-614ba49d9ff9c75466bc3bba5b25a2e583e09217.tar.gz otp-614ba49d9ff9c75466bc3bba5b25a2e583e09217.tar.bz2 otp-614ba49d9ff9c75466bc3bba5b25a2e583e09217.zip |
Introduce pre- and post-test i/o log
Diffstat (limited to 'lib/common_test/src/ct_util.erl')
-rw-r--r-- | lib/common_test/src/ct_util.erl | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/common_test/src/ct_util.erl b/lib/common_test/src/ct_util.erl index abda87c2cd..e039f68121 100644 --- a/lib/common_test/src/ct_util.erl +++ b/lib/common_test/src/ct_util.erl @@ -187,6 +187,7 @@ do_start(Parent, Mode, LogDir, Verbosity) -> false -> ok end, + {StartTime,TestLogDir} = ct_logs:init(Mode, Verbosity), ct_event:notify(#event{name=test_start, @@ -392,6 +393,14 @@ loop(Mode,TestData,StartDir) -> return(From,StartDir), loop(From,TestData,StartDir); {{stop,Info},From} -> + test_server_io:reset_state(), + {MiscIoName,MiscIoDivider,MiscIoFooter} = + proplists:get_value(misc_io_log,TestData), + {ok,MiscIoFd} = file:open(MiscIoName, + [append,{encoding,utf8}]), + io:put_chars(MiscIoFd, MiscIoDivider), + test_server_io:set_fd(unexpected_io, MiscIoFd), + Time = calendar:local_time(), ct_event:sync_notify(#event{name=test_done, node=node(), @@ -405,6 +414,11 @@ loop(Mode,TestData,StartDir) -> ets:delete(?board_table), ets:delete(?suite_table), ets:delete(?verbosity_table), + + io:put_chars(MiscIoFd, "\n</pre>\n"++MiscIoFooter), + test_server_io:stop([unexpected_io]), + test_server_io:finish(), + ct_logs:close(Info, StartDir), ct_event:stop(), ct_config:stop(), |