Skip to content

Commit 478dbf0

Browse files
authored
Test Project.toml structure and suppressor (#39)
1 parent 419618f commit 478dbf0

File tree

6 files changed

+44
-30
lines changed

6 files changed

+44
-30
lines changed

Project.toml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,11 @@ Preferences = "21216c6a-2e73-6563-6e65-726566657250"
1313
Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb"
1414

1515
[compat]
16-
Aqua = "0.8.9"
1716
DocStringExtensions = "0.9.3"
1817
Git = "1.3.1"
1918
Git_jll = "2.46.2"
2019
LibGit2 = "1.10"
2120
PkgSkeleton = "1.3.1"
2221
Preferences = "1.4.3"
23-
SafeTestsets = "0.1"
2422
Suppressor = "0.2.8"
25-
Test = "1.10"
2623
julia = "1.10"
27-
28-
[extras]
29-
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
30-
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
31-
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
32-
33-
[targets]
34-
test = ["Aqua", "Test", "SafeTestsets"]

templates/project/Project.toml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,4 @@ authors = ["ITensor developers <[email protected]> and contributors"]
44
version = "0.1.0"
55

66
[compat]
7-
Aqua = "0.8.9"
8-
SafeTestsets = "0.1"
9-
Suppressor = "0.2"
10-
Test = "1.10"
117
julia = "1.10"
12-
13-
[extras]
14-
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
15-
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
16-
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
17-
Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb"
18-
19-
[targets]
20-
test = ["Aqua", "Test", "Suppressor", "SafeTestsets"]

templates/test/test/Project.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[deps]
2+
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
3+
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
4+
Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb"
5+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
6+
7+
[compat]
8+
Aqua = "0.8.9"
9+
SafeTestsets = "0.1"
10+
Suppressor = "0.2"
11+
Test = "1.10"

templates/test/test/runtests.jl

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using SafeTestsets: @safetestset
2-
using Suppressor: @suppress
2+
using Suppressor: Suppressor
33

44
# check for filtered groups
55
# either via `--group=ALL` or through ENV["GROUP"]
@@ -42,8 +42,16 @@ end
4242
# test examples
4343
examplepath = joinpath(@__DIR__, "..", "examples")
4444
for file in filter(endswith(".jl"), readdir(examplepath; join=true))
45-
@suppress @eval @safetestset $file begin
46-
include($file)
45+
filename = basename(file)
46+
@eval begin
47+
@safetestset $filename begin
48+
$(Expr(
49+
:macrocall,
50+
GlobalRef(Suppressor, Symbol("@suppress")),
51+
LineNumberNode(@__LINE__, @__FILE__),
52+
:(include($file)),
53+
))
54+
end
4755
end
4856
end
4957
end

test/Project.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[deps]
2+
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
3+
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
4+
Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb"
5+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
6+
7+
[compat]
8+
Aqua = "0.8.9"
9+
SafeTestsets = "0.1"
10+
Suppressor = "0.2"
11+
Test = "1.10"

test/runtests.jl

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using SafeTestsets: @safetestset
2-
using Suppressor: @suppress
2+
using Suppressor: Suppressor
33

44
# check for filtered groups
55
# either via `--group=ALL` or through ENV["GROUP"]
@@ -42,8 +42,16 @@ end
4242
# test examples
4343
examplepath = joinpath(@__DIR__, "..", "examples")
4444
for file in filter(endswith(".jl"), readdir(examplepath; join=true))
45-
@suppress @eval @safetestset $file begin
46-
include($file)
45+
filename = basename(file)
46+
@eval begin
47+
@safetestset $filename begin
48+
$(Expr(
49+
:macrocall,
50+
GlobalRef(Suppressor, Symbol("@suppress")),
51+
LineNumberNode(@__LINE__, @__FILE__),
52+
:(include($file)),
53+
))
54+
end
4755
end
4856
end
4957
end

0 commit comments

Comments
 (0)