Skip to content

Commit d41a39e

Browse files
committed
Fix tests for windows
1 parent c661a83 commit d41a39e

3 files changed

Lines changed: 14 additions & 48 deletions

File tree

test/runtests.jl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,9 @@ end::Bool
1818

1919
cd("..")
2020
println("Running tests...")
21+
2122
@testset verbose = true "Testing VortexStepMethod..." begin
2223

23-
body_path = joinpath(tempdir(), "ram_air_kite_body.obj")
24-
foil_path = joinpath(tempdir(), "ram_air_kite_foil.dat")
25-
cp("data/ram_air_kite_body.obj", body_path; force=true)
26-
cp("data/ram_air_kite_foil.dat", foil_path; force=true)
27-
ram_wing = RamAirWing(body_path, foil_path; alpha_range=deg2rad.(-1:1), delta_range=deg2rad.(-1:1))
2824

2925
if build_is_production_build
3026
include("bench.jl")

test/test_plotting.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@ using VortexStepMethod
22
using ControlPlots
33
using Test
44

5+
if !@isdefined ram_wing
6+
body_path = joinpath(tempdir(), "ram_air_kite_body.obj")
7+
foil_path = joinpath(tempdir(), "ram_air_kite_foil.dat")
8+
cp("data/ram_air_kite_body.obj", body_path; force=true)
9+
cp("data/ram_air_kite_foil.dat", foil_path; force=true)
10+
ram_wing = RamAirWing(body_path, foil_path; alpha_range=deg2rad.(-1:1), delta_range=deg2rad.(-1:1))
11+
end
12+
513
function create_body_aero()
614
# Step 1: Define wing parameters
715
n_panels = 20 # Number of panels

test/test_results.jl

Lines changed: 5 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -5,51 +5,13 @@ using Test
55
using Logging
66

77
if !@isdefined ram_wing
8-
cp("data/ram_air_kite_body.obj", "/tmp/ram_air_kite_body.obj"; force=true)
9-
cp("data/ram_air_kite_foil.dat", "/tmp/ram_air_kite_foil.dat"; force=true)
10-
ram_wing = RamAirWing("/tmp/ram_air_kite_body.obj", "/tmp/ram_air_kite_foil.dat"; alpha_range=deg2rad.(-1:1), delta_range=deg2rad.(-1:1))
8+
body_path = joinpath(tempdir(), "ram_air_kite_body.obj")
9+
foil_path = joinpath(tempdir(), "ram_air_kite_foil.dat")
10+
cp("data/ram_air_kite_body.obj", body_path; force=true)
11+
cp("data/ram_air_kite_foil.dat", foil_path; force=true)
12+
ram_wing = RamAirWing(body_path, foil_path; alpha_range=deg2rad.(-1:1), delta_range=deg2rad.(-1:1))
1113
end
1214

13-
# @testset "Nonlinear vs Linear" begin
14-
# va = [15.0, 0.0, 0.0]
15-
# theta = zeros(4)
16-
# delta = zeros(4)
17-
# omega = zeros(3)
18-
19-
# body_aero = BodyAerodynamics([ram_wing]; va)
20-
# solver = Solver(body_aero;
21-
# aerodynamic_model_type=VSM,
22-
# is_with_artificial_damping=false,
23-
# solver_type=NONLIN
24-
# )
25-
26-
# jac, lin_res = VortexStepMethod.linearize(
27-
# solver,
28-
# body_aero,
29-
# ram_wing,
30-
# [theta; va; omega; delta];
31-
# theta_idxs=1:4,
32-
# va_idxs=5:7,
33-
# omega_idxs=8:10,
34-
# delta_idxs=11:14,
35-
# moment_frac=0.1
36-
# )
37-
# nonlin_res = VortexStepMethod.solve!(solver, body_aero; log=true)
38-
# nonlin_res = [solver.sol.force; solver.sol.moment; solver.sol.group_moment_dist]
39-
40-
# @test nonlin_res ≈ lin_res
41-
42-
# dva = [0.01, 0.01, 0.01]
43-
# init!(body_aero; init_aero=false, va=va+dva)
44-
# nonlin_res = VortexStepMethod.solve!(solver, body_aero; log=true)
45-
# nonlin_res = [solver.sol.force; solver.sol.moment; solver.sol.group_moment_dist]
46-
# @test lin_res ≉ nonlin_res atol=1e-2
47-
# @test lin_res + jac * [zeros(4); dva; zeros(3); zeros(4)] ≈ nonlin_res atol=1e-2
48-
# # Test accuracy
49-
# @test norm(lin_res + jac * [zeros(4); dva; zeros(3); zeros(4)] - nonlin_res) /
50-
# norm(lin_res - nonlin_res) < 2e-3
51-
# end
52-
5315
@testset "Nonlinear vs Linear - Comprehensive Input Testing" begin
5416
# Initialize with base parameters
5517
va = [15.0, 0.0, 0.0]

0 commit comments

Comments
 (0)