Skip to content

Commit 740b82a

Browse files
authored
test: Don't use GPL module when Base.USE_GPL_LIBS=false (#535)
1 parent 82b385f commit 740b82a

File tree

4 files changed

+22
-11
lines changed

4 files changed

+22
-11
lines changed

test/cholmod.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
# This file is a part of Julia. License is MIT: https://julialang.org/license
22

33
module CHOLMODTests
4-
54
using Test
5+
6+
@static if !Base.USE_GPL_LIBS
7+
@info "This Julia build excludes the use of SuiteSparse GPL libraries. Skipping CHOLMOD tests"
8+
else
9+
610
using SparseArrays.CHOLMOD
711
using SparseArrays.CHOLMOD: getcommon
812
using Random
@@ -16,8 +20,6 @@ using SparseArrays: getcolptr
1620
using SparseArrays.LibSuiteSparse
1721
using SparseArrays.LibSuiteSparse: cholmod_l_allocate_sparse, cholmod_allocate_sparse
1822

19-
if Base.USE_GPL_LIBS
20-
2123
# CHOLMOD tests
2224
itypes = sizeof(Int) == 4 ? (Int32,) : (Int32, Int64)
2325
for Ti itypes, Tv (Float32, Float64)

test/linalg_solvers.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
# This file is a part of Julia. License is MIT: https://julialang.org/license
22

33
module SparseLinalgSolversTests
4-
54
using Test
5+
6+
@static if !Base.USE_GPL_LIBS
7+
@info "This Julia build excludes the use of SuiteSparse GPL libraries. Skipping SparseLinalgSolvers Tests"
8+
else
9+
610
using SparseArrays
711
using Random
812
using LinearAlgebra
913

10-
if Base.USE_GPL_LIBS
11-
1214
@testset "explicit zeros" begin
1315
a = SparseMatrixCSC(2, 2, [1, 3, 5], [1, 2, 1, 2], [1.0, 0.0, 0.0, 1.0])
1416
@test lu(a)\[2.0, 3.0] [2.0, 3.0]

test/spqr.jl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
# This file is a part of Julia. License is MIT: https://julialang.org/license
22

33
module SPQRTests
4-
54
using Test
5+
6+
@static if !Base.USE_GPL_LIBS
7+
@info "This Julia build excludes the use of SuiteSparse GPL libraries. Skipping SPQR Tests"
8+
else
9+
610
using SparseArrays.SPQR
711
using SparseArrays.CHOLMOD
812
using LinearAlgebra: I, istriu, norm, qr, rank, rmul!, lmul!, Adjoint, Transpose, ColumnNorm, RowMaximum, NoPivot
913
using SparseArrays: SparseArrays, sparse, sprandn, spzeros, SparseMatrixCSC
1014
using Random: seed!
1115

12-
# TODO REMOVE SECOND PREDICATE WITH SS7.1
13-
if Base.USE_GPL_LIBS
16+
1417
@testset "Sparse QR" begin
1518
m, n = 100, 10
1619
nn = 100

test/umfpack.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
# This file is a part of Julia. License is MIT: https://julialang.org/license
22

33
module UMFPACKTests
4-
54
using Test
5+
6+
@static if !Base.USE_GPL_LIBS
7+
@info "This Julia build excludes the use of SuiteSparse GPL libraries. Skipping UMFPACK Tests"
8+
else
9+
610
using Random
711
using SparseArrays
812
using Serialization
913
using LinearAlgebra:
1014
LinearAlgebra, I, det, issuccess, ldiv!, lu, lu!, Transpose, SingularException, Diagonal, logabsdet
1115
using SparseArrays: nnz, sparse, sprand, sprandn, SparseMatrixCSC, UMFPACK, increment!
12-
if Base.USE_GPL_LIBS
16+
1317
function umfpack_report(l::UMFPACK.UmfpackLU)
1418
UMFPACK.umfpack_report_numeric(l, 0)
1519
UMFPACK.umfpack_report_symbolic(l, 0)

0 commit comments

Comments
 (0)