From 6d8418aa2a15feaa1d8ea8c7f7ccca7f31ddc0cd Mon Sep 17 00:00:00 2001 From: Jishnu Bhattacharya Date: Wed, 17 Apr 2024 16:31:15 +0530 Subject: [PATCH] Make tests modular (#197) --- test/runtests.jl | 1 - test/test_adjtransblockbanded.jl | 8 ++++++-- test/test_bandedblockbanded.jl | 4 ++++ test/test_blockbanded.jl | 4 ++++ test/test_blockskyline.jl | 4 ++++ test/test_blockskylineqr.jl | 4 ++++ test/test_broadcasting.jl | 4 ++++ test/test_linalg.jl | 4 ++++ test/test_misc.jl | 3 +++ test/test_triblockbanded.jl | 4 ++++ 10 files changed, 37 insertions(+), 3 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index c497ed5..f7ae97f 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,5 +1,4 @@ using BlockBandedMatrices -using LinearAlgebra using Test using Aqua diff --git a/test/test_adjtransblockbanded.jl b/test/test_adjtransblockbanded.jl index beea7b3..fa17a8f 100644 --- a/test/test_adjtransblockbanded.jl +++ b/test/test_adjtransblockbanded.jl @@ -1,6 +1,8 @@ +module TestAdjTransBlockBanded + using ArrayLayouts, BlockBandedMatrices, Test -import BlockBandedMatrices: BandedBlockBandedRowMajor, BandedBlockBandedRows, - BandedBlockBandedColumns, BlockBandedRows, +import BlockBandedMatrices: BandedBlockBandedRowMajor, BandedBlockBandedRows, + BandedBlockBandedColumns, BlockBandedRows, BlockBandedColumns, blockcolsupport, blockrowsupport @testset "Adj/Trans" begin @@ -62,3 +64,5 @@ import BlockBandedMatrices: BandedBlockBandedRowMajor, BandedBlockBandedRows, @test colsupport(E2', 1) == 1:0 end end + +end # module diff --git a/test/test_bandedblockbanded.jl b/test/test_bandedblockbanded.jl index 1a759e9..2d661de 100644 --- a/test/test_bandedblockbanded.jl +++ b/test/test_bandedblockbanded.jl @@ -1,3 +1,5 @@ +module TestBandedBlockBanded + using ArrayLayouts using BandedMatrices using BlockArrays @@ -564,3 +566,5 @@ if false # turned off since tests have check-bounds=yes BandedMatrices.inbands_setindex!(V, -2, 5, 1) @test A[2,1] == -2 end + +end # module diff --git a/test/test_blockbanded.jl b/test/test_blockbanded.jl index 8747b53..ca8b2a9 100644 --- a/test/test_blockbanded.jl +++ b/test/test_blockbanded.jl @@ -1,3 +1,5 @@ +module TestBlockBanded + using ArrayLayouts using BandedMatrices using BlockArrays @@ -246,3 +248,5 @@ import BlockBandedMatrices: MemoryLayout, ColumnMajor, BroadcastStyle, @inferred(f(s)) end end + +end # module diff --git a/test/test_blockskyline.jl b/test/test_blockskyline.jl index 4f24489..9501da7 100644 --- a/test/test_blockskyline.jl +++ b/test/test_blockskyline.jl @@ -1,3 +1,5 @@ +module TestBlockSkyline + using ArrayLayouts using BlockArrays using BlockBandedMatrices @@ -163,3 +165,5 @@ Random.seed!(0) @test s == " 1 │ 0 0 │ ⋅ ⋅ ⋅ │ ⋅ ⋅ ⋅ ⋅" end end + +end # module diff --git a/test/test_blockskylineqr.jl b/test/test_blockskylineqr.jl index e868b2e..ba5fd45 100644 --- a/test/test_blockskylineqr.jl +++ b/test/test_blockskylineqr.jl @@ -1,3 +1,5 @@ +module TestBlockSkylineQR + using BlockBandedMatrices using BlockArrays using LinearAlgebra @@ -201,3 +203,5 @@ end # @time F = qr(A); # 11s # b = randn(size(A,1)); # @time F\b; # 0.6s + +end # module diff --git a/test/test_broadcasting.jl b/test/test_broadcasting.jl index 07c912d..009dc04 100644 --- a/test/test_broadcasting.jl +++ b/test/test_broadcasting.jl @@ -1,3 +1,5 @@ +module TestBroadcasting + using ArrayLayouts using BandedMatrices using BlockArrays @@ -287,3 +289,5 @@ import Base: oneto end end end + +end # module diff --git a/test/test_linalg.jl b/test/test_linalg.jl index 30c5530..3951444 100644 --- a/test/test_linalg.jl +++ b/test/test_linalg.jl @@ -1,3 +1,5 @@ +module TestLinalg + using ArrayLayouts using BandedMatrices using BlockArrays @@ -201,3 +203,5 @@ end @test cholesky(Symmetric(Δ)).U ≈ cholesky(Matrix(Δ)).U @test cholesky(Symmetric(Δ,:L)).U ≈ cholesky(Matrix(Δ)).U end + +end # module diff --git a/test/test_misc.jl b/test/test_misc.jl index 38ec347..524ed32 100644 --- a/test/test_misc.jl +++ b/test/test_misc.jl @@ -1,3 +1,5 @@ +module TestMisc + using ArrayLayouts using BandedMatrices using BlockArrays @@ -246,3 +248,4 @@ Base.size(F::FiniteDifference) = (F.n,F.n) end end +end # module diff --git a/test/test_triblockbanded.jl b/test/test_triblockbanded.jl index 7c1a826..ac1389b 100644 --- a/test/test_triblockbanded.jl +++ b/test/test_triblockbanded.jl @@ -1,3 +1,5 @@ +module TestTriBlockBanded + using ArrayLayouts using BandedMatrices using BlockArrays @@ -209,3 +211,5 @@ import BlockArrays: blockisequal @test UpperTriangular(V2) \ b ≈ UpperTriangular(V) \ b end end + +end # module