Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@ ModelingToolkit = "8, 9, 10, 11"
ParameterizedFunctions = "5"
PrecompileTools = "1"
Reexport = "0.2, 1.0"
SafeTestsets = "0.1, 1"
SciMLTesting = "1"
Test = "<0.0.1, 1"
julia = "1.10"

[extras]
ParameterizedFunctions = "65888b18-ceab-5e60-b2b9-181511a3b968"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
SciMLTesting = "09d9d899-5365-40a9-917a-5f67fddea283"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test", "ParameterizedFunctions", "Pkg"]
test = ["Test", "ParameterizedFunctions", "SafeTestsets", "SciMLTesting"]
1 change: 1 addition & 0 deletions test/interface_tests.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Interface compatibility tests for MATLABDiffEq.jl
# These tests verify type checking and interface compliance

using MATLABDiffEq
using Test

@testset "Interface Compatibility" begin
Expand Down
37 changes: 37 additions & 0 deletions test/matlab_runtime_tests.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# These tests require MATLAB runtime to be available.
# They test the actual ODE solving functionality.
using DiffEqBase, MATLABDiffEq, ParameterizedFunctions

f = @ode_def_bare LotkaVolterra begin
dx = a * x - b * x * y
dy = -c * y + d * x * y
end a b c d
p = [1.5, 1, 3, 1]
tspan = (0.0, 10.0)
u0 = [1.0, 1.0]
prob = ODEProblem(f, u0, tspan, p)
sol = solve(prob, MATLABDiffEq.ode45())

function lorenz(du, u, p, t)
du[1] = 10.0(u[2] - u[1])
du[2] = u[1] * (28.0 - u[3]) - u[2]
return du[3] = u[1] * u[2] - (8 / 3) * u[3]
end
u0 = [1.0; 0.0; 0.0]
tspan = (0.0, 100.0)
prob = ODEProblem(lorenz, u0, tspan)
sol = solve(prob, MATLABDiffEq.ode45())

algs = [
MATLABDiffEq.ode23
MATLABDiffEq.ode45
MATLABDiffEq.ode113
MATLABDiffEq.ode23s
MATLABDiffEq.ode23t
MATLABDiffEq.ode23tb
MATLABDiffEq.ode15s
]

for alg in algs
sol = solve(prob, alg())
end
4 changes: 4 additions & 0 deletions test/qa/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
MATLABDiffEq = "e2752cbe-bcf4-5895-8727-84ebc14a76bd"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
SciMLTesting = "09d9d899-5365-40a9-917a-5f67fddea283"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[sources]
Expand All @@ -10,5 +12,7 @@ MATLABDiffEq = {path = "../.."}
[compat]
Aqua = "0.8"
JET = "0.9, 0.10, 0.11"
SafeTestsets = "0.1, 1"
SciMLTesting = "1"
Test = "<0.0.1, 1"
julia = "1.10"
9 changes: 5 additions & 4 deletions test/qa/qa.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
using MATLABDiffEq, Aqua, JET
using Test
using SafeTestsets

@testset "Aqua" begin
@safetestset "Aqua" begin
using MATLABDiffEq, Aqua
Aqua.test_all(MATLABDiffEq)
end

@testset "JET static analysis" begin
@safetestset "JET static analysis" begin
using MATLABDiffEq, JET, Test
rep = JET.report_package(MATLABDiffEq; target_modules = (MATLABDiffEq,))
@test length(JET.get_reports(rep)) == 0
end
66 changes: 2 additions & 64 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,64 +1,2 @@
using Pkg
using Test
using DiffEqBase, MATLABDiffEq, ParameterizedFunctions

const GROUP = get(ENV, "GROUP", "Core")

# QA (Aqua + JET) runs in an isolated environment (test/qa) so its tooling deps
# never enter the main test target's resolve. On Julia < 1.11 the [sources] table
# is ignored, so develop the package by path to test the PR branch code.
function activate_qa_env()
Pkg.activate(joinpath(@__DIR__, "qa"))
Pkg.develop(PackageSpec(path = dirname(@__DIR__)))
return Pkg.instantiate()
end

if GROUP == "Core" || GROUP == "All"
# Interface tests - these test type validation without needing MATLAB runtime
include("interface_tests.jl")

# Static type-stability tests - these also run without MATLAB
include("jet_tests.jl")

# The following tests require MATLAB runtime to be available
# They test the actual ODE solving functionality

f = @ode_def_bare LotkaVolterra begin
dx = a * x - b * x * y
dy = -c * y + d * x * y
end a b c d
p = [1.5, 1, 3, 1]
tspan = (0.0, 10.0)
u0 = [1.0, 1.0]
prob = ODEProblem(f, u0, tspan, p)
sol = solve(prob, MATLABDiffEq.ode45())

function lorenz(du, u, p, t)
du[1] = 10.0(u[2] - u[1])
du[2] = u[1] * (28.0 - u[3]) - u[2]
return du[3] = u[1] * u[2] - (8 / 3) * u[3]
end
u0 = [1.0; 0.0; 0.0]
tspan = (0.0, 100.0)
prob = ODEProblem(lorenz, u0, tspan)
sol = solve(prob, MATLABDiffEq.ode45())

algs = [
MATLABDiffEq.ode23
MATLABDiffEq.ode45
MATLABDiffEq.ode113
MATLABDiffEq.ode23s
MATLABDiffEq.ode23t
MATLABDiffEq.ode23tb
MATLABDiffEq.ode15s
]

for alg in algs
sol = solve(prob, alg())
end
end

if GROUP == "QA"
activate_qa_env()
include("qa/qa.jl")
end
using SciMLTesting
run_tests()
Loading