Skip to content

Commit e6f6d91

Browse files
committed
Document test_wrappers
1 parent 00736a8 commit e6f6d91

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/TestUtils.jl

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module TestUtils
33
import ..AbstractFFTs
44

55
"""
6-
TestUtils.test_complex_ffts(ArrayType=Array; test_inplace=true, test_adjoint=true)
6+
TestUtils.test_complex_ffts(ArrayType=Array; test_inplace=true, test_adjoint=true, test_wrappers=true)
77
88
Run tests to verify correctness of FFT, BFFT, and IFFT functionality using a particular backend plan implementation.
99
The backend implementation is assumed to be loaded prior to calling this function.
@@ -15,11 +15,12 @@ The backend implementation is assumed to be loaded prior to calling this functio
1515
`convert(ArrayType, ...)`.
1616
- `test_inplace=true`: whether to test in-place plans.
1717
- `test_adjoint=true`: whether to test [plan adjoints](api.md#Base.adjoint).
18+
- `test_wrappers=true`: whether to test any wrapper array inputs such as views.
1819
"""
1920
function test_complex_ffts end
2021

2122
"""
22-
TestUtils.test_real_ffts(ArrayType=Array; test_adjoint=true, copy_input=false)
23+
TestUtils.test_real_ffts(ArrayType=Array; test_adjoint=true, copy_input=false, test_wrappers=true)
2324
2425
Run tests to verify correctness of RFFT, BRFFT, and IRFFT functionality using a particular backend plan implementation.
2526
The backend implementation is assumed to be loaded prior to calling this function.
@@ -32,18 +33,21 @@ The backend implementation is assumed to be loaded prior to calling this functio
3233
- `test_adjoint=true`: whether to test [plan adjoints](api.md#Base.adjoint).
3334
- `copy_input=false`: whether to copy the input before applying the plan in tests, to accomodate for
3435
[input-mutating behaviour of real FFTW plans](https://github.com/JuliaMath/AbstractFFTs.jl/issues/101).
36+
- `test_wrappers=true`: whether to test any wrapper array inputs such as views.
3537
"""
3638
function test_real_ffts end
3739

3840
# Always copy input before application due to FFTW real plans possibly mutating input (AbstractFFTs.jl#101)
3941
"""
4042
TestUtils.test_plan(P::Plan, x::AbstractArray, x_transformed::AbstractArray;
41-
inplace_plan=false, copy_input=false)
43+
inplace_plan=false, copy_input=false, test_wrappers=true)
4244
4345
Test basic properties of a plan `P` given an input array `x` and expected output `x_transformed`.
4446
4547
Because [real FFTW plans may mutate their input in some cases](https://github.com/JuliaMath/AbstractFFTs.jl/issues/101),
4648
we allow specifying `copy_input=true` to allow for this behaviour in tests by copying the input before applying the plan.
49+
We also allow specifying `test_wrappers=false` to skip testing wrapper array inputs such as views, which may cause ambiguity
50+
issues for some array types currently.
4751
"""
4852
function test_plan end
4953

@@ -57,6 +61,8 @@ Real-to-complex and complex-to-real plans require a slightly modified dot test,
5761
The plan is assumed out-of-place, as adjoints are not yet supported for in-place plans.
5862
Because [real FFTW plans may mutate their input in some cases](https://github.com/JuliaMath/AbstractFFTs.jl/issues/101),
5963
we allow specifying `copy_input=true` to allow for this behaviour in tests by copying the input before applying the plan.
64+
We also allow specifying `test_wrappers=false` to skip testing wrapper array inputs such as views, which may cause ambiguity
65+
issues for some array types currently.
6066
"""
6167
function test_plan_adjoint end
6268

0 commit comments

Comments
 (0)