Skip to content

Commit 16f0ac4

Browse files
committed
don't display warnings in tests
1 parent df72dc6 commit 16f0ac4

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

test/error_handling.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ context("Not installed") do
33

44
add_format(format"NotInstalled", (), ".not_installed", [:NotInstalled])
55
stdin_copy = STDIN
6-
rs, wr = redirect_stdin()
6+
stderr_copy = STDERR
7+
rs, wr = redirect_stdin()
8+
rserr, wrerr = redirect_stderr()
79
ref = @async save("test.not_installed")
810
println(wr, "y")
911
if VERSION < v"0.4.0-dev"
@@ -16,8 +18,11 @@ context("Not installed") do
1618
println(wr, "n") # don't install
1719
wait(ref)
1820
@fact istaskdone(ref) --> true
21+
22+
close(rs);close(wr);close(rserr);close(wrerr)
1923
redirect_stdin(stdin_copy)
20-
close(rs);close(wr);
24+
redirect_stderr(stderr_copy)
25+
2126
eval(Base, :(is_interactive = false)) # for interactive error handling
2227

2328
end

test/query.jl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@ if VERSION < v"0.4.0-dev"
77
end
88

99
context("OS") do
10-
@linux_only begin
10+
if is_linux()
1111
@fact FileIO.applies_to_os(FileIO.Linux) --> true
1212
@fact FileIO.applies_to_os(FileIO.OSX) --> false
1313
@fact FileIO.applies_to_os(FileIO.Unix) --> true
1414
@fact FileIO.applies_to_os(FileIO.Windows) --> false
1515
end
16-
@osx_only begin
16+
if is_apple()
1717
@fact FileIO.applies_to_os(FileIO.Linux) --> false
1818
@fact FileIO.applies_to_os(FileIO.OSX) --> true
1919
@fact FileIO.applies_to_os(FileIO.Unix) --> true
2020
@fact FileIO.applies_to_os(FileIO.Windows) --> false
2121
end
22-
@windows_only begin
22+
if is_windows()
2323
@fact FileIO.applies_to_os(FileIO.Linux) --> false
2424
@fact FileIO.applies_to_os(FileIO.OSX) --> false
2525
@fact FileIO.applies_to_os(FileIO.Unix) --> false
@@ -227,14 +227,16 @@ try
227227
context("multiple libs") do
228228
lensave0 = length(FileIO.sym2saver)
229229
lenload0 = length(FileIO.sym2loader)
230-
OSKey = @osx ? FileIO.OSX : @windows? FileIO.Windows : @linux ? FileIO.Linux : error("os not supported")
230+
OSKey = is_apple() ? FileIO.OSX : is_windows() ? FileIO.Windows : is_linux() ? FileIO.Linux : error("os not supported")
231231
add_format(
232232
format"MultiLib",
233233
UInt8[0x42,0x4d],
234234
".mlb",
235235
[:LoadTest1, FileIO.LOAD, OSKey],
236236
[:LoadTest2]
237237
)
238+
stderr_copy = STDERR
239+
rd,wr = redirect_stderr()
238240
@fact lensave0 + 1 --> length(FileIO.sym2saver)
239241
@fact lenload0 + 1 --> length(FileIO.sym2loader)
240242
@fact length(FileIO.sym2loader[:MultiLib]) --> 2
@@ -250,6 +252,8 @@ try
250252
@fact isdefined(:LoadTest1) --> true # first module should load first but fail
251253
@fact x --> 42
252254
rm(fn)
255+
close(rd);close(wr)
256+
redirect_stderr(stderr_copy)
253257
end
254258
finally
255259
# Restore the registry

0 commit comments

Comments
 (0)