Skip to content

Commit 2e6ffbc

Browse files
Capture/silence some noisy test warnings (#57111)
1 parent 755d7ec commit 2e6ffbc

File tree

6 files changed

+15
-17
lines changed

6 files changed

+15
-17
lines changed

Compiler/test/codegen.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,7 @@ end
10311031
# Make sure that code that has unbound sparams works
10321032
#https://github.com/JuliaLang/julia/issues/56739
10331033

1034-
f56739(a) where {T} = a
1034+
@test_warn r"declares type variable T but does not use it" @eval f56739(a) where {T} = a
10351035

10361036
@test f56739(1) == 1
10371037
g56739(x) = @noinline f56739(x)

test/ambiguous.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ ambig(x::Union{Char, Int16}) = 's'
9797

9898
# Automatic detection of ambiguities
9999

100-
const allowed_undefineds = Set([])
100+
const allowed_undefineds = Set([GlobalRef(Base, :active_repl)])
101101

102102
let Distributed = get(Base.loaded_modules,
103103
Base.PkgId(Base.UUID("8ba89e20-285c-5b6f-9357-94700520ee1b"), "Distributed"),

test/boundscheck_exec.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ end
298298
end |> only === Type{Int}
299299

300300
if bc_opt == bc_default
301-
@testset "Array/Memory escape analysis" begin
301+
# Array/Memory escape analysis
302302
function no_allocate(T::Type{<:Union{Memory, Vector}})
303303
v = T(undef, 2)
304304
v[1] = 2
@@ -308,8 +308,8 @@ if bc_opt == bc_default
308308
function test_alloc(::Type{T}; broken=false) where T
309309
@test (@allocated no_allocate(T)) == 0 broken=broken
310310
end
311-
@testset "$T" for T in [Memory, Vector]
312-
@testset "$ET" for ET in [Int, Float32, Union{Int, Float64}]
311+
for T in [Memory, Vector]
312+
for ET in [Int, Float32, Union{Int, Float64}]
313313
no_allocate(T{ET}) #compile
314314
# allocations aren't removed for Union eltypes which they theoretically could be eventually
315315
test_alloc(T{ET}, broken=(ET==Union{Int, Float64}))
@@ -345,6 +345,5 @@ if bc_opt == bc_default
345345
no_alias_prove(1)
346346
@test_broken (@allocated no_alias_prove(5)) == 0
347347
end
348-
end
349348

350349
end

test/channel_threadpool.jl

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33
using Test
44
using Base.Threads
55

6-
@testset "Task threadpools" begin
7-
c = Channel{Symbol}() do c; put!(c, threadpool(current_task())); end
8-
@test take!(c) === threadpool(current_task())
9-
c = Channel{Symbol}(spawn = true) do c; put!(c, threadpool(current_task())); end
10-
@test take!(c) === :default
11-
c = Channel{Symbol}(threadpool = :interactive) do c; put!(c, threadpool(current_task())); end
12-
@test take!(c) === :interactive
13-
@test_throws ArgumentError Channel{Symbol}(threadpool = :foo) do c; put!(c, :foo); end
14-
end
6+
c = Channel{Symbol}() do c; put!(c, threadpool(current_task())); end
7+
@test take!(c) === threadpool(current_task())
8+
c = Channel{Symbol}(spawn = true) do c; put!(c, threadpool(current_task())); end
9+
@test take!(c) === :default
10+
c = Channel{Symbol}(threadpool = :interactive) do c; put!(c, threadpool(current_task())); end
11+
@test take!(c) === :interactive
12+
@test_throws ArgumentError Channel{Symbol}(threadpool = :foo) do c; put!(c, :foo); end

test/spawn.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ out = read(`$echocmd hello` & `$echocmd world`, String)
7878
@test occursin("hello", out)
7979
@test read(pipeline(`$echocmd hello` & `$echocmd world`, sortcmd), String) == "hello\nworld\n"
8080

81-
@test (run(`$printfcmd " \033[34m[stdio passthrough ok]\033[0m\n"`); true)
81+
@test_warn r"[stdio passthrough ok]" run(pipeline(`$printfcmd " \033[34m[stdio passthrough ok]\033[0m\n"`, stdout=stderr, stderr=stderr))
8282

8383
# Test for SIGPIPE being a failure condition
8484
@test_throws ProcessFailedException run(pipeline(yescmd, `head`, devnull))

test/syntax.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3971,11 +3971,12 @@ end
39713971

39723972
# Module Replacement
39733973
module ReplacementContainer
3974+
using Test
39743975
module ReplaceMe
39753976
const x = 1
39763977
end
39773978
const Old = ReplaceMe
3978-
module ReplaceMe
3979+
@test_warn r"WARNING: replacing module ReplaceMe" @eval module ReplaceMe
39793980
const x = 2
39803981
end
39813982
end

0 commit comments

Comments
 (0)