|
1 | 1 | using StaticArrays, Test, Random, LinearAlgebra |
2 | 2 | using InteractiveUtils |
3 | 3 |
|
4 | | -# Allow no new ambiguities (see #18), unless you fix some old ones first! |
5 | | -if VERSION >= v"1.0.0" |
6 | | - @test length(detect_ambiguities(Base, LinearAlgebra, StaticArrays)) <= 5 |
7 | | -end |
8 | | - |
9 | 4 | # We generate a lot of matrices using rand(), but unit tests should be |
10 | 5 | # deterministic. Therefore seed the RNG here (and further down, to avoid test |
11 | 6 | # file order dependence) |
12 | 7 | Random.seed!(42) |
13 | | - |
14 | 8 | include("testutil.jl") |
15 | | -include("SVector.jl") |
16 | | -include("MVector.jl") |
17 | | -include("SMatrix.jl") |
18 | | -include("MMatrix.jl") |
19 | | -include("SArray.jl") |
20 | | -include("MArray.jl") |
21 | | -include("FieldVector.jl") |
22 | | -include("FieldMatrix.jl") |
23 | | -include("Scalar.jl") |
24 | | -include("SUnitRange.jl") |
25 | | -include("SizedArray.jl") |
26 | | -include("SDiagonal.jl") |
27 | | -include("SHermitianCompact.jl") |
28 | 9 |
|
29 | | -include("custom_types.jl") |
30 | | -include("convert.jl") |
31 | | -include("core.jl") |
32 | | -include("abstractarray.jl") |
33 | | -include("indexing.jl") |
34 | | -include("initializers.jl") |
35 | | -Random.seed!(42); include("mapreduce.jl") |
36 | | -Random.seed!(42); include("sort.jl") |
37 | | -Random.seed!(42); include("accumulate.jl") |
38 | | -Random.seed!(42); include("arraymath.jl") |
39 | | -include("broadcast.jl") |
40 | | -include("linalg.jl") |
41 | | -Random.seed!(42); include("matrix_multiply.jl") |
42 | | -Random.seed!(42); include("triangular.jl") |
43 | | -include("det.jl") |
44 | | -include("inv.jl") |
45 | | -Random.seed!(42); include("solve.jl") |
46 | | -Random.seed!(44); include("eigen.jl") |
47 | | -include("expm.jl") |
48 | | -include("sqrtm.jl") |
49 | | -include("lyap.jl") |
50 | | -Random.seed!(42); include("lu.jl") |
51 | | -Random.seed!(42); include("qr.jl") |
52 | | -Random.seed!(42); include("chol.jl") # hermitian_type(::Type{Any}) for block algorithm |
53 | | -include("deque.jl") |
54 | | -include("flatten.jl") |
55 | | -include("io.jl") |
56 | | -include("svd.jl") |
57 | | -include("deprecated.jl") |
| 10 | +# Hook into Pkg.test so that tests from a single file can be run. For example, |
| 11 | +# to run only the MVector and SVector tests, use: |
| 12 | +# |
| 13 | +# Pkg.test("StaticArrays", test_args=["MVector", "SVector"]) |
| 14 | +# |
| 15 | +enabled_tests = lowercase.(ARGS) |
| 16 | +function addtests(fname) |
| 17 | + key = lowercase(splitext(fname)[1]) |
| 18 | + if isempty(enabled_tests) || key in enabled_tests |
| 19 | + Random.seed!(42) |
| 20 | + include(fname) |
| 21 | + end |
| 22 | +end |
| 23 | + |
| 24 | +addtests("SVector.jl") |
| 25 | +addtests("MVector.jl") |
| 26 | +addtests("SMatrix.jl") |
| 27 | +addtests("MMatrix.jl") |
| 28 | +addtests("SArray.jl") |
| 29 | +addtests("MArray.jl") |
| 30 | +addtests("FieldVector.jl") |
| 31 | +addtests("FieldMatrix.jl") |
| 32 | +addtests("Scalar.jl") |
| 33 | +addtests("SUnitRange.jl") |
| 34 | +addtests("SizedArray.jl") |
| 35 | +addtests("SDiagonal.jl") |
| 36 | +addtests("SHermitianCompact.jl") |
| 37 | + |
| 38 | +addtests("ambiguities.jl") |
| 39 | +addtests("custom_types.jl") |
| 40 | +addtests("convert.jl") |
| 41 | +addtests("core.jl") |
| 42 | +addtests("abstractarray.jl") |
| 43 | +addtests("indexing.jl") |
| 44 | +addtests("initializers.jl") |
| 45 | +addtests("mapreduce.jl") |
| 46 | +addtests("sort.jl") |
| 47 | +addtests("accumulate.jl") |
| 48 | +addtests("arraymath.jl") |
| 49 | +addtests("broadcast.jl") |
| 50 | +addtests("linalg.jl") |
| 51 | +addtests("matrix_multiply.jl") |
| 52 | +addtests("triangular.jl") |
| 53 | +addtests("det.jl") |
| 54 | +addtests("inv.jl") |
| 55 | +addtests("solve.jl") |
| 56 | +addtests("eigen.jl") |
| 57 | +addtests("expm.jl") |
| 58 | +addtests("sqrtm.jl") |
| 59 | +addtests("lyap.jl") |
| 60 | +addtests("lu.jl") |
| 61 | +addtests("qr.jl") |
| 62 | +addtests("chol.jl") # hermitian_type(::Type{Any}) for block algorithm |
| 63 | +addtests("deque.jl") |
| 64 | +addtests("flatten.jl") |
| 65 | +addtests("io.jl") |
| 66 | +addtests("svd.jl") |
| 67 | +addtests("deprecated.jl") |
0 commit comments