diff options
author | Fredrik Gustafsson <[email protected]> | 2013-08-23 18:13:29 +0200 |
---|---|---|
committer | Fredrik Gustafsson <[email protected]> | 2013-08-23 18:13:29 +0200 |
commit | 9b3f8dd29d7c0f806317c0b89dbb463450ba3f6e (patch) | |
tree | ba475ec045277d024a69a8b4c9cb81df8611fc65 /lib/sasl/test | |
parent | 42beca2776cf0995a08d9218708a6d66925adc34 (diff) | |
parent | 3a10fa99f6744b0a4600cf0b966af5a0a678da8f (diff) | |
download | otp-9b3f8dd29d7c0f806317c0b89dbb463450ba3f6e.tar.gz otp-9b3f8dd29d7c0f806317c0b89dbb463450ba3f6e.tar.bz2 otp-9b3f8dd29d7c0f806317c0b89dbb463450ba3f6e.zip |
Merge branch 'maint'
Diffstat (limited to 'lib/sasl/test')
-rw-r--r-- | lib/sasl/test/rb_SUITE.erl | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/lib/sasl/test/rb_SUITE.erl b/lib/sasl/test/rb_SUITE.erl index b0e43be3a2..453f992850 100644 --- a/lib/sasl/test/rb_SUITE.erl +++ b/lib/sasl/test/rb_SUITE.erl @@ -362,18 +362,48 @@ start_stop_log(Config) -> StdioResult = [_|_] = capture(fun() -> rb:show(1) end), {ok,<<>>} = file:read_file(OutFile), - %% Start log and check that show is printed to log and not to standad_io + %% Start log and check that show is printed to log and not to standard_io ok = rb:start_log(OutFile), [] = capture(fun() -> rb:show(1) end), {ok,Bin} = file:read_file(OutFile), true = (Bin =/= <<>>), + %% Start log with atom standard_io and check that show is printed to standard_io + ok = rb:stop_log(), + ok = file:write_file(OutFile,[]), + ok = rb:start_log(standard_io), + StdioResult = [_|_] = capture(fun() -> rb:show(1) end), + {ok,<<>>} = file:read_file(OutFile), + + %% Start log and check that show is printed to iodevice log and not to standard_io + ok = rb:stop_log(), + ok = file:write_file(OutFile,[]), + {ok, IoOutFile} = file:open(OutFile,[write]), + ok = rb:start_log(IoOutFile), + [] = capture(fun() -> rb:show(1) end), + {ok,Bin} = file:read_file(OutFile), + true = (Bin =/= <<>>), + ok = file:close(IoOutFile), + %% Stop log and check that show is printed to standard_io and not to log ok = rb:stop_log(), ok = file:write_file(OutFile,[]), StdioResult = capture(fun() -> rb:show(1) end), {ok,<<>>} = file:read_file(OutFile), + %% Start log and check that list is printed to log and not to standard_io + ok = file:write_file(OutFile,[]), + ok = rb:start_log(OutFile), + [] = capture(fun() -> rb:log_list() end), + {ok,Bin2} = file:read_file(OutFile), + true = (Bin2 =/= <<>>), + + %% Stop log and check that list is printed to standard_io and not to log + ok = rb:stop_log(), + ok = file:write_file(OutFile,[]), + StdioResult2 = capture(fun() -> rb:log_list() end), + {ok,<<>>} = file:read_file(OutFile), + %% Test that standard_io is used if log file can not be opened ok = rb:start_log(filename:join(nonexistingdir,"newfile.txt")), StdioResult = capture(fun() -> rb:show(1) end), |