Skip to content

Commit 54f2185

Browse files
committed
Add a test for #5213 with coverage instead of library-coverage
and with `optimization: False`.
1 parent 596e89b commit 54f2185

File tree

7 files changed

+72
-0
lines changed

7 files changed

+72
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
-- Initial cabal-gh5213.cabal generated by cabal init. For further
2+
-- documentation, see http://haskell.org/cabal/users-guide/
3+
4+
name: cabal-gh5213
5+
version: 0.1
6+
-- synopsis:
7+
-- description:
8+
license: BSD3
9+
author: Ryan Scott
10+
maintainer: [email protected]
11+
-- copyright:
12+
category: Testing
13+
build-type: Simple
14+
cabal-version: >=1.10
15+
16+
library
17+
exposed-modules: CabalGH5213Exposed
18+
other-modules: CabalGH5213Other
19+
-- other-extensions:
20+
build-depends: base >= 4 && < 5
21+
hs-source-dirs: src
22+
default-language: Haskell2010
23+
24+
test-suite tests
25+
main-is: Main.hs
26+
type: exitcode-stdio-1.0
27+
build-depends: base, cabal-gh5213
28+
hs-source-dirs: tests
29+
default-language: Haskell2010
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# cabal new-test
2+
Resolving dependencies...
3+
Build profile: -w ghc-<GHCVER> -O1
4+
In order, the following will be built:
5+
- cabal-gh5213-0.1 (lib) (first run)
6+
- cabal-gh5213-0.1 (test:tests) (first run)
7+
Configuring library for cabal-gh5213-0.1..
8+
Preprocessing library for cabal-gh5213-0.1..
9+
Building library for cabal-gh5213-0.1..
10+
Configuring test suite 'tests' for cabal-gh5213-0.1..
11+
Warning: The package has an extraneous version range for a dependency on an internal library: cabal-gh5213 >=0 && ==0.1. This version range includes the current package but isn't needed as the current package's library will always be used.
12+
Preprocessing test suite 'tests' for cabal-gh5213-0.1..
13+
Building test suite 'tests' for cabal-gh5213-0.1..
14+
Running 1 test suites...
15+
Test suite tests: RUNNING...
16+
Test suite tests: PASS
17+
Test suite logged to: <ROOT>/cabal.dist/work/./dist/build/<ARCH>/ghc-<GHCVER>/cabal-gh5213-0.1/t/tests/test/cabal-gh5213-0.1-tests.log
18+
Test coverage report written to <ROOT>/cabal.dist/work/./dist/build/<ARCH>/ghc-<GHCVER>/cabal-gh5213-0.1/t/tests/hpc/vanilla/html/tests/hpc_index.html
19+
1 of 1 test suites (1 of 1 test cases) passed.
20+
Package coverage report written to <ROOT>/cabal.dist/work/./dist/build/<ARCH>/ghc-<GHCVER>/cabal-gh5213-0.1/t/tests/hpc/vanilla/html/cabal-gh5213-0.1/hpc_index.html
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
packages: .
2+
3+
package cabal-gh5213
4+
coverage: True
5+
optimization: False
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import Test.Cabal.Prelude
2+
main = cabalTest $ cabal "new-test" []
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module CabalGH5213Exposed where
2+
3+
import CabalGH5213Other
4+
5+
foo :: Int
6+
foo = bar
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module CabalGH5213Other where
2+
3+
bar :: Int
4+
bar = 42
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module Main where
2+
3+
import CabalGH5213Exposed
4+
5+
main :: IO ()
6+
main = print foo

0 commit comments

Comments
 (0)