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

Run shorter tests in PkgEval mode #882

Merged
merged 2 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
18 changes: 11 additions & 7 deletions test/algorithms/GLGM06.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
@test dim(sol) == 5

# static option
sol = solve(prob; T=5.0, alg=GLGM06(; δ=0.01, static=true))
ZS = Zonotope{Float64,SVector{5,Float64},SMatrix{5,16,Float64,80}}
@test setrep(sol) == ZS
@ts begin
sol = solve(prob; T=5.0, alg=GLGM06(; δ=0.01, static=true))
ZS = Zonotope{Float64,SVector{5,Float64},SMatrix{5,16,Float64,80}}
@test setrep(sol) == ZS
end

# use approx model for "discrete-time" reachability
sol = solve(prob; T=5.0, alg=GLGM06(; δ=0.01, approx_model=NoBloating()))
Expand All @@ -42,8 +44,10 @@ end
@test rsetrep(sol) == RT

# static case
alg = GLGM06(; δ=1e-2, static=true, dim=8, max_order=1, ngens=8)
sol = solve(prob; T=20.0, alg=alg)
RT = ReachSet{Float64,Zonotope{Float64,SVector{8,Float64},SMatrix{8,8,Float64,64}}}
@test rsetrep(sol) == RT
@ts begin
alg = GLGM06(; δ=1e-2, static=true, dim=8, max_order=1, ngens=8)
sol = solve(prob; T=20.0, alg=alg)
RT = ReachSet{Float64,Zonotope{Float64,SVector{8,Float64},SMatrix{8,8,Float64,64}}}
@test rsetrep(sol) == RT
end
end
4 changes: 2 additions & 2 deletions test/algorithms/TMJets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
@test flowpipe(sols) isa MixedFlowpipe
end

@testset "TMJets algorithm (TMJets21b): linear IVPs" begin
@ts @testset "TMJets algorithm (TMJets21b): linear IVPs" begin
prob, dt = exponential_1d()
sol = solve(prob; tspan=dt, alg=TMJets())
@test sol.alg isa TMJets
Expand Down Expand Up @@ -87,7 +87,7 @@ end
@test [0.3] ∉ overapproximate(sol[m + 1], Zonotope)
end

@testset "1D Burgers equation (TMJets21b)" begin
@ts @testset "1D Burgers equation (TMJets21b)" begin
L0 = 1.0 # domain length
U0 = 1.0 # Re = 20.
x = range(-0.5 * L0, 0.5 * L0; length=4)
Expand Down
2 changes: 1 addition & 1 deletion test/hybrid/hybrid.jl
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ end
# tested in test/algorithms/ASB07.jl
end

@testset "Thermostat simulations" begin
@ts @testset "Thermostat simulations" begin
S = thermostat()
T = 5.0

Expand Down
2 changes: 1 addition & 1 deletion test/reachsets/reachsets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ end
@test all(x -> isequivalent(Bt, overapproximate(set(x), Hyperrectangle)), [p1, p2, p3, p4])
end

@testset "Conversion of Taylor model reach-sets" begin
@ts @testset "Conversion of Taylor model reach-sets" begin
H = Hyperrectangle(ones(2), [0.2, 0.4])
a = overapproximate(H, TaylorModelReachSet)
b = convert(TaylorModelReachSet, H)
Expand Down
83 changes: 49 additions & 34 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,41 +1,56 @@
using Test, ReachabilityAnalysis

TEST_MODELS = ["models/harmonic_oscillator.jl",
"models/forced_oscillator.jl",
"models/exponential1D.jl",
"models/motor.jl",
"models/linear5D.jl",
"models/generated/VanDerPol.jl",
"models/EMBrake.jl",
"models/bouncing_ball.jl",
"models/burgers.jl",
"models/generated/Brusselator.jl",
"models/hybrid/thermostat.jl"]

TEST_FILES = ["continuous/solve.jl",
"continuous/symbolics.jl",
"continuous/traces.jl",
"discretization/exponentiation.jl",
"flowpipes/flowpipes.jl",
"flowpipes/setops.jl",
"reachsets/reachsets.jl",
"hybrid/hybrid.jl"]

TEST_ALGORITHMS = ["algorithms/INT.jl",
"algorithms/BOX.jl",
"algorithms/CARLIN.jl",
"algorithms/GLGM06.jl",
"algorithms/LGG09.jl",
"algorithms/ASB07.jl",
"algorithms/BFFPSV18.jl",
"algorithms/TMJets.jl",
"algorithms/ORBIT.jl",
"algorithms/QINT.jl",
"algorithms/VREP.jl",
"algorithms/FLOWSTAR.jl"]
# auxiliary code to skip expensive tests
begin
__test_short = haskey(ENV, "JULIA_PKGEVAL")

macro ts(arg)
schillic marked this conversation as resolved.
Show resolved Hide resolved
if !__test_short
quote
$(esc(arg))
end
end
end

fn(vec) = [e for e in vec if !isnothing(e)]
end

TEST_MODELS = fn(["models/harmonic_oscillator.jl",
"models/forced_oscillator.jl",
"models/exponential1D.jl",
"models/motor.jl",
"models/linear5D.jl",
"models/generated/VanDerPol.jl",
"models/EMBrake.jl",
"models/bouncing_ball.jl",
@ts("models/burgers.jl"),
@ts("models/generated/Brusselator.jl"),
@ts("models/hybrid/thermostat.jl")])

TEST_FILES = fn(["continuous/solve.jl",
@ts("continuous/symbolics.jl"),
@ts("continuous/traces.jl"),
@ts("discretization/exponentiation.jl"),
"flowpipes/flowpipes.jl",
@ts("flowpipes/setops.jl"),
"reachsets/reachsets.jl",
"hybrid/hybrid.jl"])

TEST_ALGORITHMS = fn(["algorithms/INT.jl",
"algorithms/BOX.jl",
@ts("algorithms/CARLIN.jl"),
"algorithms/GLGM06.jl",
"algorithms/LGG09.jl",
@ts("algorithms/ASB07.jl"),
"algorithms/BFFPSV18.jl",
"algorithms/TMJets.jl",
"algorithms/ORBIT.jl",
"algorithms/QINT.jl",
@ts("algorithms/VREP.jl"),
@ts("algorithms/FLOWSTAR.jl")])

foreach(include, TEST_MODELS)
foreach(include, TEST_FILES)
foreach(include, TEST_ALGORITHMS)

include("Aqua.jl")
@ts include("Aqua.jl")
Loading