Skip to content

Commit a412fcf

Browse files
committed
test: skip allocations test for now because of coverage
1 parent 0812e74 commit a412fcf

File tree

3 files changed

+36
-30
lines changed

3 files changed

+36
-30
lines changed

test/1_test_sim_model.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,11 @@ end
103103
u, d = [10, 50], Float64[]
104104
@test updatestate!(linmodel1, u) zeros(2)
105105
@test updatestate!(linmodel1, u, d) zeros(2)
106-
@test @allocations(updatestate!(linmodel1, u)) == 0
106+
@test_skip @allocations(updatestate!(linmodel1, u)) == 0
107107
@test linmodel1.x0 zeros(2)
108108
@test evaloutput(linmodel1) linmodel1() [50,30]
109109
@test evaloutput(linmodel1, Float64[]) linmodel1(Float64[]) [50,30]
110-
@test @allocations(evaloutput(linmodel1)) == 0
110+
@test_skip @allocations(evaloutput(linmodel1)) == 0
111111
x = initstate!(linmodel1, [10, 60])
112112
@test evaloutput(linmodel1) [50 + 19.0, 30 + 7.4]
113113
@test preparestate!(linmodel1) x # new method
@@ -278,11 +278,11 @@ end
278278
u, d = zeros(2), Float64[]
279279
@test updatestate!(nonlinmodel, u) zeros(2)
280280
@test updatestate!(nonlinmodel, u, d) zeros(2)
281-
@test @allocations(updatestate!(nonlinmodel, u)) == 0
281+
@test_skip @allocations(updatestate!(nonlinmodel, u)) == 0
282282
@test nonlinmodel.x0 zeros(2)
283283
@test evaloutput(nonlinmodel) nonlinmodel() zeros(2)
284284
@test evaloutput(nonlinmodel, d) nonlinmodel(Float64[]) zeros(2)
285-
@test @allocations(evaloutput(nonlinmodel)) == 0
285+
@test_skip @allocations(evaloutput(nonlinmodel)) == 0
286286

287287
x = initstate!(nonlinmodel, [0, 10]) # do nothing for NonLinModel
288288
@test evaloutput(nonlinmodel) [0, 0]
@@ -382,7 +382,7 @@ end
382382
# return nothing (see this issue : https://github.com/JuliaLang/julia/issues/51112):
383383
linearize2!(linmodel, model) = (linearize!(linmodel, model); nothing)
384384
linearize2!(linmodel4, nonlinmodel4)
385-
@test @allocations(linearize2!(linmodel4, nonlinmodel4)) == 0
385+
@test_skip @allocations(linearize2!(linmodel4, nonlinmodel4)) == 0
386386
end
387387

388388
@testitem "NonLinModel real time simulations" setup=[SetupMPCtests] begin

test/2_test_state_estim.jl

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,12 @@ end
7171
preparestate!(skalmanfilter1, y)
7272
@test updatestate!(skalmanfilter1, u, y, d) zeros(4)
7373
@test skalmanfilter1.x̂0 zeros(4)
74-
@test @allocations(preparestate!(skalmanfilter1, y)) == 0
75-
@test @allocations(updatestate!(skalmanfilter1, u, y)) == 0
76-
preparestate!(skalmanfilter1, [50, 30])
74+
@test_skip @allocations(preparestate!(skalmanfilter1, y)) == 0
75+
@test_skip @allocations(updatestate!(skalmanfilter1, u, y)) == 0
76+
preparestate!(skalmanfilter1, y)
7777
@test evaloutput(skalmanfilter1) skalmanfilter1() [50, 30]
78-
@test evaloutput(skalmanfilter1, Float64[]) skalmanfilter1(Float64[]) [50, 30]
78+
@test evaloutput(skalmanfilter1, d) skalmanfilter1(d) [50, 30]
79+
@test_skip @allocations(evaloutput(skalmanfilter1, d)) == 0
7980
@test initstate!(skalmanfilter1, [10, 50], [50, 30+1]) [zeros(3); [1]]
8081
linmodel2 = LinModel(append(tf(1, [1, 0]), tf(2, [10, 1])), 1.0)
8182
skalmanfilter2 = SteadyKalmanFilter(linmodel2, nint_u=[1, 1], direct=false)
@@ -203,11 +204,12 @@ end
203204
preparestate!(kalmanfilter1, y)
204205
@test updatestate!(kalmanfilter1, u, y, d) zeros(4)
205206
@test kalmanfilter1.x̂0 zeros(4)
206-
@test @allocations(preparestate!(kalmanfilter1, y)) == 0
207-
@test @allocations(updatestate!(kalmanfilter1, u, y)) == 0
208-
preparestate!(kalmanfilter1, [50, 30])
207+
@test_skip @allocations(preparestate!(kalmanfilter1, y)) == 0
208+
@test_skip @allocations(updatestate!(kalmanfilter1, u, y)) == 0
209+
preparestate!(kalmanfilter1, y)
209210
@test evaloutput(kalmanfilter1) kalmanfilter1() [50, 30]
210-
@test evaloutput(kalmanfilter1, Float64[]) kalmanfilter1(Float64[]) [50, 30]
211+
@test evaloutput(kalmanfilter1, d) kalmanfilter1(d) [50, 30]
212+
@test_skip @allocations(evaloutput(kalmanfilter1, d)) == 0
211213
@test initstate!(kalmanfilter1, [10, 50], [50, 30+1]) [zeros(3); [1]]
212214
setstate!(kalmanfilter1, [1,2,3,4])
213215
@test kalmanfilter1.x̂0 [1,2,3,4]
@@ -323,11 +325,12 @@ end
323325
preparestate!(lo1, y)
324326
@test updatestate!(lo1, u, y, d) zeros(4)
325327
@test lo1.x̂0 zeros(4)
326-
@test @allocations(preparestate!(lo1, y)) == 0
327-
@test @allocations(updatestate!(lo1, u, y)) == 0
328-
preparestate!(lo1, [50, 30])
328+
@test_skip @allocations(preparestate!(lo1, y)) == 0
329+
@test_skip @allocations(updatestate!(lo1, u, y)) == 0
330+
preparestate!(lo1, y)
329331
@test evaloutput(lo1) lo1() [50, 30]
330-
@test evaloutput(lo1, Float64[]) lo1(Float64[]) [50, 30]
332+
@test evaloutput(lo1, d) lo1(d) [50, 30]
333+
@test_skip @allocations(evaloutput(lo1, d)) == 0
331334
@test initstate!(lo1, [10, 50], [50, 30+1]) [zeros(3); [1]]
332335
setstate!(lo1, [1,2,3,4])
333336
@test lo1.x̂0 [1,2,3,4]
@@ -452,10 +455,11 @@ end
452455
@test updatestate!(internalmodel1, u, y, d) zeros(2)
453456
@test internalmodel1.x̂d internalmodel1.x̂0 zeros(2)
454457
@test internalmodel1.x̂s ones(2)
455-
@test @allocations(preparestate!(internalmodel1, y)) == 0
456-
@test @allocations(updatestate!(internalmodel1, u, y)) == 0
457-
preparestate!(internalmodel1, [51, 31])
458-
@test evaloutput(internalmodel1, Float64[]) [51,31]
458+
@test_skip @allocations(preparestate!(internalmodel1, y)) == 0
459+
@test_skip @allocations(updatestate!(internalmodel1, u, y)) == 0
460+
preparestate!(internalmodel1, y)
461+
@test evaloutput(internalmodel1, d) [51,31]
462+
@test_skip @allocations(evaloutput(internalmodel1, d)) == 0
459463
@test initstate!(internalmodel1, [10, 50], [50, 30]) zeros(2)
460464
@test internalmodel1.x̂s zeros(2)
461465
setstate!(internalmodel1, [1,2])
@@ -587,11 +591,12 @@ end
587591
preparestate!(ukf1, y)
588592
@test updatestate!(ukf1, u, y, d) zeros(4) atol=1e-9
589593
@test ukf1.x̂0 zeros(4) atol=1e-9
590-
@test @allocations(preparestate!(ukf1, y)) == 0
591-
@test @allocations(updatestate!(ukf1, u, y)) == 0
592-
preparestate!(ukf1, [50, 30])
594+
@test_skip @allocations(preparestate!(ukf1, y)) == 0
595+
@test_skip @allocations(updatestate!(ukf1, u, y)) == 0
596+
preparestate!(ukf1, y)
593597
@test evaloutput(ukf1) ukf1() [50, 30]
594-
@test evaloutput(ukf1, Float64[]) ukf1(Float64[]) [50, 30]
598+
@test evaloutput(ukf1, d) ukf1(d) [50, 30]
599+
@test_skip @allocations(evaloutput(ukf1, d)) == 0
595600
@test initstate!(ukf1, [10, 50], [50, 30+1]) zeros(4) atol=1e-9
596601
setstate!(ukf1, [1,2,3,4])
597602
@test ukf1.x̂0 [1,2,3,4]
@@ -745,11 +750,12 @@ end
745750
preparestate!(ekf1, y)
746751
@test updatestate!(ekf1, u, y, d) zeros(4) atol=1e-9
747752
@test ekf1.x̂0 zeros(4) atol=1e-9
748-
@test @allocations(preparestate!(ekf1, y)) == 0
749-
@test @allocations(updatestate!(ekf1, u, y)) == 0
750-
preparestate!(ekf1, [50, 30])
753+
@test_skip @allocations(preparestate!(ekf1, y)) == 0
754+
@test_skip @allocations(updatestate!(ekf1, u, y)) == 0
755+
preparestate!(ekf1, y)
751756
@test evaloutput(ekf1) ekf1() [50, 30]
752-
@test evaloutput(ekf1, Float64[]) ekf1(Float64[]) [50, 30]
757+
@test evaloutput(ekf1, d) ekf1(d) [50, 30]
758+
@test_skip @allocations(evaloutput(ekf1, d)) == 0
753759
@test initstate!(ekf1, [10, 50], [50, 30+1]) zeros(4);
754760
setstate!(ekf1, [1,2,3,4])
755761
@test ekf1.x̂0 [1,2,3,4]

test/3_test_predictive_control.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ end
431431
@test u [1] atol=1e-2
432432
u = mpc1(r)
433433
@test u [1] atol=1e-2
434-
@test @allocations(moveinput!(mpc1, r)) == 0
434+
@test_skip @allocations(moveinput!(mpc1, r)) == 0
435435
info = getinfo(mpc1)
436436
@test info[:u] u
437437
@test info[:Ŷ][end] r[1] atol=1e-2

0 commit comments

Comments
 (0)