Skip to content

Commit

Permalink
fix test syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
lkdvos committed Dec 4, 2024
1 parent 76ea53e commit 79255d6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 25 deletions.
22 changes: 6 additions & 16 deletions templates/test/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,19 @@ const GROUP = uppercase(
for testgroup in filter(isdir, readdir(@__DIR__))
if GROUP == "ALL" || GROUP == uppercase(testgroup)
for file in readdir(joinpath(@__DIR__, testgroup); join=true)
@eval @safetestset "$file" begin
include(file)
end
@eval :(@safetestset($file, include(file)))
end
end
end

# single files in top folder
if GROUP == "ALL" || GROUP == "TOP"
for file in filter(isfile, readdir(@__DIR__))
@eval @safetestset "$file" begin
include(file)
end
end
for file in filter(isfile, readdir(@__DIR__))
@eval :(@safetestset($file, include(file)))
end

# test examples
if GROUP == "ALL" || GROUP == "EXAMPLES"
examplepath = joinpath(@__DIR__, "..", "examples")
for file in filter(endswith(".jl"), readdir(examplepath; join=true))
@eval @safetestset "$file" begin
@suppress include(file)
end
end
examplepath = joinpath(@__DIR__, "..", "examples")
for file in filter(endswith(".jl"), readdir(examplepath; join=true))
@eval :(@safetestset($file, @suppress include(file)))
end
end
12 changes: 3 additions & 9 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,19 @@ const GROUP = uppercase(
for testgroup in filter(isdir, readdir(@__DIR__))
if GROUP == "ALL" || GROUP == uppercase(testgroup)
for file in readdir(joinpath(@__DIR__, testgroup); join=true)
@eval @safetestset "$file" begin
include(file)
end
@eval :(@safetestset($file, include(file)))
end
end
end

# single files in top folder
for file in filter(isfile, readdir(@__DIR__))
@eval @safetestset "$file" begin
include(file)
end
@eval :(@safetestset($file, include(file)))
end

# test examples
examplepath = joinpath(@__DIR__, "..", "examples")
for file in filter(endswith(".jl"), readdir(examplepath; join=true))
@eval @safetestset "$file" begin
@suppress include(file)
end
@eval :(@safetestset($file, @suppress include(file)))
end
end

0 comments on commit 79255d6

Please sign in to comment.