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
4 changes: 3 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,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"
Expand All @@ -57,10 +58,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"]
4 changes: 4 additions & 0 deletions test/Aqua.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
using Aqua
@testset "Project quality" begin
Aqua.test_all(ApproxFunOrthogonalPolynomials, ambiguities=false, piracies = false)
end
33 changes: 33 additions & 0 deletions test/Helpers.jl
Original file line number Diff line number Diff line change
@@ -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
93 changes: 23 additions & 70 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -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
Loading