Skip to content

Commit d98c2b2

Browse files
authored
Run tests in parallel (#960)
* Run tests in parallel * Newline * Fix testsuite deletion
1 parent 7c6cb5b commit d98c2b2

19 files changed

+255
-252
lines changed

Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ FFTW = "1"
4141
FastTransforms = "0.13, 0.14, 0.15, 0.16, 0.17"
4242
IntervalSets = "0.7.5"
4343
LinearAlgebra = "1"
44+
ParallelTestRunner = "2"
4445
Random = "1"
4546
RecipesBase = "1.0"
4647
Reexport = "1.0"
@@ -57,8 +58,9 @@ Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
5758
DualNumbers = "fa6b7ba4-c1ee-5f82-b5fc-ecf0adba8f74"
5859
FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
5960
IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953"
61+
ParallelTestRunner = "d3525ed8-44d0-4b2c-a655-542cee43accc"
6062
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
6163
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
6264

6365
[targets]
64-
test = ["Aqua", "BandedMatrices", "BlockBandedMatrices", "Documenter", "DualNumbers", "FFTW", "Random", "Test"]
66+
test = ["Aqua", "BandedMatrices", "BlockBandedMatrices", "Documenter", "DualNumbers", "FFTW", "ParallelTestRunner", "Random", "Test"]

test/AquaTest.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
using Aqua
2+
@testset "Project quality" begin
3+
Aqua.test_all(ApproxFun, ambiguities=false, undefined_exports=false,
4+
stale_deps=(; ignore=[:ApproxFunBaseTest]), piracies = false)
5+
end

test/BugInMultiplicationTest.jl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using Test
2+
using ApproxFun
3+
using ApproxFunBase
4+
5+
@testset "Bug in Multiplication" begin
6+
dom = Interval(0.001, 1) × PeriodicSegment(-pi, pi)
7+
@test blocklengths(Space(dom)) == 2:2:
8+
r,r2 = Fun((r,t) -> [r;r^2], dom)
9+
@test r(0.1,0.2) 0.1
10+
@test r2(0.1,0.2) 0.1^2
11+
sp = Space(dom)
12+
Dr = Derivative(sp, [1,0])
13+
@test blockbandwidths(Dr) == (-1,1)
14+
@test subblockbandwidths(Dr) == (1,3)
15+
= Derivative(sp, [0,1])
16+
Mr = Multiplication(Fun( (r, θ) -> r, sp ), sp)
17+
rDr = Mr * Dr
18+
testbandedblockbandedoperator(rDr)
19+
end

test/ChebyshevAndFourierTest.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
using Test
2+
using ApproxFun
3+
4+
@testset "Chebyshev and Fourier" begin
5+
@test norm(Fun(x->Fun(cos,Fourier(-π .. π),20)(x),20)-Fun(cos,20)) <100eps()
6+
@test norm(Fun(x->Fun(cos,Fourier(-π .. π))(x))-Fun(cos)) <100eps()
7+
@test norm(Fun(x->Fun(cos,Laurent)(x))-Fun(cos)) <100eps()
8+
end

test/ConversionTest.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
using Test
2+
using ApproxFun
3+
4+
@testset "Conversion" begin
5+
f=Fun(t->[cos(t) 0;sin(t) 1],-π..π)
6+
g=Fun(f,Space(PeriodicSegment(-π,π)))
7+
@test g(.1) f(.1)
8+
end

test/DefiniteIntegralTest.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using Test
2+
using ApproxFun
3+
4+
@testset "definite integral" begin
5+
Σ = DefiniteIntegral()
6+
f1 = Fun(t->cos(cos(t)),-π..π)
7+
f = Fun(t->cos(cos(t)),Laurent(-π..π))
8+
@test sum(f1) Σ*f
9+
end

test/DocstringsTest.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
using Documenter
2+
DocMeta.setdocmeta!(ApproxFunBase, :DocTestSetup, :(using ApproxFun); recursive=true)
3+
DocMeta.setdocmeta!(ApproxFun, :DocTestSetup, :(using ApproxFun); recursive=true)
4+
5+
@testset "doctests" begin
6+
doctest(ApproxFun)
7+
doctest(ApproxFunBase, manual=false)
8+
end

test/ExtendingFunctionTest.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using Test
2+
using ApproxFun
3+
4+
@testset "Extending function" begin
5+
Γ = Segment(-im,1.0-im) Curve(Fun(x->exp(0.8im)*(x+x^2-1+im*(x-4x^3+x^4)/6))) Circle(2.0,0.2)
6+
@test isempty(component(Γ,1)\component(Γ,1))
7+
@test Γ \ component(Γ,1) == component(Γ,2) component(Γ,3)
8+
@test norm(Fun(ones(component(Γ,1)),Γ) - Fun(x->x component(Γ,1) ? 1.0 : 0.0,Γ)) == 0
9+
end

test/LaplaceInAStripTest.jl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using Test
2+
using ApproxFun
3+
4+
@testset "Laplace in a strip" begin
5+
d = PeriodicSegment() × ChebyshevInterval()
6+
g=Fun((x,y)->real(cos(x+im*y)),(d))
7+
@test g(0.1,1.0) real(cos(0.1+im))
8+
@test g(0.1,-1.0) real(cos(0.1-im))
9+
v=[g;0]
10+
@test v(0.1,-1) [real(cos(0.1-im));0]
11+
A=[Dirichlet(d);Laplacian(d)]
12+
a = space(v)
13+
b = rangespace(A)
14+
@test Fun(component(v[1],1), component(b[1],1))(0.1,-1.0) v(0.1,-1.0)[1]
15+
@test Fun(component(v[1],2), component(b[1],2))(0.1,1.0) v(0.1,1.0)[1]
16+
@test ApproxFun.default_Fun(v[1] , b[1])(0.1,1.0) v(0.1,1.0)[1]
17+
end

test/MixFourierChebyshevTest.jl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using Test
2+
using ApproxFun
3+
4+
@testset "Mix Fourier-Chebyshev (#602)" begin
5+
s = Chebyshev(-π..π)
6+
a = Fun(t-> 1+sin(cos(2t)), s)
7+
L = Derivative() + a
8+
f = Fun(t->exp(sin(10t)), s)
9+
B = periodic(s,0)
10+
@time uChebyshev = [B;L] \ [0.;f]
11+
s = Fourier(-π..π)
12+
a = Fun(t-> 1+sin(cos(2t)), s)
13+
L = Derivative() + a
14+
f = Fun(t->exp(sin(10t)), s)
15+
@time uFourier = L\f
16+
@test norm(uFourier-uChebyshev) 100eps()
17+
end

0 commit comments

Comments
 (0)