|
1 | | -using Pkg |
| 1 | +using SafeTestsets |
2 | 2 | using Test |
| 3 | +using SciMLTesting |
3 | 4 |
|
4 | | -const GROUP = get(ENV, "GROUP", "All") |
5 | | - |
6 | | -if GROUP == "All" || GROUP == "Core" |
7 | | - using GeometricIntegratorsDiffEq |
8 | | - using GeometricIntegrators |
9 | | - using DiffEqBase: solve, ReturnCode, SecondOrderODEProblem |
10 | | - import ODEProblemLibrary: prob_ode_2Dlinear |
11 | | - |
12 | | - @testset "GeometricIntegratorsDiffEq" begin |
13 | | - @testset "Standard ODE Problems" begin |
14 | | - prob = prob_ode_2Dlinear |
15 | | - |
16 | | - sol = solve(prob, GIEuler(), dt = 0.1) |
17 | | - @test sol.retcode == ReturnCode.Success |
18 | | - sol = solve(prob, GIMidpoint(), dt = 0.1) |
19 | | - @test sol.retcode == ReturnCode.Success |
20 | | - sol = solve(prob, GIHeun2(), dt = 0.1) |
21 | | - @test sol.retcode == ReturnCode.Success |
22 | | - sol = solve(prob, GIHeun3(), dt = 0.1) |
23 | | - @test sol.retcode == ReturnCode.Success |
24 | | - sol = solve(prob, GIRalston2(), dt = 0.1) |
25 | | - @test sol.retcode == ReturnCode.Success |
26 | | - sol = solve(prob, GIRalston3(), dt = 0.1) |
27 | | - @test sol.retcode == ReturnCode.Success |
28 | | - sol = solve(prob, GIRunge(), dt = 0.1) |
29 | | - @test sol.retcode == ReturnCode.Success |
30 | | - sol = solve(prob, GIKutta(), dt = 0.1) |
31 | | - @test sol.retcode == ReturnCode.Success |
32 | | - sol = solve(prob, GIRK416(), dt = 0.1) |
33 | | - @test sol.retcode == ReturnCode.Success |
34 | | - sol = solve(prob, GIRK438(), dt = 0.1) |
35 | | - @test sol.retcode == ReturnCode.Success |
36 | | - sol = solve(prob, GISSPRK3(), dt = 0.1) |
37 | | - @test sol.retcode == ReturnCode.Success |
38 | | - sol = solve(prob, GICrankNicolson(), dt = 0.1) |
39 | | - @test sol.retcode == ReturnCode.Success |
40 | | - sol = solve(prob, GIKraaijevangerSpijker(), dt = 0.1) |
41 | | - @test sol.retcode == ReturnCode.Success |
42 | | - sol = solve(prob, GIQinZhang(), dt = 0.1) |
43 | | - @test sol.retcode == ReturnCode.Success |
44 | | - sol = solve(prob, GICrouzeix(), dt = 0.1) |
45 | | - @test sol.retcode == ReturnCode.Success |
46 | | - sol = solve(prob, GIImplicitEuler(), dt = 0.1) |
47 | | - @test sol.retcode == ReturnCode.Success |
48 | | - sol = solve(prob, GIImplicitMidpoint(), dt = 0.1) |
49 | | - @test sol.retcode == ReturnCode.Success |
50 | | - sol = solve(prob, GISRK3(), dt = 0.1) |
51 | | - @test sol.retcode == ReturnCode.Success |
52 | | - sol = solve(prob, GIGLRK(2), dt = 0.1) |
53 | | - @test sol.retcode == ReturnCode.Success |
54 | | - sol = solve(prob, GIRadauIA(2), dt = 0.1) |
55 | | - @test sol.retcode == ReturnCode.Success |
56 | | - sol = solve(prob, GIRadauIIA(2), dt = 0.1) |
57 | | - @test sol.retcode == ReturnCode.Success |
58 | | - sol = solve(prob, GILobattoIIIA(2), dt = 0.1) |
59 | | - @test sol.retcode == ReturnCode.Success |
60 | | - sol = solve(prob, GILobattoIIIB(2), dt = 0.1) |
61 | | - @test sol.retcode == ReturnCode.Success |
62 | | - sol = solve(prob, GILobattoIIIC(2), dt = 0.1) |
63 | | - @test sol.retcode == ReturnCode.Success |
64 | | - sol = solve(prob, GILobattoIIIC̄(2), dt = 0.1) |
65 | | - @test sol.retcode == ReturnCode.Success |
66 | | - sol = solve(prob, GILobattoIIID(2), dt = 0.1) |
67 | | - @test sol.retcode == ReturnCode.Success |
68 | | - sol = solve(prob, GILobattoIIIE(2), dt = 0.1) |
69 | | - @test sol.retcode == ReturnCode.Success |
70 | | - sol = solve(prob, GILobattoIIIF(2), dt = 0.1) |
71 | | - @test sol.retcode == ReturnCode.Success |
| 5 | +run_tests(; |
| 6 | + core = function () |
| 7 | + @safetestset "GeometricIntegratorsDiffEq" begin |
| 8 | + include("core_tests.jl") |
72 | 9 | end |
73 | | - |
74 | | - @testset "Second Order ODE Problems" begin |
75 | | - # Second order ODE problem - use the new 5-argument convention with p parameter |
76 | | - u0 = zeros(2) |
77 | | - v0 = ones(2) |
78 | | - f2 = function (dv, v, u, p, t) |
79 | | - dv .= -u |
80 | | - end |
81 | | - prob = SecondOrderODEProblem{true}(f2, v0, u0, (0.0, 5.0)) |
82 | | - |
83 | | - sol = solve(prob, GISymplecticEulerA(), dt = 0.1) |
84 | | - @test sol.retcode == ReturnCode.Success |
85 | | - sol = solve(prob, GISymplecticEulerB(), dt = 0.1) |
86 | | - @test sol.retcode == ReturnCode.Success |
87 | | - sol = solve(prob, GILobattoIIIAIIIB(2), dt = 0.1) |
88 | | - @test sol.retcode == ReturnCode.Success |
89 | | - sol = solve(prob, GILobattoIIIBIIIA(2), dt = 0.1) |
90 | | - @test sol.retcode == ReturnCode.Success |
| 10 | + return @safetestset "Explicit Imports" begin |
| 11 | + include("explicit_imports_test.jl") |
91 | 12 | end |
92 | | - end # testset GeometricIntegratorsDiffEq |
93 | | - |
94 | | - # Run ExplicitImports tests |
95 | | - include("explicit_imports_test.jl") |
96 | | -end |
97 | | - |
98 | | -# Run NoPre tests (JET and AllocCheck) in a separate environment |
99 | | -if GROUP == "NoPre" |
100 | | - Pkg.activate("nopre") |
101 | | - Pkg.develop(PackageSpec(path = dirname(@__DIR__))) |
102 | | - Pkg.instantiate() |
103 | | - @time @testset "JET Tests" begin |
104 | | - include("nopre/jet.jl") |
105 | | - end |
106 | | - @time @testset "AllocCheck Tests" begin |
107 | | - include("nopre/alloc_tests.jl") |
108 | | - end |
109 | | -end |
| 13 | + end, |
| 14 | + groups = Dict( |
| 15 | + # NoPre runs the JET and AllocCheck tests in their own environment. The |
| 16 | + # original dispatcher ran these only for GROUP=="NoPre" (never as part of |
| 17 | + # "All"), so NoPre is an env-bearing group kept out of the curated `all`. |
| 18 | + "NoPre" => (; |
| 19 | + env = joinpath(@__DIR__, "NoPre"), |
| 20 | + body = function () |
| 21 | + @time @safetestset "JET Tests" begin |
| 22 | + include(joinpath(@__DIR__, "NoPre", "jet.jl")) |
| 23 | + end |
| 24 | + return @time @safetestset "AllocCheck Tests" begin |
| 25 | + include(joinpath(@__DIR__, "NoPre", "alloc_tests.jl")) |
| 26 | + end |
| 27 | + end, |
| 28 | + ), |
| 29 | + ), |
| 30 | + # The original runtests.jl ran the Core body for GROUP=All and GROUP=Core, and |
| 31 | + # ran NoPre only for GROUP=NoPre (never under "All"). Curate "All" to Core only. |
| 32 | + all = ["Core"], |
| 33 | +) |
0 commit comments