From a07cdc9888cc9beb145404db08e979f5ac150904 Mon Sep 17 00:00:00 2001 From: Jishnu Bhattacharya Date: Sun, 30 Nov 2025 13:47:40 +0530 Subject: [PATCH 1/4] Run tests in parallel using ParallelTestRunner --- Project.toml | 7 +++- test/aqua.jl | 4 +++ test/helpers.jl | 33 +++++++++++++++++ test/runtests.jl | 93 ++++++++++++------------------------------------ 4 files changed, 66 insertions(+), 71 deletions(-) create mode 100644 test/aqua.jl create mode 100644 test/helpers.jl diff --git a/Project.toml b/Project.toml index 253a2e1..8cfac07 100644 --- a/Project.toml +++ b/Project.toml @@ -25,6 +25,9 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" Polynomials = "f27b6e38-b328-58d1-80ce-0feddd5e7a45" Static = "aedffcd0-7271-4cad-89d0-dc628f76c6d3" +[sources] +ApproxFunBase = {path = "../ApproxFunBase.jl"} + [extensions] ApproxFunOrthogonalPolynomialsPolynomialsExt = "Polynomials" ApproxFunOrthogonalPolynomialsStaticExt = "Static" @@ -45,6 +48,7 @@ IntervalSets = "0.5, 0.6, 0.7" LazyArrays = "0.22, 1, 2" LinearAlgebra = "1" OddEvenIntegers = "0.1.8" +ParallelTestRunner = "2" Polynomials = "2, 3, 4" Reexport = "0.2, 1" SpecialFunctions = "0.10, 1.0, 2" @@ -57,10 +61,11 @@ julia = "1.6" Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" DualNumbers = "fa6b7ba4-c1ee-5f82-b5fc-ecf0adba8f74" LazyArrays = "5078a376-72f3-5289-bfd5-ec5146d43c02" +ParallelTestRunner = "d3525ed8-44d0-4b2c-a655-542cee43accc" Polynomials = "f27b6e38-b328-58d1-80ce-0feddd5e7a45" Static = "aedffcd0-7271-4cad-89d0-dc628f76c6d3" StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["Aqua", "DualNumbers", "Test", "Static", "StaticArrays", "LazyArrays", "Polynomials"] +test = ["Aqua", "DualNumbers", "ParallelTestRunner", "Test", "Static", "StaticArrays", "LazyArrays", "Polynomials"] diff --git a/test/aqua.jl b/test/aqua.jl new file mode 100644 index 0000000..5dfc906 --- /dev/null +++ b/test/aqua.jl @@ -0,0 +1,4 @@ +using Aqua +@testset "Project quality" begin + Aqua.test_all(ApproxFunOrthogonalPolynomials, ambiguities=false, piracies = false) +end \ No newline at end of file diff --git a/test/helpers.jl b/test/helpers.jl new file mode 100644 index 0000000..dd2fe17 --- /dev/null +++ b/test/helpers.jl @@ -0,0 +1,33 @@ +@testset "Domain" begin + @test reverseorientation(Arc(1,2,(0.1,0.2))) == Arc(1,2,(0.2,0.1)) +end + +@testset "helpers" begin + for f in [isequalminhalf, isapproxminhalf] + @test f(-0.5) + @test f(static(-0.5)) + @test f(half(Odd(-1))) + @test !f(-0.2) + @test !f(half(Odd(1))) + @test !f(1) + @test !f(static(1)) + end + @test !isequalhalf(-0.5) + @test !isequalhalf(static(-0.5)) + @test !isequalhalf(half(Odd(-1))) + @test !isequalhalf(-0.2) + @test isequalhalf(0.5) + @test isequalhalf(static(0.5)) + @test isequalhalf(half(Odd(1))) + @test !isequalhalf(1) + @test !isequalhalf(static(1)) + + @test isapproxhalfoddinteger(0.5) + @test isapproxhalfoddinteger(static(0.5)) + @test isapproxhalfoddinteger(half(Odd(1))) + @test !isapproxhalfoddinteger(1) + @test !isapproxhalfoddinteger(static(1)) + + @test ApproxFunOrthogonalPolynomials._minonehalf(2) == -0.5 + @test ApproxFunOrthogonalPolynomials._onehalf(2) == 0.5 +end diff --git a/test/runtests.jl b/test/runtests.jl index 605adf4..d09fbc9 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,82 +1,35 @@ module ApproxFunOrthogonalPolynomials_Runtests using ApproxFunOrthogonalPolynomials -using ApproxFunOrthogonalPolynomials: isapproxminhalf, isequalminhalf, isequalhalf, isapproxhalfoddinteger -using LinearAlgebra -using Test -using Aqua -using Static -using HalfIntegers -using OddEvenIntegers - -@testset "Project quality" begin - Aqua.test_all(ApproxFunOrthogonalPolynomials, ambiguities=false, piracies = false) -end - -@testset "Domain" begin - @test reverseorientation(Arc(1,2,(0.1,0.2))) == Arc(1,2,(0.2,0.1)) +using ParallelTestRunner + +const init_code = quote + using ApproxFunOrthogonalPolynomials + using ApproxFunOrthogonalPolynomials: isapproxminhalf, isequalminhalf, isequalhalf, isapproxhalfoddinteger + using LinearAlgebra + using Test + using Static + using HalfIntegers + using OddEvenIntegers + using Test + include("testutils.jl") end -# missing import bug -@test ApproxFunOrthogonalPolynomials.Matrix === Base.Matrix +# Start with autodiscovered tests +testsuite = find_tests(pwd()) -include("testutils.jl") +# Parse arguments +args = parse_args(ARGS) -@testset "helpers" begin - for f in [isequalminhalf, isapproxminhalf] - @test f(-0.5) - @test f(static(-0.5)) - @test f(half(Odd(-1))) - @test !f(-0.2) - @test !f(half(Odd(1))) - @test !f(1) - @test !f(static(1)) +if filter_tests!(testsuite, args) + # There are weird non-deterministic `ReadOnlyMemoryError`s on Windows, + # so this test is disabled for now + delete!(testsuite, "testutils.jl") + if Sys.iswindows() + delete!(testsuite, "UltrasphericalTest.jl") end - @test !isequalhalf(-0.5) - @test !isequalhalf(static(-0.5)) - @test !isequalhalf(half(Odd(-1))) - @test !isequalhalf(-0.2) - @test isequalhalf(0.5) - @test isequalhalf(static(0.5)) - @test isequalhalf(half(Odd(1))) - @test !isequalhalf(1) - @test !isequalhalf(static(1)) - - @test isapproxhalfoddinteger(0.5) - @test isapproxhalfoddinteger(static(0.5)) - @test isapproxhalfoddinteger(half(Odd(1))) - @test !isapproxhalfoddinteger(1) - @test !isapproxhalfoddinteger(static(1)) - - @test ApproxFunOrthogonalPolynomials._minonehalf(2) == -0.5 - @test ApproxFunOrthogonalPolynomials._onehalf(2) == 0.5 -end - -include("ClenshawTest.jl"); GC.gc() -include("MiscAFBTest.jl"); GC.gc() -include("ChebyshevTest.jl"); GC.gc() -# There are weird non-deterministic `ReadOnlyMemoryError`s on Windows, -# so this test is disabled for now -if !Sys.iswindows() - include("UltrasphericalTest.jl"); GC.gc() end -include("JacobiTest.jl"); GC.gc() -include("LaguerreTest.jl"); GC.gc() -include("HermiteTest.jl"); GC.gc() -include("SpacesTest.jl"); GC.gc() -include("ComplexTest.jl"); GC.gc() -include("broadcastingtest.jl"); GC.gc() -include("OperatorTest.jl"); GC.gc() -include("ODETest.jl"); GC.gc() -include("EigTest.jl"); GC.gc() -include("VectorTest.jl"); GC.gc() -include("MultivariateTest.jl"); GC.gc() -include("PDETest.jl"); GC.gc() -include("SpeedTest.jl"); GC.gc() -include("SpeedODETest.jl"); GC.gc() -include("SpeedPDETest.jl"); GC.gc() -include("SpeedOperatorTest.jl"); GC.gc() -include("showtest.jl"); GC.gc() +runtests(ApproxFunOrthogonalPolynomials, args; init_code, testsuite) end # module From 43b7e5dad6bc999d0eed6f97002a7359c611f8df Mon Sep 17 00:00:00 2001 From: Jishnu Bhattacharya Date: Sun, 30 Nov 2025 13:50:45 +0530 Subject: [PATCH 2/4] Remove local sources --- Project.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/Project.toml b/Project.toml index 8cfac07..876e6f1 100644 --- a/Project.toml +++ b/Project.toml @@ -25,9 +25,6 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" Polynomials = "f27b6e38-b328-58d1-80ce-0feddd5e7a45" Static = "aedffcd0-7271-4cad-89d0-dc628f76c6d3" -[sources] -ApproxFunBase = {path = "../ApproxFunBase.jl"} - [extensions] ApproxFunOrthogonalPolynomialsPolynomialsExt = "Polynomials" ApproxFunOrthogonalPolynomialsStaticExt = "Static" From 4f7bdeaa5bb48c878cbd7b4826402cc94d242436 Mon Sep 17 00:00:00 2001 From: Jishnu Bhattacharya Date: Sun, 30 Nov 2025 13:51:01 +0530 Subject: [PATCH 3/4] Remove local sources --- test/aqua.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/aqua.jl b/test/aqua.jl index 5dfc906..ab4f88d 100644 --- a/test/aqua.jl +++ b/test/aqua.jl @@ -1,4 +1,4 @@ using Aqua @testset "Project quality" begin Aqua.test_all(ApproxFunOrthogonalPolynomials, ambiguities=false, piracies = false) -end \ No newline at end of file +end From f4b1282f05f309971896b9dde279f2ecd5c3c082 Mon Sep 17 00:00:00 2001 From: Jishnu Bhattacharya Date: Sun, 30 Nov 2025 13:53:50 +0530 Subject: [PATCH 4/4] Rename files to uppercase names --- test/{aqua.jl => Aqua.jl} | 0 test/{helpers.jl => Helpers.jl} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename test/{aqua.jl => Aqua.jl} (100%) rename test/{helpers.jl => Helpers.jl} (100%) diff --git a/test/aqua.jl b/test/Aqua.jl similarity index 100% rename from test/aqua.jl rename to test/Aqua.jl diff --git a/test/helpers.jl b/test/Helpers.jl similarity index 100% rename from test/helpers.jl rename to test/Helpers.jl