Skip to content

Commit

Permalink
test: Don't use GPL module when Base.USE_GPL_LIBS=false
Browse files Browse the repository at this point in the history
  • Loading branch information
inkydragon committed Apr 25, 2024
1 parent df0a154 commit 5f90a49
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
6 changes: 4 additions & 2 deletions test/cholmod.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

module CHOLMODTests

if !Base.USE_GPL_LIBS
@info "Not use GPL libs, Skipping CHOLMOD Tests"
else

using Test
using SparseArrays.CHOLMOD
using SparseArrays.CHOLMOD: getcommon
Expand All @@ -16,8 +20,6 @@ using SparseArrays: getcolptr
using SparseArrays.LibSuiteSparse
using SparseArrays.LibSuiteSparse: cholmod_l_allocate_sparse, cholmod_allocate_sparse

if Base.USE_GPL_LIBS

# CHOLMOD tests
itypes = sizeof(Int) == 4 ? (Int32,) : (Int32, Int64)
for Ti itypes, Tv (Float32, Float64)
Expand Down
6 changes: 4 additions & 2 deletions test/linalg_solvers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@

module SparseLinalgSolversTests

if !Base.USE_GPL_LIBS
@info "Not use GPL libs, Skipping SparseLinalgSolvers Tests"
else

using Test
using SparseArrays
using Random
using LinearAlgebra

if Base.USE_GPL_LIBS

@testset "explicit zeros" begin
a = SparseMatrixCSC(2, 2, [1, 3, 5], [1, 2, 1, 2], [1.0, 0.0, 0.0, 1.0])
@test lu(a)\[2.0, 3.0] [2.0, 3.0]
Expand Down
6 changes: 5 additions & 1 deletion test/spqr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

module SPQRTests

if !Base.USE_GPL_LIBS
@info "Not use GPL libs, Skipping SPQR Tests"
else

using Test
using SparseArrays.SPQR
using SparseArrays.CHOLMOD
Expand All @@ -10,7 +14,7 @@ using SparseArrays: SparseArrays, sparse, sprandn, spzeros, SparseMatrixCSC
using Random: seed!

# TODO REMOVE SECOND PREDICATE WITH SS7.1
if Base.USE_GPL_LIBS

@testset "Sparse QR" begin
m, n = 100, 10
nn = 100
Expand Down
6 changes: 5 additions & 1 deletion test/umfpack.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@

module UMFPACKTests

if !Base.USE_GPL_LIBS
@info "Not use GPL libs, Skipping UMFPACK Tests"
else

using Test
using Random
using SparseArrays
using Serialization
using LinearAlgebra:
LinearAlgebra, I, det, issuccess, ldiv!, lu, lu!, Transpose, SingularException, Diagonal, logabsdet
using SparseArrays: nnz, sparse, sprand, sprandn, SparseMatrixCSC, UMFPACK, increment!
if Base.USE_GPL_LIBS

function umfpack_report(l::UMFPACK.UmfpackLU)
UMFPACK.umfpack_report_numeric(l, 0)
UMFPACK.umfpack_report_symbolic(l, 0)
Expand Down

0 comments on commit 5f90a49

Please sign in to comment.