Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test Project.toml structure and suppressor #39

Merged
merged 3 commits into from
Dec 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,11 @@ Preferences = "21216c6a-2e73-6563-6e65-726566657250"
Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb"

[compat]
Aqua = "0.8.9"
DocStringExtensions = "0.9.3"
Git = "1.3.1"
Git_jll = "2.46.2"
LibGit2 = "1.10"
PkgSkeleton = "1.3.1"
Preferences = "1.4.3"
SafeTestsets = "0.1"
Suppressor = "0.2.8"
Test = "1.10"
julia = "1.10"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Aqua", "Test", "SafeTestsets"]
13 changes: 0 additions & 13 deletions templates/project/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,4 @@ authors = ["ITensor developers <[email protected]> and contributors"]
version = "0.1.0"

[compat]
Aqua = "0.8.9"
SafeTestsets = "0.1"
Suppressor = "0.2"
Test = "1.10"
julia = "1.10"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb"

[targets]
test = ["Aqua", "Test", "Suppressor", "SafeTestsets"]
11 changes: 11 additions & 0 deletions templates/test/test/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[deps]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
Aqua = "0.8.9"
SafeTestsets = "0.1"
Suppressor = "0.2"
Test = "1.10"
14 changes: 11 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,16 @@ 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
11 changes: 11 additions & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[deps]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
Aqua = "0.8.9"
SafeTestsets = "0.1"
Suppressor = "0.2"
Test = "1.10"
14 changes: 11 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,16 @@ 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
Loading