Skip to content

Commit 1ac9be2

Browse files
committed
Improved tests
1 parent e1c8b89 commit 1ac9be2

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

Project.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ version = "1.0.0-DEV"
55

66
[deps]
77
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
8-
ControlPlots = "23c2ee80-7a9e-4350-b264-8e670f12517c"
98
KiteUtils = "90980105-b163-44e5-ba9f-8b1c83bb0533"
109
NLsolve = "2774e3e8-f4cf-5e23-947b-6d7e65073b56"
1110
Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
11+
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
1212
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
1313
StructTypes = "856f2bd8-1eba-4b0a-8007-ebc267875bd4"
1414
Timers = "21f18d07-b854-4dab-86f0-c15a3821819a"
@@ -20,6 +20,7 @@ ControlPlots = "0.2.7"
2020
KiteUtils = "0.10.6"
2121
NLsolve = "4.5.1"
2222
Parameters = "0.12.3"
23+
Pkg = "1.11.0"
2324
StaticArrays = "1.9.13"
2425
StructTypes = "1.11.0"
2526
Timers = "0.1.5"
@@ -28,6 +29,7 @@ julia = "1.6.7"
2829

2930
[extras]
3031
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
32+
ControlPlots = "23c2ee80-7a9e-4350-b264-8e670f12517c"
3133

3234
[targets]
33-
test = ["Test"]
35+
test = ["Test", "ControlPlots"]

test/runtests.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
using WinchControllers
22
using Test
33

4-
# @testset "WinchControllers.jl" begin
5-
# # Write your tests here.
6-
# end
7-
include("test_utils.jl")
4+
const __TEST__ = true
5+
6+
@testset "WinchControllers.jl" begin
7+
include("test_winchcontroller.jl")
8+
end

test/test_winchcontroller.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using Pkg
33
if ! ("ControlPlots" keys(Pkg.project().dependencies))
44
using TestEnv; TestEnv.activate()
5+
using Test
56
end
67
using Timers; tic()
78

@@ -88,7 +89,11 @@ p2=plotx(TIME, F_ERR*0.001, V_ERR;
8889
p3=plotx(TIME, FORCE*0.001, STATE;
8990
ylabels=["force [kN]","state"],
9091
fig="test_winchcontroller_c")
91-
display(p1); display(p2); display(p3)
92+
if @isdefined __TEST__
93+
@test mean(FORCE) 1791.0028035171347 rtol=1e-4
94+
else
95+
display(p1); display(p2); display(p3)
96+
end
9297
toc()
9398

9499
println("Max iterations needed: $(wcs.iter)")

0 commit comments

Comments
 (0)