forked from SciML/SciMLStructures.jl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqa.jl
More file actions
46 lines (40 loc) · 2 KB
/
qa.jl
File metadata and controls
46 lines (40 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using SciMLStructures, Aqua, JET
using SciMLStructures: Tunable, Constants, Caches, Discrete, Initials,
canonicalize, hasportion, isscimlstructure, replace
@testset "Aqua" begin
Aqua.find_persistent_tasks_deps(SciMLStructures)
Aqua.test_ambiguities(SciMLStructures, recursive = false)
Aqua.test_deps_compat(SciMLStructures)
Aqua.test_piracies(SciMLStructures)
Aqua.test_project_extras(SciMLStructures)
Aqua.test_stale_deps(SciMLStructures)
Aqua.test_unbound_args(SciMLStructures)
Aqua.test_undefined_exports(SciMLStructures)
end
@testset "JET static analysis" begin
x = [1.0, 2.0, 3.0]
mat = [1.0 2.0; 3.0 4.0]
@testset "hasportion type stability" begin
@test_opt target_modules = (SciMLStructures,) hasportion(Tunable(), x)
@test_opt target_modules = (SciMLStructures,) hasportion(Constants(), x)
@test_opt target_modules = (SciMLStructures,) hasportion(Caches(), x)
@test_opt target_modules = (SciMLStructures,) hasportion(Discrete(), x)
@test_opt target_modules = (SciMLStructures,) hasportion(Initials(), x)
end
@testset "isscimlstructure type stability" begin
@test_opt target_modules = (SciMLStructures,) isscimlstructure(x)
@test_opt target_modules = (SciMLStructures,) isscimlstructure(mat)
end
@testset "canonicalize type stability" begin
@test_opt target_modules = (SciMLStructures,) canonicalize(Tunable(), x)
@test_opt target_modules = (SciMLStructures,) canonicalize(Constants(), x)
@test_opt target_modules = (SciMLStructures,) canonicalize(Caches(), x)
@test_opt target_modules = (SciMLStructures,) canonicalize(Discrete(), x)
@test_opt target_modules = (SciMLStructures,) canonicalize(Tunable(), mat)
end
@testset "replace type stability" begin
@test_opt target_modules = (SciMLStructures,) replace(Tunable(), x, [4.0, 5.0, 6.0])
@test_opt target_modules = (SciMLStructures,) replace(
Tunable(), mat, [5.0, 6.0, 7.0, 8.0])
end
end