Skip to content

Commit ed27d82

Browse files
authored
Merge pull request #661 from JuliaSymbolics/SafeTestsets
Enhance Reproducibility and Isolation with SafeTestsets
2 parents 522fae3 + 3ca3c93 commit ed27d82

File tree

9 files changed

+46
-38
lines changed

9 files changed

+46
-38
lines changed

Project.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,9 @@ PkgBenchmark = "32113eaa-f34f-5b0d-bd6c-c81e245fc73d"
6868
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
6969
ReferenceTests = "324d217c-45ce-50fc-942e-d289b448e8cf"
7070
ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267"
71+
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
7172
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
7273
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
7374

7475
[targets]
75-
test = ["BenchmarkTools", "Documenter", "LabelledArrays", "Pkg", "PkgBenchmark", "Random", "ReferenceTests", "ReverseDiff", "Test", "Zygote"]
76+
test = ["BenchmarkTools", "Documenter", "LabelledArrays", "Pkg", "PkgBenchmark", "Random", "ReferenceTests", "ReverseDiff", "SafeTestsets", "Test", "Zygote"]

test/basics.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ using SymbolicUtils: Symbolic, Sym, FnType, Term, Add, Mul, Pow, symtype, operat
22
using SymbolicUtils
33
using IfElse: ifelse
44
using Setfield
5-
using Test
5+
using Test, ReferenceTests
6+
7+
include("utils.jl")
68

79
@testset "@syms" begin
810
let

test/doctest.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using Documenter, SymbolicUtils
2+
3+
DocMeta.setdocmeta!(
4+
SymbolicUtils,
5+
:DocTestSetup,
6+
:(using SymbolicUtils);
7+
recursive=true
8+
)
9+
10+
doctest(SymbolicUtils)

test/fuzzlib.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
using SymbolicUtils
2-
using SymbolicUtils: Term
2+
using SymbolicUtils: Term, showraw, Symbolic, issym
33
using SpecialFunctions
44
using Test
55
import IfElse: ifelse
66
import IfElse
7-
8-
using SymbolicUtils: showraw, Symbolic
7+
using NaNMath
98

109
function rand_input(T)
1110
if T == Bool

test/order.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using Test
22
using Combinatorics
3-
using SymbolicUtils: <ₑ, arguments
3+
using SymbolicUtils
4+
using SymbolicUtils: <ₑ, arguments, Term
45
SymbolicUtils.show_simplified[] = false
56

67
@syms a b c

test/polyform.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
using SymbolicUtils: PolyForm, Term, symtype
22
using Test, SymbolicUtils
33

4+
include("utils.jl")
5+
46
@testset "div and polyform" begin
57
@syms x y z
68
@test_skip repr(PolyForm(x-y)) == "-y + x"

test/rewrite.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
using SymbolicUtils
2+
3+
include("utils.jl")
4+
15
@syms a b c
26

37
@testset "Equality" begin

test/rulesets.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
using Random: shuffle, seed!
2+
using SymbolicUtils
23
using SymbolicUtils: getdepth, Rewriters, Term
34

5+
include("utils.jl")
6+
47
@testset "Chain, Postwalk and Fixpoint" begin
58
@syms w z α::Real β::Real
69

test/runtests.jl

Lines changed: 18 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,20 @@
1-
using Documenter
2-
using Pkg
3-
using Test
4-
using SymbolicUtils
5-
using ReferenceTests
6-
import IfElse: ifelse
1+
using Pkg, Test, SafeTestsets
72

8-
DocMeta.setdocmeta!(
9-
SymbolicUtils,
10-
:DocTestSetup,
11-
:(using SymbolicUtils);
12-
recursive=true
13-
)
14-
15-
doctest(SymbolicUtils)
16-
SymbolicUtils.show_simplified[] = false
17-
18-
include("utils.jl")
19-
20-
if haskey(ENV, "SU_BENCHMARK_ONLY")
21-
include("benchmark.jl")
22-
else
23-
include("basics.jl")
24-
include("order.jl")
25-
include("polyform.jl")
26-
include("rewrite.jl")
27-
include("rulesets.jl")
28-
include("code.jl")
29-
include("cse.jl")
30-
include("interface.jl")
31-
# Disabled until https://github.com/JuliaMath/SpecialFunctions.jl/issues/446 is fixed
32-
include("fuzz.jl")
33-
include("adjoints.jl")
3+
@testset begin
4+
if haskey(ENV, "SU_BENCHMARK_ONLY")
5+
@safetestset "Benchmark" begin include("benchmark.jl") end
6+
else
7+
@safetestset "Doc" begin include("doctest.jl") end
8+
@safetestset "Basics" begin include("basics.jl") end
9+
@safetestset "Order" begin include("order.jl") end
10+
@safetestset "PolyForm" begin include("polyform.jl") end
11+
@safetestset "Rewrite" begin include("rewrite.jl") end
12+
@safetestset "Rulesets" begin include("rulesets.jl") end
13+
@safetestset "Code" begin include("code.jl") end
14+
@safetestset "CSE" begin include("cse.jl") end
15+
@safetestset "Interface" begin include("interface.jl") end
16+
# Disabled until https://github.com/JuliaMath/SpecialFunctions.jl/issues/446 is fixed
17+
@safetestset "Fuzz" begin include("fuzz.jl") end
18+
@safetestset "Adjoints" begin include("adjoints.jl") end
19+
end
3420
end

0 commit comments

Comments
 (0)