Skip to content

Commit

Permalink
Expose tests as a library as well
Browse files Browse the repository at this point in the history
Fixes #459
  • Loading branch information
Shimuuar committed Jan 24, 2024
1 parent 9e4ca8b commit 663d920
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 60 deletions.
File renamed without changes.
126 changes: 66 additions & 60 deletions vector/vector.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,14 @@ Tested-With:
GHC == 9.4.6
GHC == 9.6.2
GHC == 9.8.1


Extra-doc-files:
changelog.md
README.md
tests/LICENSE
Extra-Source-Files:
tests/Setup.hs
tests/Main.hs
internal/GenUnboxTuple.hs
internal/unbox-tuple-instances

Expand Down Expand Up @@ -177,31 +176,26 @@ Library
cpp-options: -DVECTOR_INTERNAL_CHECKS



test-suite vector-tests-O0
-- We want to build test suite in two variants. One built with -O0
-- and another with -O2 in order to catch bugs caused by invalid
-- rewrite rules
common testlib
import: flag-Wall
Default-Language: Haskell2010
type: exitcode-stdio-1.0
Main-Is: Main.hs

other-modules: Boilerplater
Tests.Bundle
Tests.Move
Tests.Vector
Tests.Vector.Property
Tests.Vector.Boxed
Tests.Vector.Storable
Tests.Vector.Primitive
Tests.Vector.Unboxed
Tests.Vector.UnitTests
Utilities

hs-source-dirs: tests
Build-Depends: base >= 4.5 && < 5, template-haskell, base-orphans >= 0.6, vector,
primitive, random,
QuickCheck >= 2.9 && < 2.15, HUnit, tasty,
tasty-hunit, tasty-quickcheck,
transformers >= 0.2.0.0
Ghc-Options: -fno-warn-missing-signatures
hs-source-dirs: tests
Build-Depends: base >= 4.5 && < 5
, template-haskell
, base-orphans >= 0.6
, vector
, primitive
, random
, QuickCheck >= 2.9 && < 2.15
, HUnit
, tasty
, tasty-hunit
, tasty-quickcheck
, transformers >= 0.2.0.0

default-extensions: CPP,
ScopedTypeVariables,
Expand All @@ -213,46 +207,58 @@ test-suite vector-tests-O0
TypeFamilies,
TemplateHaskell

Ghc-Options: -O0 -threaded
Ghc-Options: -fno-warn-missing-signatures
library tests-O0
import: testlib
Exposed-Modules:
Boilerplater
Tests.Bundle
Tests.Move
Tests.Vector
Tests.Vector.Property
Tests.Vector.Boxed
Tests.Vector.Storable
Tests.Vector.Primitive
Tests.Vector.Unboxed
Tests.Vector.UnitTests
Utilities
Ghc-Options: -O0

library tests-O2
import: testlib
Exposed-Modules:
Boilerplater
Tests.Bundle
Tests.Move
Tests.Vector
Tests.Vector.Property
Tests.Vector.Boxed
Tests.Vector.Storable
Tests.Vector.Primitive
Tests.Vector.Unboxed
Tests.Vector.UnitTests
Utilities
Ghc-Options: -O2

test-suite vector-tests-O2
common tests-exe
import: flag-Wall
Default-Language: Haskell2010
type: exitcode-stdio-1.0
Main-Is: Main.hs

other-modules: Boilerplater
Tests.Bundle
Tests.Move
Tests.Vector
Tests.Vector.Property
Tests.Vector.Boxed
Tests.Vector.Storable
Tests.Vector.Primitive
Tests.Vector.Unboxed
Tests.Vector.UnitTests
Utilities

hs-source-dirs: tests
Build-Depends: base >= 4.5 && < 5, template-haskell, base-orphans >= 0.6, vector,
primitive, random,
QuickCheck >= 2.9 && < 2.15, HUnit, tasty,
tasty-hunit, tasty-quickcheck,
transformers >= 0.2.0.0
hs-source-dirs: tests-exe
Build-Depends: base >= 4.5 && < 5
, tasty

default-extensions: CPP,
ScopedTypeVariables,
PatternGuards,
MultiParamTypeClasses,
FlexibleContexts,
RankNTypes,
TypeSynonymInstances,
TypeFamilies,
TemplateHaskell
test-suite vector-tests-O0
import: tests-exe
type: exitcode-stdio-1.0
Main-Is: Main.hs
Ghc-Options: -O0 -threaded
Build-Depends: vector:tests-O0

Ghc-Options: -O2 -threaded
Ghc-Options: -fno-warn-missing-signatures
test-suite vector-tests-O2
import: tests-exe
type: exitcode-stdio-1.0
Main-Is: Main.hs
Ghc-Options: -O2 -threaded
Build-Depends: vector:tests-O2

test-suite vector-doctest
type: exitcode-stdio-1.0
Expand Down

0 comments on commit 663d920

Please sign in to comment.