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
12 changes: 5 additions & 7 deletions test/adjtrans.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ isdefined(Main, :pruned_old_LA) || @eval Main include("prune_old_LA.jl")

using Test, LinearAlgebra

const BASE_TEST_PATH = joinpath(dirname(pathof(LinearAlgebra)), "..", "test")
const TESTHELPERS = joinpath(BASE_TEST_PATH, "testhelpers")
const TESTDIR = joinpath(dirname(pathof(LinearAlgebra)), "..", "test")
const TESTHELPERS = joinpath(TESTDIR, "testhelpers", "testhelpers.jl")
isdefined(Main, :LinearAlgebraTestHelpers) || Base.include(Main, TESTHELPERS)

isdefined(Main, :OffsetArrays) || @eval Main include(joinpath($TESTHELPERS, "OffsetArrays.jl"))
using .Main.OffsetArrays

isdefined(Main, :ImmutableArrays) || @eval Main include(joinpath($TESTHELPERS, "ImmutableArrays.jl"))
using .Main.ImmutableArrays
using Main.LinearAlgebraTestHelpers.OffsetArrays
using Main.LinearAlgebraTestHelpers.ImmutableArrays

@testset "Adjoint and Transpose inner constructor basics" begin
intvec, intmat = [1, 2], [1 2; 3 4]
Expand Down
30 changes: 10 additions & 20 deletions test/bidiag.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,16 @@ isdefined(Main, :pruned_old_LA) || @eval Main include("prune_old_LA.jl")
using Test, LinearAlgebra, Random
using LinearAlgebra: BlasReal, BlasFloat

const BASE_TEST_PATH = joinpath(dirname(pathof(LinearAlgebra)), "..", "test")
const TESTHELPERS = joinpath(BASE_TEST_PATH, "testhelpers")

isdefined(Main, :Quaternions) || @eval Main include(joinpath($TESTHELPERS, "Quaternions.jl"))
using .Main.Quaternions

isdefined(Main, :InfiniteArrays) || @eval Main include(joinpath($TESTHELPERS, "InfiniteArrays.jl"))
using .Main.InfiniteArrays

isdefined(Main, :FillArrays) || @eval Main include(joinpath($TESTHELPERS, "FillArrays.jl"))
using .Main.FillArrays

isdefined(Main, :OffsetArrays) || @eval Main include(joinpath($TESTHELPERS, "OffsetArrays.jl"))
using .Main.OffsetArrays

isdefined(Main, :SizedArrays) || @eval Main include(joinpath($TESTHELPERS, "SizedArrays.jl"))
using .Main.SizedArrays

isdefined(Main, :ImmutableArrays) || @eval Main include(joinpath($TESTHELPERS, "ImmutableArrays.jl"))
using .Main.ImmutableArrays
const TESTDIR = joinpath(dirname(pathof(LinearAlgebra)), "..", "test")
const TESTHELPERS = joinpath(TESTDIR, "testhelpers", "testhelpers.jl")
isdefined(Main, :LinearAlgebraTestHelpers) || Base.include(Main, TESTHELPERS)

using Main.LinearAlgebraTestHelpers.Quaternions
using Main.LinearAlgebraTestHelpers.InfiniteArrays
using Main.LinearAlgebraTestHelpers.FillArrays
using Main.LinearAlgebraTestHelpers.OffsetArrays
using Main.LinearAlgebraTestHelpers.SizedArrays
using Main.LinearAlgebraTestHelpers.ImmutableArrays

include("testutils.jl") # test_approx_eq_modphase

Expand Down
8 changes: 4 additions & 4 deletions test/cholesky.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ using Test, LinearAlgebra, Random
using LinearAlgebra: BlasComplex, BlasFloat, BlasReal, QRPivoted,
PosDefException, RankDeficientException, chkfullrank

const BASE_TEST_PATH = joinpath(dirname(pathof(LinearAlgebra)), "..", "test")
const TESTHELPERS = joinpath(BASE_TEST_PATH, "testhelpers")
const TESTDIR = joinpath(dirname(pathof(LinearAlgebra)), "..", "test")
const TESTHELPERS = joinpath(TESTDIR, "testhelpers", "testhelpers.jl")
isdefined(Main, :LinearAlgebraTestHelpers) || Base.include(Main, TESTHELPERS)

isdefined(Main, :Quaternions) || @eval Main include(joinpath($TESTHELPERS, "Quaternions.jl"))
using .Main.Quaternions
using Main.LinearAlgebraTestHelpers.Quaternions

function unary_ops_tests(a, ca, tol; n=size(a, 1))
@test inv(ca)*a ≈ Matrix(I, n, n)
Expand Down
12 changes: 5 additions & 7 deletions test/dense.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@ using Test, LinearAlgebra, Random
using LinearAlgebra: BlasComplex, BlasFloat, BlasReal
using Test: GenericArray

const BASE_TEST_PATH = joinpath(dirname(pathof(LinearAlgebra)), "..", "test")
const TESTHELPERS = joinpath(BASE_TEST_PATH, "testhelpers")
const TESTDIR = joinpath(dirname(pathof(LinearAlgebra)), "..", "test")
const TESTHELPERS = joinpath(TESTDIR, "testhelpers", "testhelpers.jl")
isdefined(Main, :LinearAlgebraTestHelpers) || Base.include(Main, TESTHELPERS)

isdefined(Main, :FillArrays) || @eval Main include(joinpath($TESTHELPERS, "FillArrays.jl"))
import Main.FillArrays

isdefined(Main, :SizedArrays) || @eval Main include(joinpath($TESTHELPERS, "SizedArrays.jl"))
using Main.SizedArrays
import Main.LinearAlgebraTestHelpers.FillArrays
using Main.LinearAlgebraTestHelpers.SizedArrays

@testset "Check that non-floats are correctly promoted" begin
@test [1 0 0; 0 1 0]\[1,1] ≈ [1;1;0]
Expand Down
26 changes: 9 additions & 17 deletions test/diagonal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,15 @@ isdefined(Main, :pruned_old_LA) || @eval Main include("prune_old_LA.jl")
using Test, LinearAlgebra, Random
using LinearAlgebra: BlasFloat, BlasComplex

const BASE_TEST_PATH = joinpath(dirname(pathof(LinearAlgebra)), "..", "test")
const TESTHELPERS = joinpath(BASE_TEST_PATH, "testhelpers")

isdefined(Main, :OffsetArrays) || @eval Main include(joinpath($TESTHELPERS, "OffsetArrays.jl"))
using .Main.OffsetArrays

isdefined(Main, :InfiniteArrays) || @eval Main include(joinpath($TESTHELPERS, "InfiniteArrays.jl"))
using .Main.InfiniteArrays

isdefined(Main, :FillArrays) || @eval Main include(joinpath($TESTHELPERS, "FillArrays.jl"))
using .Main.FillArrays

isdefined(Main, :SizedArrays) || @eval Main include(joinpath($TESTHELPERS, "SizedArrays.jl"))
using .Main.SizedArrays

isdefined(Main, :ImmutableArrays) || @eval Main include(joinpath($TESTHELPERS, "ImmutableArrays.jl"))
using .Main.ImmutableArrays
const TESTDIR = joinpath(dirname(pathof(LinearAlgebra)), "..", "test")
const TESTHELPERS = joinpath(TESTDIR, "testhelpers", "testhelpers.jl")
isdefined(Main, :LinearAlgebraTestHelpers) || Base.include(Main, TESTHELPERS)

using Main.LinearAlgebraTestHelpers.OffsetArrays
using Main.LinearAlgebraTestHelpers.InfiniteArrays
using Main.LinearAlgebraTestHelpers.FillArrays
using Main.LinearAlgebraTestHelpers.SizedArrays
using Main.LinearAlgebraTestHelpers.ImmutableArrays

const n=12 # Size of matrix problem to test
Random.seed!(1)
Expand Down
26 changes: 9 additions & 17 deletions test/generic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,15 @@ using Test, LinearAlgebra, Random
using Test: GenericArray
using LinearAlgebra: isbanded

const BASE_TEST_PATH = joinpath(dirname(pathof(LinearAlgebra)), "..", "test")
const TESTHELPERS = joinpath(BASE_TEST_PATH, "testhelpers")

isdefined(Main, :Quaternions) || @eval Main include(joinpath($TESTHELPERS, "Quaternions.jl"))
using .Main.Quaternions

isdefined(Main, :OffsetArrays) || @eval Main include(joinpath($TESTHELPERS, "OffsetArrays.jl"))
using .Main.OffsetArrays

isdefined(Main, :DualNumbers) || @eval Main include(joinpath($TESTHELPERS, "DualNumbers.jl"))
using .Main.DualNumbers

isdefined(Main, :FillArrays) || @eval Main include(joinpath($TESTHELPERS, "FillArrays.jl"))
using .Main.FillArrays

isdefined(Main, :SizedArrays) || @eval Main include(joinpath($TESTHELPERS, "SizedArrays.jl"))
using .Main.SizedArrays
const TESTDIR = joinpath(dirname(pathof(LinearAlgebra)), "..", "test")
const TESTHELPERS = joinpath(TESTDIR, "testhelpers", "testhelpers.jl")
isdefined(Main, :LinearAlgebraTestHelpers) || Base.include(Main, TESTHELPERS)

using Main.LinearAlgebraTestHelpers.Quaternions
using Main.LinearAlgebraTestHelpers.OffsetArrays
using Main.LinearAlgebraTestHelpers.DualNumbers
using Main.LinearAlgebraTestHelpers.FillArrays
using Main.LinearAlgebraTestHelpers.SizedArrays

Random.seed!(123)

Expand Down
12 changes: 5 additions & 7 deletions test/hessenberg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ isdefined(Main, :pruned_old_LA) || @eval Main include("prune_old_LA.jl")

using Test, LinearAlgebra, Random

const BASE_TEST_PATH = joinpath(dirname(pathof(LinearAlgebra)), "..", "test")
const TESTHELPERS = joinpath(BASE_TEST_PATH, "testhelpers")
const TESTDIR = joinpath(dirname(pathof(LinearAlgebra)), "..", "test")
const TESTHELPERS = joinpath(TESTDIR, "testhelpers", "testhelpers.jl")
isdefined(Main, :LinearAlgebraTestHelpers) || Base.include(Main, TESTHELPERS)

isdefined(Main, :SizedArrays) || @eval Main include(joinpath($TESTHELPERS, "SizedArrays.jl"))
using .Main.SizedArrays

isdefined(Main, :ImmutableArrays) || @eval Main include(joinpath($TESTHELPERS, "ImmutableArrays.jl"))
using .Main.ImmutableArrays
using Main.LinearAlgebraTestHelpers.SizedArrays
using Main.LinearAlgebraTestHelpers.ImmutableArrays

# for tuple tests below
≅(x,y) = all(p -> p[1] ≈ p[2], zip(x,y))
Expand Down
8 changes: 4 additions & 4 deletions test/matmul.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ using Base: rtoldefault
using Test, LinearAlgebra, Random
using LinearAlgebra: mul!, Symmetric, Hermitian

const BASE_TEST_PATH = joinpath(dirname(pathof(LinearAlgebra)), "..", "test")
const TESTHELPERS = joinpath(BASE_TEST_PATH, "testhelpers")
const TESTDIR = joinpath(dirname(pathof(LinearAlgebra)), "..", "test")
const TESTHELPERS = joinpath(TESTDIR, "testhelpers", "testhelpers.jl")
isdefined(Main, :LinearAlgebraTestHelpers) || Base.include(Main, TESTHELPERS)

isdefined(Main, :SizedArrays) || @eval Main include(joinpath($TESTHELPERS, "SizedArrays.jl"))
using .Main.SizedArrays
using Main.LinearAlgebraTestHelpers.SizedArrays

## Test Julia fallbacks to BLAS routines

Expand Down
4 changes: 4 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ include("prune_old_LA.jl")

using Test, LinearAlgebra

const TESTDIR = joinpath(dirname(pathof(LinearAlgebra)), "..", "test")
const TESTHELPERS = joinpath(TESTDIR, "testhelpers", "testhelpers.jl")
isdefined(Main, :LinearAlgebraTestHelpers) || Base.include(Main, TESTHELPERS)

for file in readlines(joinpath(@__DIR__, "testgroups"))
@info "Testing $file"
include(file * ".jl")
Expand Down
8 changes: 4 additions & 4 deletions test/special.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ isdefined(Main, :pruned_old_LA) || @eval Main include("prune_old_LA.jl")
using Test, LinearAlgebra, Random
using LinearAlgebra: rmul!, BandIndex

const BASE_TEST_PATH = joinpath(dirname(pathof(LinearAlgebra)), "..", "test")
const TESTHELPERS = joinpath(BASE_TEST_PATH, "testhelpers")
const TESTDIR = joinpath(dirname(pathof(LinearAlgebra)), "..", "test")
const TESTHELPERS = joinpath(TESTDIR, "testhelpers", "testhelpers.jl")
isdefined(Main, :LinearAlgebraTestHelpers) || Base.include(Main, TESTHELPERS)

isdefined(Main, :SizedArrays) || @eval Main include(joinpath($TESTHELPERS, "SizedArrays.jl"))
using .Main.SizedArrays
using Main.LinearAlgebraTestHelpers.SizedArrays

n= 10 #Size of matrix to test
Random.seed!(1)
Expand Down
8 changes: 4 additions & 4 deletions test/structuredbroadcast.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ isdefined(Main, :pruned_old_LA) || @eval Main include("prune_old_LA.jl")

using Test, LinearAlgebra

const BASE_TEST_PATH = joinpath(dirname(pathof(LinearAlgebra)), "..", "test")
const TESTHELPERS = joinpath(BASE_TEST_PATH, "testhelpers")
const TESTDIR = joinpath(dirname(pathof(LinearAlgebra)), "..", "test")
const TESTHELPERS = joinpath(TESTDIR, "testhelpers", "testhelpers.jl")
isdefined(Main, :LinearAlgebraTestHelpers) || Base.include(Main, TESTHELPERS)

isdefined(Main, :SizedArrays) || @eval Main include(joinpath($TESTHELPERS, "SizedArrays.jl"))
using .Main.SizedArrays
using Main.LinearAlgebraTestHelpers.SizedArrays

@testset "broadcast[!] over combinations of scalars, structured matrices, and dense vectors/matrices" begin
@testset for N in (0,1,2,10) # some edge cases, and a structured case
Expand Down
16 changes: 6 additions & 10 deletions test/symmetric.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,13 @@ isdefined(Main, :pruned_old_LA) || @eval Main include("prune_old_LA.jl")

using Test, LinearAlgebra, Random

const BASE_TEST_PATH = joinpath(dirname(pathof(LinearAlgebra)), "..", "test")
const TESTHELPERS = joinpath(BASE_TEST_PATH, "testhelpers")
const TESTDIR = joinpath(dirname(pathof(LinearAlgebra)), "..", "test")
const TESTHELPERS = joinpath(TESTDIR, "testhelpers", "testhelpers.jl")
isdefined(Main, :LinearAlgebraTestHelpers) || Base.include(Main, TESTHELPERS)

isdefined(Main, :Quaternions) || @eval Main include(joinpath($TESTHELPERS, "Quaternions.jl"))
using .Main.Quaternions

isdefined(Main, :SizedArrays) || @eval Main include(joinpath($TESTHELPERS, "SizedArrays.jl"))
using .Main.SizedArrays

isdefined(Main, :ImmutableArrays) || @eval Main include(joinpath($TESTHELPERS, "ImmutableArrays.jl"))
using .Main.ImmutableArrays
using Main.LinearAlgebraTestHelpers.Quaternions
using Main.LinearAlgebraTestHelpers.SizedArrays
using Main.LinearAlgebraTestHelpers.ImmutableArrays

Random.seed!(1010)

Expand Down
16 changes: 16 additions & 0 deletions test/testhelpers/testhelpers.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module LinearAlgebraTestHelpers

export DualNumbers, FillArrays, Furlongs, ImmutableArrays,
InfiniteArrays, OffsetArrays, Quaternions, SizedArrays, StructArrays

include("DualNumbers.jl")
include("FillArrays.jl")
include("Furlongs.jl")
include("ImmutableArrays.jl")
include("InfiniteArrays.jl")
include("OffsetArrays.jl")
include("Quaternions.jl")
include("SizedArrays.jl")
include("StructArrays.jl")

end
18 changes: 7 additions & 11 deletions test/triangular.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,13 @@ using Test, LinearAlgebra, Random
using LinearAlgebra: errorbounds, transpose!, BandIndex
using Test: GenericArray

const BASE_TEST_PATH = joinpath(dirname(pathof(LinearAlgebra)), "..", "test")
const TESTHELPERS = joinpath(BASE_TEST_PATH, "testhelpers")
const TESTDIR = joinpath(dirname(pathof(LinearAlgebra)), "..", "test")
const TESTHELPERS = joinpath(TESTDIR, "testhelpers", "testhelpers.jl")
isdefined(Main, :LinearAlgebraTestHelpers) || Base.include(Main, TESTHELPERS)

isdefined(Main, :SizedArrays) || @eval Main include(joinpath($TESTHELPERS, "SizedArrays.jl"))
using .Main.SizedArrays

isdefined(Main, :FillArrays) || @eval Main include(joinpath($TESTHELPERS, "FillArrays.jl"))
using .Main.FillArrays

isdefined(Main, :ImmutableArrays) || @eval Main include(joinpath($TESTHELPERS, "ImmutableArrays.jl"))
using .Main.ImmutableArrays
using Main.LinearAlgebraTestHelpers.SizedArrays
using Main.LinearAlgebraTestHelpers.FillArrays
using Main.LinearAlgebraTestHelpers.ImmutableArrays

n = 9
Random.seed!(123)
Expand Down Expand Up @@ -246,7 +242,7 @@ end
end

# dimensional correctness:
const BASE_TEST_PATH = joinpath(Sys.BINDIR, "..", "share", "julia", "test")
const TESTDIR = joinpath(Sys.BINDIR, "..", "share", "julia", "test")

@testset "AbstractArray constructor should preserve underlying storage type" begin
# tests corresponding to #34995
Expand Down
30 changes: 10 additions & 20 deletions test/tridiag.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,16 @@ isdefined(Main, :pruned_old_LA) || @eval Main include("prune_old_LA.jl")

using Test, LinearAlgebra, Random

const BASE_TEST_PATH = joinpath(dirname(pathof(LinearAlgebra)), "..", "test")
const TESTHELPERS = joinpath(BASE_TEST_PATH, "testhelpers")

isdefined(Main, :Quaternions) || @eval Main include(joinpath($TESTHELPERS, "Quaternions.jl"))
using .Main.Quaternions

isdefined(Main, :InfiniteArrays) || @eval Main include(joinpath($TESTHELPERS, "InfiniteArrays.jl"))
using .Main.InfiniteArrays

isdefined(Main, :FillArrays) || @eval Main include(joinpath($TESTHELPERS, "FillArrays.jl"))
using .Main.FillArrays

isdefined(Main, :OffsetArrays) || @eval Main include(joinpath($TESTHELPERS, "OffsetArrays.jl"))
using .Main.OffsetArrays

isdefined(Main, :SizedArrays) || @eval Main include(joinpath($TESTHELPERS, "SizedArrays.jl"))
using .Main.SizedArrays

isdefined(Main, :ImmutableArrays) || @eval Main include(joinpath($TESTHELPERS, "ImmutableArrays.jl"))
using .Main.ImmutableArrays
const TESTDIR = joinpath(dirname(pathof(LinearAlgebra)), "..", "test")
const TESTHELPERS = joinpath(TESTDIR, "testhelpers", "testhelpers.jl")
isdefined(Main, :LinearAlgebraTestHelpers) || Base.include(Main, TESTHELPERS)

using Main.LinearAlgebraTestHelpers.Quaternions
using Main.LinearAlgebraTestHelpers.InfiniteArrays
using Main.LinearAlgebraTestHelpers.FillArrays
using Main.LinearAlgebraTestHelpers.OffsetArrays
using Main.LinearAlgebraTestHelpers.SizedArrays
using Main.LinearAlgebraTestHelpers.ImmutableArrays

include("testutils.jl") # test_approx_eq_modphase

Expand Down
11 changes: 5 additions & 6 deletions test/uniformscaling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ isdefined(Main, :pruned_old_LA) || @eval Main include("prune_old_LA.jl")

using Test, LinearAlgebra, Random

const BASE_TEST_PATH = joinpath(dirname(pathof(LinearAlgebra)), "..", "test")
const TESTHELPERS = joinpath(BASE_TEST_PATH, "testhelpers")
const TESTDIR = joinpath(dirname(pathof(LinearAlgebra)), "..", "test")
const TESTHELPERS = joinpath(TESTDIR, "testhelpers", "testhelpers.jl")
isdefined(Main, :LinearAlgebraTestHelpers) || Base.include(Main, TESTHELPERS)

isdefined(Main, :Quaternions) || @eval Main include(joinpath($TESTHELPERS, "Quaternions.jl"))
using .Main.Quaternions
isdefined(Main, :OffsetArrays) || @eval Main include(joinpath($TESTHELPERS, "OffsetArrays.jl"))
using .Main.OffsetArrays
using Main.LinearAlgebraTestHelpers.Quaternions
using Main.LinearAlgebraTestHelpers.OffsetArrays

Random.seed!(1234543)

Expand Down
8 changes: 4 additions & 4 deletions test/unitful.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ using Test, LinearAlgebra, Random

Random.seed!(1234321)

const BASE_TEST_PATH = joinpath(dirname(pathof(LinearAlgebra)), "..", "test")
const TESTHELPERS = joinpath(BASE_TEST_PATH, "testhelpers")
const TESTDIR = joinpath(dirname(pathof(LinearAlgebra)), "..", "test")
const TESTHELPERS = joinpath(TESTDIR, "testhelpers", "testhelpers.jl")
isdefined(Main, :LinearAlgebraTestHelpers) || Base.include(Main, TESTHELPERS)

isdefined(Main, :Furlongs) || @eval Main include(joinpath($TESTHELPERS, "Furlongs.jl"))
using .Main.Furlongs
using Main.LinearAlgebraTestHelpers.Furlongs

LinearAlgebra.sylvester(a::Furlong,b::Furlong,c::Furlong) = -c / (a + b)

Expand Down