From 5f90a49f8ec1b820da67839bf9c5bf551b60cfdf Mon Sep 17 00:00:00 2001 From: Chengyu HAN Date: Wed, 24 Apr 2024 21:24:21 -0500 Subject: [PATCH] test: Don't use GPL module when Base.USE_GPL_LIBS=false --- test/cholmod.jl | 6 ++++-- test/linalg_solvers.jl | 6 ++++-- test/spqr.jl | 6 +++++- test/umfpack.jl | 6 +++++- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/test/cholmod.jl b/test/cholmod.jl index e025119a..d47409da 100644 --- a/test/cholmod.jl +++ b/test/cholmod.jl @@ -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 @@ -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) diff --git a/test/linalg_solvers.jl b/test/linalg_solvers.jl index f8a758c7..96454c44 100644 --- a/test/linalg_solvers.jl +++ b/test/linalg_solvers.jl @@ -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] diff --git a/test/spqr.jl b/test/spqr.jl index 16a72eef..dbb6cc77 100644 --- a/test/spqr.jl +++ b/test/spqr.jl @@ -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 @@ -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 diff --git a/test/umfpack.jl b/test/umfpack.jl index ba65e1b2..d01358c4 100644 --- a/test/umfpack.jl +++ b/test/umfpack.jl @@ -2,6 +2,10 @@ module UMFPACKTests +if !Base.USE_GPL_LIBS + @info "Not use GPL libs, Skipping UMFPACK Tests" +else + using Test using Random using SparseArrays @@ -9,7 +13,7 @@ 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)