Skip to content

Commit 69e6f60

Browse files
committed
Integrate bench2.jl in runtests.jl
1 parent 0be12d5 commit 69e6f60

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

test/bench2.jl

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using LinearAlgebra
22
using VortexStepMethod
33
using BenchmarkTools
4+
using Test
45

56
using Pkg
67

@@ -42,11 +43,13 @@ set_va!(wa, vel_app)
4243
P = length(wa.panels)
4344
vsm_solver = Solver{P}(aerodynamic_model_type=VSM)
4445

45-
# Step 5: Solve using both methods
46-
println("Rectangular wing, solve_base!:")
47-
@btime solve_base!($vsm_solver, $wa, nothing) # 51 allocations
48-
# time Python: 32.0 ms Ryzen 7950x
49-
# time Julia: 0.45 ms Ryzen 7950x
50-
println("Rectangular wing, solve!:")
51-
@btime sol = solve!($vsm_solver, $wa, nothing) # 85 allocations
46+
@testset "Allocation Tests for solve() and solve!()" begin
47+
# Step 5: Solve using both methods
48+
result = @benchmark solve_base!($vsm_solver, $wa, nothing) # 51 allocations
49+
@test result.allocs <= 55
50+
# time Python: 32.0 ms Ryzen 7950x
51+
# time Julia: 0.45 ms Ryzen 7950x
52+
result = @benchmark sol = solve!($vsm_solver, $wa, nothing) # 85 allocations
53+
@test result.allocs <= 89
54+
end
5255
nothing

test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ println("Running tests...")
2121
@testset verbose = true "Testing VortexStepMethod..." begin
2222
if build_is_production_build
2323
include("bench.jl")
24+
include("bench2.jl")
2425
end
2526
include("test_bound_filament.jl")
2627
include("test_panel.jl")

0 commit comments

Comments
 (0)