From 625f98018b87e8c35639978efd4f2025f91525b5 Mon Sep 17 00:00:00 2001 From: Jishnu Bhattacharya Date: Mon, 1 Dec 2025 18:42:31 +0530 Subject: [PATCH] Run tests in parallel --- Project.toml | 4 +++- test/runtests.jl | 41 +++++++++++++++-------------------------- test/test_aqua.jl | 11 +++++++++++ test/test_docstrings.jl | 14 ++++++++++++++ 4 files changed, 43 insertions(+), 27 deletions(-) create mode 100644 test/test_aqua.jl create mode 100644 test/test_docstrings.jl diff --git a/Project.toml b/Project.toml index d3dc1960..4e2e94b0 100644 --- a/Project.toml +++ b/Project.toml @@ -25,6 +25,7 @@ FillArrays = "1.3" GenericLinearAlgebra = "0.3" InfiniteArrays = "0.12, 0.13, 0.14" LinearAlgebra = "1" +ParallelTestRunner = "2" PrecompileTools = "1" Quaternions = "0.7" Random = "1" @@ -38,10 +39,11 @@ CliqueTrees = "60701a23-6482-424a-84db-faee86b9b1f8" Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" GenericLinearAlgebra = "14197337-ba66-59df-a3e3-ca00e7dcff7a" InfiniteArrays = "4858937d-0d70-526a-a4dd-2d5cb5dd786c" +ParallelTestRunner = "d3525ed8-44d0-4b2c-a655-542cee43accc" Quaternions = "94ee1d12-ae83-5a48-8b1c-48b8ff168ae0" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["Aqua", "CliqueTrees", "Documenter", "GenericLinearAlgebra", "InfiniteArrays", "Random", "SparseArrays", "Test", "Quaternions"] +test = ["Aqua", "CliqueTrees", "Documenter", "GenericLinearAlgebra", "InfiniteArrays", "ParallelTestRunner", "Random", "SparseArrays", "Test", "Quaternions"] diff --git a/test/runtests.jl b/test/runtests.jl index 0e265836..dafca81b 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,32 +1,21 @@ using BandedMatrices -using Test +using ParallelTestRunner -import Aqua -downstream_test = "--downstream_integration_test" in ARGS -@testset "Project quality" begin - Aqua.test_all(BandedMatrices, ambiguities=false, piracies=false, - stale_deps=!downstream_test) +# Start with autodiscovered tests +testsuite = find_tests(pwd()) + +if "--downstream_integration_test" in ARGS + delete!(testsuite, "test_aqua") end -using Documenter -if v"1.10" <= VERSION < v"1.11.0-" - DocMeta.setdocmeta!(BandedMatrices, :DocTestSetup, :(using BandedMatrices)) - @testset "doctests" begin - doctest(BandedMatrices) - end +filtered_args = filter(!=("--downstream_integration_test"), ARGS) +# Parse arguments +args = parse_args(filtered_args) + +if filter_tests!(testsuite, args) + delete!(testsuite, "benchmark") + delete!(testsuite, "evaluations") + delete!(testsuite, "mymatrix") end -include("test_banded.jl") -include("test_subarray.jl") -include("test_linalg.jl") -include("test_dot.jl") -include("test_broadcasting.jl") -include("test_indexing.jl") -include("test_bandedlu.jl") -include("test_bandedqr.jl") -include("test_symbanded.jl") -include("test_tribanded.jl") -include("test_interface.jl") -include("test_miscs.jl") -include("test_sum.jl") -include("test_cat.jl") +runtests(BandedMatrices, args; testsuite) diff --git a/test/test_aqua.jl b/test/test_aqua.jl new file mode 100644 index 00000000..2869fb46 --- /dev/null +++ b/test/test_aqua.jl @@ -0,0 +1,11 @@ +module AquaTest + +import BandedMatrices +import Aqua +using Test + +@testset "Project quality" begin + Aqua.test_all(BandedMatrices, ambiguities=false, piracies=false) +end + +end diff --git a/test/test_docstrings.jl b/test/test_docstrings.jl new file mode 100644 index 00000000..e4a5fdb3 --- /dev/null +++ b/test/test_docstrings.jl @@ -0,0 +1,14 @@ +module DocstringTests + +import BandedMatrices +using Documenter +using Test + +if v"1.10" <= VERSION < v"1.11.0-" + DocMeta.setdocmeta!(BandedMatrices, :DocTestSetup, :(using BandedMatrices)) + @testset "doctests" begin + doctest(BandedMatrices) + end +end + +end