packages feed

atomic-primops-0.5.0.2: testing/test-atomic-primops.cabal

-- Trying a completely separate .cabal for testing.

Name:                test-atomic-primops
Version:             0.5.0.2
Build-type:          Simple
Cabal-version:       >=1.8

Flag opt
    Description: Enable GHC optimization.
    Default: True

Flag threaded
    Description: Enable GHC threaded RTS.
    Default: True

Flag withTH
     Description: Build the test suite, including the template-haskell-atomic-primops executable.
     Default: False

Test-Suite test-atomic-primops
    type:       exitcode-stdio-1.0
    main-is:    Test.hs
    ghc-options: -rtsopts

    if flag(opt)
       ghc-options: -O2 -funbox-strict-fields
    if flag(threaded)
       ghc-options: -threaded 

    -- Set it to always run with some parallelism.
    ghc-options: -rtsopts -with-rtsopts=-N4
       
    build-depends: base, ghc-prim, primitive, containers, random, atomic-primops >= 0.5,
                   -- For Testing:
                   time, HUnit, test-framework, test-framework-hunit

    -- Optional: Debugging generated code:
    --    ghc-options: -keep-tmp-files -dsuppress-module-prefixes -ddump-to-file -ddump-core-stats -ddump-simpl-stats -dcore-lint -dcmm-lint
    --    ghc-options: -ddump-ds -ddump-simpl -ddump-stg -ddump-asm -ddump-bcos -ddump-cmm -ddump-opt-cmm -ddump-inlinings

-- Cabal can get confused if there is no executable or library... so here's a dummy executable.
-- Also it provides a good test of compile/link issues, apart from everything else.
Executable hello-world-atomic-primops
  main-is: hello.hs
  build-depends: base >= 4.5, atomic-primops

-- This is separated out, because a bug in GHC 7.6 make this fail on Linux.
Test-suite template-haskell-atomic-primops
  type:       exitcode-stdio-1.0
  main-is: ghci-test.hs
  if flag(withTH) {
    Buildable: True
    build-depends: base >= 4.5, atomic-primops >= 0.5, template-haskell,
                   -- For Testing:
                   test-framework, test-framework-hunit
  } else {
    Buildable: False
  }