From 2f0a105e86a904afef5ba340aaa7aa2514a0da57 Mon Sep 17 00:00:00 2001 From: Denis Laxalde Date: Mon, 23 Jun 2014 22:33:42 +0200 Subject: Split out GSL tests from base ones Move GSL tests into Numeric.GSL.Tests, separate the main into TestBase.hs and TestGSL.hs. In hmatrix-tests.cabal: - Split the test suite into a -base and -gsl ones - Add a `gsl` configuration flag to select GSL tests - Add a benchmark section One can now run hmatrix-base tests suite and benchmarks with: cabal configure --flag=-gsl --enable-tests --enable-benchmarks cabal tests cabal bench --- packages/tests/hmatrix-tests.cabal | 46 ++++++++++++++++++++++++++++++++------ 1 file changed, 39 insertions(+), 7 deletions(-) (limited to 'packages/tests/hmatrix-tests.cabal') diff --git a/packages/tests/hmatrix-tests.cabal b/packages/tests/hmatrix-tests.cabal index fec2f98..d48a9c4 100644 --- a/packages/tests/hmatrix-tests.cabal +++ b/packages/tests/hmatrix-tests.cabal @@ -15,18 +15,28 @@ cabal-version: >=1.8 build-type: Simple -extra-source-files: CHANGES - src/tests.hs +extra-source-files: CHANGES, + src/TestBase.hs, + src/TestGSL.hs, + src/Benchmark.hs + +flag gsl + description: Enable GSL tests + default: True library Build-Depends: base >= 4 && < 5, - hmatrix >= 0.16, hmatrix-gsl >= 0.16, - QuickCheck >= 2, HUnit, random + QuickCheck >= 2, HUnit, random, + hmatrix >= 0.16 + if flag(gsl) + Build-Depends: hmatrix-gsl >= 0.16 hs-source-dirs: src exposed-modules: Numeric.LinearAlgebra.Tests + if flag(gsl) + exposed-modules: Numeric.GSL.Tests other-modules: Numeric.LinearAlgebra.Tests.Instances, Numeric.LinearAlgebra.Tests.Properties @@ -38,8 +48,30 @@ source-repository head type: git location: https://github.com/albertoruiz/hmatrix -Test-Suite basic - Build-Depends: base, hmatrix-tests + +test-suite hmatrix-base-testsuite + type: exitcode-stdio-1.0 + main-is: src/TestBase.hs + build-depends: base >= 4 && < 5, + hmatrix-tests, + QuickCheck >= 2, HUnit, random + + +test-suite hmatrix-gsl-testsuite type: exitcode-stdio-1.0 - main-is: src/tests.hs + main-is: src/TestGSL.hs + build-depends: base >= 4 && < 5, + hmatrix-tests, + QuickCheck >= 2, HUnit, random + if flag(gsl) + buildable: True + else + buildable: False + +benchmark hmatrix-base-benchmark + type: exitcode-stdio-1.0 + main-is: src/Benchmark.hs + build-depends: base >= 4 && < 5, + hmatrix-tests, + QuickCheck >= 2, HUnit, random -- cgit v1.2.3