Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion cabal-install/Distribution/Client/ProjectPlanning.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1211,7 +1211,7 @@ elaborateInstallPlan verbosity platform compiler compilerprogdb pkgConfigDB
where
-- You are eligible to per-component build if this list is empty
why_not_per_component g
= cuz_custom ++ cuz_spec ++ cuz_length ++ cuz_flag
= cuz_custom ++ cuz_spec ++ cuz_length ++ cuz_flag ++ cuz_coverage
where
cuz reason = [text reason]
-- At this point in time, only non-Custom setup scripts
Expand Down Expand Up @@ -1243,6 +1243,12 @@ elaborateInstallPlan verbosity platform compiler compilerprogdb pkgConfigDB
| fromFlagOrDefault True (projectConfigPerComponent sharedPackageConfig)
= []
| otherwise = cuz "you passed --disable-per-component"
-- Enabling program coverage introduces odd runtime dependencies
-- between components.
cuz_coverage
| fromFlagOrDefault False (packageConfigCoverage localPackagesConfig)
= cuz "program coverage is enabled"
| otherwise = []

-- | Sometimes a package may make use of features which are only
-- supported in per-package mode. If this is the case, we should
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import qualified Control.Exception as E (IOException, catch)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Data.Maybe (catMaybes)

import qualified Distribution.Verbosity as Verbosity

import Test.Cabal.Prelude

main =
forM_ (choose4 [True, False]) $ \(libProf, exeProf, exeDyn, shared) ->
do
let
opts = catMaybes
[ enable libProf "library-profiling"
, enable exeProf "profiling"
, enable exeDyn "executable-dynamic"
, enable shared "shared"
]
where
enable cond flag
| cond = Just $ "--enable-" ++ flag
| otherwise = Nothing
args = "test-Short" : "--enable-coverage" : opts
cabalTest . recordMode DoNotRecord $ do
hasShared <- hasSharedLibraries
hasProfiled <- hasProfiledLibraries
hpcOk <- liftIO $ correctHpcVersion
let
skip =
not hpcOk
|| (not hasShared && (exeDyn || shared))
|| (not hasProfiled && (libProf || exeProf))
unless skip $ cabal "new-test" args
where
choose4 :: [a] -> [(a, a, a, a)]
choose4 xs = liftM4 (,,,) xs xs xs xs

-- | Checks for a suitable HPC version for testing.
correctHpcVersion :: IO Bool
correctHpcVersion = do
let programDb' = emptyProgramDb
let verbosity = Verbosity.normal
let verRange = orLaterVersion (mkVersion [0,7])
programDb <- configureProgram verbosity hpcProgram programDb'
(requireProgramVersion verbosity hpcProgram verRange programDb
>> return True) `catchIO` (\_ -> return False)
where
-- Distribution.Compat.Exception is hidden.
catchIO :: IO a -> (E.IOException -> IO a) -> IO a
catchIO = E.catch

This file was deleted.

Empty file.
18 changes: 0 additions & 18 deletions cabal-testsuite/PackageTests/TestSuiteTests/ExeV10/setup.out

This file was deleted.

This file was deleted.