Skip to content

Commit

Permalink
Update examples - suppressor interaction
Browse files Browse the repository at this point in the history
  • Loading branch information
lkdvos committed Dec 8, 2024
1 parent a105eb7 commit db5d764
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
9 changes: 6 additions & 3 deletions templates/test/test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using SafeTestsets: @safetestset
using Suppressor: @suppress
using Suppressor: Suppressor

# check for filtered groups
# either via `--group=ALL` or through ENV["GROUP"]
Expand Down Expand Up @@ -42,8 +42,11 @@ end
# test examples
examplepath = joinpath(@__DIR__, "..", "examples")
for file in filter(endswith(".jl"), readdir(examplepath; join=true))
@suppress @eval @safetestset $file begin
include($file)
filename = basename(file)
@eval begin
@safetestset $filename begin
$(Expr(:macrocall, GlobalRef(Suppressor, Symbol("@suppress")), LineNumberNode(@__LINE__, @__FILE__), :(include($file))))
end
end
end
end
9 changes: 6 additions & 3 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using SafeTestsets: @safetestset
using Suppressor: @suppress
using Suppressor: Suppressor

# check for filtered groups
# either via `--group=ALL` or through ENV["GROUP"]
Expand Down Expand Up @@ -42,8 +42,11 @@ end
# test examples
examplepath = joinpath(@__DIR__, "..", "examples")
for file in filter(endswith(".jl"), readdir(examplepath; join=true))
@suppress @eval @safetestset $file begin
include($file)
filename = basename(file)
@eval begin
@safetestset $filename begin
$(Expr(:macrocall, GlobalRef(Suppressor, Symbol("@suppress")), LineNumberNode(@__LINE__, @__FILE__), :(include($file))))
end
end
end
end

0 comments on commit db5d764

Please sign in to comment.