@@ -2,10 +2,105 @@ using Pkg
22Pkg. add (" JET" )
33
44import OrdinaryDiffEqCore
5+ using OrdinaryDiffEqCore: ODEVerbosity
6+ import OrdinaryDiffEqCore. SciMLLogging as SciMLLogging
57using JET, Test
68
79@testset " JET Tests" begin
810 @test test_package (
911 OrdinaryDiffEqCore, target_defined_modules = true , mode = :typo
1012 ) === nothing broken = true
1113end
14+
15+ @testset " JET Test ODEVerbosity Constructors" begin
16+ @testset " Default constructor" begin
17+ @test_opt ODEVerbosity ()
18+ end
19+
20+ @testset " Preset constructors" begin
21+ @test_opt ODEVerbosity (SciMLLogging. None ())
22+ @test_opt ODEVerbosity (SciMLLogging. Minimal ())
23+ @test_opt ODEVerbosity (SciMLLogging. Standard ())
24+ @test_opt ODEVerbosity (SciMLLogging. Detailed ())
25+ @test_opt ODEVerbosity (SciMLLogging. All ())
26+ end
27+
28+ @testset " Group-level keyword constructors" begin
29+ @test_opt ODEVerbosity (error_control = SciMLLogging. ErrorLevel ())
30+ @test_opt ODEVerbosity (numerical = SciMLLogging. Silent ())
31+ @test_opt ODEVerbosity (performance = SciMLLogging. InfoLevel ())
32+ @test_opt ODEVerbosity (error_control = SciMLLogging. WarnLevel ())
33+ @test_opt ODEVerbosity (numerical = SciMLLogging. WarnLevel ())
34+ @test_opt ODEVerbosity (performance = SciMLLogging. Silent ())
35+ end
36+
37+ @testset " Individual keyword arguments" begin
38+ @test_opt ODEVerbosity (dt_NaN = SciMLLogging. ErrorLevel ())
39+ @test_opt ODEVerbosity (alg_switch = SciMLLogging. InfoLevel ())
40+ @test_opt ODEVerbosity (shampine_dt = SciMLLogging. Silent ())
41+ @test_opt ODEVerbosity (init_NaN = SciMLLogging. WarnLevel ())
42+ end
43+
44+ @testset " Linear and nonlinear verbosity" begin
45+ @test_opt ODEVerbosity (linear_verbosity = SciMLLogging. Detailed ())
46+ @test_opt ODEVerbosity (nonlinear_verbosity = SciMLLogging. Minimal ())
47+ @test_opt ODEVerbosity (linear_verbosity = SciMLLogging. None ())
48+ @test_opt ODEVerbosity (nonlinear_verbosity = SciMLLogging. All ())
49+ @test_opt ODEVerbosity (
50+ linear_verbosity = SciMLLogging. Detailed (),
51+ nonlinear_verbosity = SciMLLogging. Minimal ()
52+ )
53+ @test_opt ODEVerbosity (
54+ linear_verbosity = SciMLLogging. None (),
55+ nonlinear_verbosity = SciMLLogging. All ()
56+ )
57+ end
58+
59+ @testset " Mixed group and individual settings" begin
60+ @test_opt ODEVerbosity (
61+ numerical = SciMLLogging. Silent (),
62+ shampine_dt = SciMLLogging. WarnLevel ()
63+ )
64+ @test_opt ODEVerbosity (
65+ numerical = SciMLLogging. Silent (),
66+ shampine_dt = SciMLLogging. WarnLevel (),
67+ performance = SciMLLogging. InfoLevel ()
68+ )
69+ @test_opt ODEVerbosity (
70+ error_control = SciMLLogging. WarnLevel (),
71+ dt_NaN = SciMLLogging. ErrorLevel ()
72+ )
73+ end
74+
75+ @testset " Multiple group settings" begin
76+ @test_opt ODEVerbosity (
77+ error_control = SciMLLogging. ErrorLevel (),
78+ performance = SciMLLogging. InfoLevel (),
79+ numerical = SciMLLogging. Silent ()
80+ )
81+ @test_opt ODEVerbosity (
82+ error_control = SciMLLogging. WarnLevel (),
83+ performance = SciMLLogging. Silent (),
84+ numerical = SciMLLogging. WarnLevel ()
85+ )
86+ end
87+
88+ @testset " Complex mixed settings" begin
89+ @test_opt ODEVerbosity (
90+ error_control = SciMLLogging. WarnLevel (),
91+ performance = SciMLLogging. InfoLevel (),
92+ numerical = SciMLLogging. Silent (),
93+ linear_verbosity = SciMLLogging. Detailed (),
94+ nonlinear_verbosity = SciMLLogging. Minimal (),
95+ dt_NaN = SciMLLogging. ErrorLevel (),
96+ shampine_dt = SciMLLogging. WarnLevel ()
97+ )
98+ @test_opt ODEVerbosity (
99+ error_control = SciMLLogging. ErrorLevel (),
100+ performance = SciMLLogging. Silent (),
101+ numerical = SciMLLogging. WarnLevel (),
102+ linear_verbosity = SciMLLogging. All (),
103+ nonlinear_verbosity = SciMLLogging. None ()
104+ )
105+ end
106+ end
0 commit comments