Skip to content

Commit a52c6e5

Browse files
committed
test: add Aqua
The test exclude `unbound_args` since `Vararg` is needed for the splatting syntax of `JuMP.@operator`, and JuMP will never call the associated functions with 0 argument (it would mean 0 decision variable).
1 parent 12bf274 commit a52c6e5

3 files changed

Lines changed: 13 additions & 1 deletion

File tree

Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ LinearMPC = "82e1c212-e1a2-49d2-b26a-a31d6968e3bd"
3030
LinearMPCext = "LinearMPC"
3131

3232
[compat]
33+
Aqua = "0.8"
3334
ControlSystemsBase = "1.18.2"
3435
DAQP = "0.6, 0.7.1"
3536
DifferentiationInterface = "0.7.11"
@@ -59,6 +60,7 @@ TestItems = "1"
5960
julia = "1.10"
6061

6162
[extras]
63+
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
6264
DAQP = "c47d62df-3981-49c8-9651-128b1cd08617"
6365
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
6466
FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41"
@@ -69,4 +71,4 @@ TestItemRunner = "f8b46487-2199-4994-9208-9a1283c18c0a"
6971
TestItems = "1c621080-faea-4a02-84b6-bbd5e436b8fe"
7072

7173
[targets]
72-
test = ["Test", "TestItems", "TestItemRunner", "Documenter", "Plots", "DAQP", "FiniteDiff", "LinearMPC"]
74+
test = ["Test", "TestItems", "TestItemRunner", "Documenter", "Plots", "DAQP", "FiniteDiff", "LinearMPC", "Aqua"]

test/7_test_aqua.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
@testitem "Aqua" begin
2+
using Aqua
3+
# All the functions defined inside `ModelPredictiveControl.get_nonlinobj_op` with the
4+
# `Vararg`s have unbound type parameters. This is necessary for the splatting syntax of
5+
# `JuMP.@operator`, and JuMP will never call these functions with 0 argument, so
6+
# defining zero-argument methods would be useless, so I disable this check here.
7+
unbound_args = false
8+
Aqua.test_all(ModelPredictiveControl, unbound_args)
9+
end

test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ include("3_test_predictive_control.jl")
1010
include("4_test_plot_sim.jl")
1111
include("5_test_extensions.jl")
1212
include("6_test_doctest.jl")
13+
include("7_test_aqua.jl")
1314

1415
nothing

0 commit comments

Comments
 (0)