diff --git a/test/Project.toml b/test/Project.toml index 263d24f..9d5d3ee 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -16,6 +16,7 @@ NLopt = "76087f3c-5699-56af-9a33-bf431cd00edd" ONNX = "d0dd6a25-fac6-55c0-abf7-829e0c774d20" Optimisers = "3bd65402-5787-11e9-1adc-39752487f4e2" OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" +ParallelTestRunner = "d3525ed8-44d0-4b2c-a655-542cee43accc" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" Revise = "295af30f-e4ad-537b-8983-00126c2a3abe" SolverCore = "ff4d7338-4cf1-434d-91df-b86cb86fb843" @@ -30,3 +31,4 @@ NLopt = {rev = "bl/diff_backend", url = "https://github.com/jump-dev/NLopt.jl/"} [compat] NLPModels = "0.21.12" +ParallelTestRunner = "2.1" diff --git a/test/runtests.jl b/test/runtests.jl index 5cc99fa..1199b0a 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,15 +1,22 @@ -include("ReverseAD.jl") -include("ArrayDiff.jl") -include("JuMP.jl") -include("MathOptAI.jl") -include("ONNXExt.jl") -if VERSION >= v"1.11" - # [sources] not supported on Julia v1.10 - # Needs https://github.com/jump-dev/NLopt.jl/pull/273 - include("NLopt.jl") - # Needs https://github.com/JuliaSmoothOptimizers/NLPModelsJuMP.jl/pull/229 - include("NLPModelsJuMP.jl") - include("Optimisers.jl") - #include("Optimisers_GPU.jl") +import ArrayDiff +import ParallelTestRunner + +is_test_file(f) = startswith(f, "test_") && endswith(f, ".jl") + +testsuite = Dict{String,Expr}() +for file in filter(is_test_file, readdir(@__DIR__)) + name = file[1:(end-3)] + if VERSION < v"1.11" && name in ( + # [sources] not supported on Julia v1.10 + # Needs https://github.com/jump-dev/NLopt.jl/pull/273 + "test_NLopt", + # Needs https://github.com/JuliaSmoothOptimizers/NLPModelsJuMP.jl/pull/229 + "test_NLPModelsJuMP", + "test_Optimisers", + ) + continue + end + testsuite[name] = :(include($(joinpath(@__DIR__, file)))) end -#include("eval_residual_gpu.jl") + +ParallelTestRunner.runtests(ArrayDiff, ARGS; testsuite) diff --git a/test/ArrayDiff.jl b/test/test_ArrayDiff.jl similarity index 100% rename from test/ArrayDiff.jl rename to test/test_ArrayDiff.jl diff --git a/test/JuMP.jl b/test/test_JuMP.jl similarity index 100% rename from test/JuMP.jl rename to test/test_JuMP.jl diff --git a/test/MathOptAI.jl b/test/test_MathOptAI.jl similarity index 100% rename from test/MathOptAI.jl rename to test/test_MathOptAI.jl diff --git a/test/NLPModelsJuMP.jl b/test/test_NLPModelsJuMP.jl similarity index 100% rename from test/NLPModelsJuMP.jl rename to test/test_NLPModelsJuMP.jl diff --git a/test/NLopt.jl b/test/test_NLopt.jl similarity index 100% rename from test/NLopt.jl rename to test/test_NLopt.jl diff --git a/test/ONNXExt.jl b/test/test_ONNXExt.jl similarity index 100% rename from test/ONNXExt.jl rename to test/test_ONNXExt.jl diff --git a/test/Optimisers.jl b/test/test_Optimisers.jl similarity index 100% rename from test/Optimisers.jl rename to test/test_Optimisers.jl diff --git a/test/ReverseAD.jl b/test/test_ReverseAD.jl similarity index 100% rename from test/ReverseAD.jl rename to test/test_ReverseAD.jl