Skip to content

Commit 3a493a1

Browse files
committed
using Suppressor to silence tests
1 parent 7f7e5d6 commit 3a493a1

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

Project.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,12 @@ Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
143143
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
144144
QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
145145
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
146+
Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb"
146147
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
147148
TestItemRunner = "f8b46487-2199-4994-9208-9a1283c18c0a"
148149
Wannier = "2b19380a-1f7e-4d7d-b1b8-8aa60b3321c9"
149150
WriteVTK = "64499a7a-5c06-52f2-abe2-ccb03c286192"
150151
wannier90_jll = "c5400fa0-8d08-52c2-913f-1e3f656c1ce9"
151152

152153
[targets]
153-
test = ["Test", "TestItemRunner", "ASEconvert", "Aqua", "AtomsIO", "AtomsIOPython", "CUDA", "CUDA_Runtime_jll", "ComponentArrays", "DoubleFloats", "FiniteDiff", "FiniteDifferences", "GenericLinearAlgebra", "IntervalArithmetic", "JLD2", "JSON3", "Logging", "Plots", "QuadGK", "Random", "KrylovKit", "Wannier", "WriteVTK", "wannier90_jll"]
154+
test = ["Test", "TestItemRunner", "ASEconvert", "Aqua", "AtomsIO", "AtomsIOPython", "CUDA", "CUDA_Runtime_jll", "ComponentArrays", "DoubleFloats", "FiniteDiff", "FiniteDifferences", "GenericLinearAlgebra", "IntervalArithmetic", "JLD2", "JSON3", "KrylovKit", "Logging", "Plots", "QuadGK", "Random", "Suppressor", "Wannier", "WriteVTK", "wannier90_jll"]

test/runtests_runner.jl

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# This is needed to play nicely with MPI parallelised tests
33
#
44
using TestItemRunner
5+
using Suppressor
56

67
include("runtests_parser.jl")
78
(; base_tag, excluded, included) = parse_test_args()
@@ -29,4 +30,30 @@ function dftk_testfilter(ti)
2930
return false
3031
end
3132
end
32-
@run_package_tests filter=dftk_testfilter verbose=true
33+
34+
function run_tests()
35+
output = @capture_out try
36+
@run_package_tests filter=dftk_testfilter verbose=true
37+
catch err
38+
Base.showerror(stderr, err, Base.catch_backtrace())
39+
end
40+
41+
lines = split(output, "\n")
42+
# Print failed tests.
43+
println()
44+
for id in findall(occursin.("Test Failed", lines))
45+
id_context = id
46+
while !isempty(lines[id_context])
47+
println(lines[id_context])
48+
id_context += 1
49+
end
50+
println()
51+
end
52+
# Print the summary.
53+
idx = findfirst(occursin.(r"^Test Summary:", lines))
54+
if !isnothing(idx)
55+
println(join(lines[idx:end], "\n"))
56+
end
57+
end
58+
59+
run_tests()

0 commit comments

Comments
 (0)