From a105eb76e8ec737dca40808d23e5a1f2fb4fd3f4 Mon Sep 17 00:00:00 2001 From: Lukas Devos Date: Sun, 8 Dec 2024 07:52:09 -0500 Subject: [PATCH 1/3] Update test project.toml structure --- Project.toml | 11 ----------- templates/project/Project.toml | 13 ------------- templates/test/test/Project.toml | 11 +++++++++++ test/Project.toml | 11 +++++++++++ 4 files changed, 22 insertions(+), 24 deletions(-) create mode 100644 templates/test/test/Project.toml create mode 100644 test/Project.toml diff --git a/Project.toml b/Project.toml index 1f94f50..4b227b1 100644 --- a/Project.toml +++ b/Project.toml @@ -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"] diff --git a/templates/project/Project.toml b/templates/project/Project.toml index 4bd9dbe..f7a727c 100644 --- a/templates/project/Project.toml +++ b/templates/project/Project.toml @@ -4,17 +4,4 @@ authors = ["ITensor developers 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"] diff --git a/templates/test/test/Project.toml b/templates/test/test/Project.toml new file mode 100644 index 0000000..e9c291e --- /dev/null +++ b/templates/test/test/Project.toml @@ -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" diff --git a/test/Project.toml b/test/Project.toml new file mode 100644 index 0000000..e9c291e --- /dev/null +++ b/test/Project.toml @@ -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" From db5d7644e33dbe957f15eb786e39715ef2cb0602 Mon Sep 17 00:00:00 2001 From: Lukas Devos Date: Sun, 8 Dec 2024 08:26:51 -0500 Subject: [PATCH 2/3] Update examples - suppressor interaction --- templates/test/test/runtests.jl | 9 ++++++--- test/runtests.jl | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/templates/test/test/runtests.jl b/templates/test/test/runtests.jl index bb62115..77a45ea 100644 --- a/templates/test/test/runtests.jl +++ b/templates/test/test/runtests.jl @@ -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"] @@ -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 diff --git a/test/runtests.jl b/test/runtests.jl index bb62115..77a45ea 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -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"] @@ -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 From 3391dd4209f963f5352e6443fb7a02228cd2b508 Mon Sep 17 00:00:00 2001 From: Lukas Devos Date: Sun, 8 Dec 2024 08:36:25 -0500 Subject: [PATCH 3/3] Formatter --- templates/test/test/runtests.jl | 7 ++++++- test/runtests.jl | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/templates/test/test/runtests.jl b/templates/test/test/runtests.jl index 77a45ea..1140eea 100644 --- a/templates/test/test/runtests.jl +++ b/templates/test/test/runtests.jl @@ -45,7 +45,12 @@ end filename = basename(file) @eval begin @safetestset $filename begin - $(Expr(:macrocall, GlobalRef(Suppressor, Symbol("@suppress")), LineNumberNode(@__LINE__, @__FILE__), :(include($file)))) + $(Expr( + :macrocall, + GlobalRef(Suppressor, Symbol("@suppress")), + LineNumberNode(@__LINE__, @__FILE__), + :(include($file)), + )) end end end diff --git a/test/runtests.jl b/test/runtests.jl index 77a45ea..1140eea 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -45,7 +45,12 @@ end filename = basename(file) @eval begin @safetestset $filename begin - $(Expr(:macrocall, GlobalRef(Suppressor, Symbol("@suppress")), LineNumberNode(@__LINE__, @__FILE__), :(include($file)))) + $(Expr( + :macrocall, + GlobalRef(Suppressor, Symbol("@suppress")), + LineNumberNode(@__LINE__, @__FILE__), + :(include($file)), + )) end end end