-
Notifications
You must be signed in to change notification settings - Fork 697
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow per-component builds with coverage enabled
This commits re-enables per-component builds when coverage checking is enabled. This restriction was previously added in #5004 to fix #4798. However, the fix for #5213, in #7493, fixes the paths of the testsuite `.mix` files to the same location as that of the main library component, which in turn fixes #4798 as well -- meaning the restriction to treat testsuites per-package (legacy-fallback) is no longer needed. Lifting this restriction additionally fixes #6440 as we no longer constrain coverage to per-package builds only, thus allowing multi-libs. To generate hpc files in the appropriate component directories in the distribution tree, we move the hack from #7493 from dictating the `.mix` directories where hpc information is stored to dictating the `.mix` directories that are included in the call to `hpc markup`. Includes regression tests for #6440 and #4798 (the test for #5213 already exists) Fixes #6440, and the already previously fixed #4798, #5213.
- Loading branch information
Showing
14 changed files
with
126 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
cabal-version: 3.0 | ||
name: T4798 | ||
version: 0.1 | ||
|
||
library | ||
exposed-modules: U2F, U2F.Types | ||
ghc-options: -Wall | ||
build-depends: base | ||
hs-source-dirs: src | ||
default-language: Haskell2010 | ||
|
||
test-suite hspec-suite | ||
type: exitcode-stdio-1.0 | ||
main-is: test.hs | ||
ghc-options: -Wall | ||
hs-source-dirs: tests | ||
default-language: Haskell2010 | ||
build-depends: base, T4798 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
packages: . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import Test.Cabal.Prelude | ||
main = cabalTest $ cabal "test" ["--enable-coverage"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module U2F where | ||
|
||
import U2F.Types | ||
|
||
ourCurve :: String | ||
ourCurve = show SEC_p256r1 |
3 changes: 3 additions & 0 deletions
3
cabal-testsuite/PackageTests/Regression/T4798/src/U2F/Types.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module U2F.Types where | ||
|
||
data Curve = SEC_p256r1 deriving Show |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import U2F | ||
import U2F.Types | ||
|
||
main = print ourCurve | ||
main :: IO () | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
packages: . | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import Test.Cabal.Prelude | ||
main = cabalTest $ cabal "test" ["--enable-coverage"] |
23 changes: 23 additions & 0 deletions
23
cabal-testsuite/PackageTests/Regression/T6440/cabal6440.cabal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
cabal-version: 3.0 | ||
name: cabal6440 | ||
version: 0.1 | ||
|
||
library | ||
exposed-modules: Top | ||
-- other-extensions: | ||
build-depends: base, cabal6440:intern6440 | ||
hs-source-dirs: src | ||
default-language: Haskell2010 | ||
|
||
library intern6440 | ||
exposed-modules: Inn | ||
build-depends: base | ||
hs-source-dirs: srcint | ||
|
||
|
||
test-suite tests | ||
main-is: Main.hs | ||
type: exitcode-stdio-1.0 | ||
build-depends: base, cabal6440 | ||
hs-source-dirs: tests | ||
default-language: Haskell2010 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module Top where | ||
import Inn | ||
|
||
foo :: String | ||
foo = bar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module Inn where | ||
|
||
bar :: String | ||
bar = "internal" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module Main where | ||
|
||
import Top | ||
|
||
main :: IO () | ||
main = print foo |