aboutsummaryrefslogtreecommitdiffstats
path: root/lib/sasl/test/rb_SUITE.erl
diff options
context:
space:
mode:
authorFredrik Gustafsson <[email protected]>2013-08-23 18:13:19 +0200
committerFredrik Gustafsson <[email protected]>2013-08-23 18:13:19 +0200
commit3a10fa99f6744b0a4600cf0b966af5a0a678da8f (patch)
treea0ade9bd1b83ac38c0f665f53670cdb06dceb0da /lib/sasl/test/rb_SUITE.erl
parent076dff38d5aa6fd303b5c2a3aa809115c0545164 (diff)
parent14f1d3037fff02118b8a3d4bb8a86c3df2b24077 (diff)
downloadotp-3a10fa99f6744b0a4600cf0b966af5a0a678da8f.tar.gz
otp-3a10fa99f6744b0a4600cf0b966af5a0a678da8f.tar.bz2
otp-3a10fa99f6744b0a4600cf0b966af5a0a678da8f.zip
Merge branch 'epa/add_fd_usage_in_rb/OTP-11252' into maint
* epa/add_fd_usage_in_rb/OTP-11252: kernel: sasl: fixed rb.xml docs Add Fd usage in rb logging
Diffstat (limited to 'lib/sasl/test/rb_SUITE.erl')
-rw-r--r--lib/sasl/test/rb_SUITE.erl32
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),