Skip to content

Commit 604c841

Browse files
committed
List ambiguities when failing the test.
[skip ci]
1 parent bb49887 commit 604c841

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

test/base/aqua.jl

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
using Aqua
22

3+
const MAX_AMBIGUITIES = 15
4+
35
# FIXME: we have plenty of ambiguities, let's at least ensure that we don't create more
46
let ambs = Aqua.detect_ambiguities(CUDA; recursive=true)
57
pkg_match(pkgname, pkgdir::Nothing) = false
@@ -8,8 +10,25 @@ let ambs = Aqua.detect_ambiguities(CUDA; recursive=true)
810
# StaticArrays pirates a bunch of Random stuff...
911
filter!(x -> !pkg_match("StaticArrays", pkgdir(first(x).module)), ambs)
1012

11-
@warn "Remaining ambiguities: $(length(ambs))"
12-
@test length(ambs) 15
13+
# if we'll fail this test, at least show which ambiguities were detected
14+
if length(ambs) > MAX_AMBIGUITIES
15+
for (ma, mb) in ambs
16+
println()
17+
println("Ambiguity detected:")
18+
if VERSION >= v"1.9"
19+
print(" ")
20+
Base.show_method(stdout, ma)
21+
println()
22+
print(" ")
23+
Base.show_method(stdout, mb)
24+
println()
25+
else
26+
println(" ", ma)
27+
println(" ", mb)
28+
end
29+
end
30+
end
31+
@test length(ambs) MAX_AMBIGUITIES
1332
end
1433

1534
Aqua.test_all(CUDA;

0 commit comments

Comments
 (0)