@@ -66,24 +66,21 @@ deleteHpcReports = do
6666-- | Move a tix file into a sub-directory of the hpc report directory. Deletes the old one if one is
6767-- present.
6868updateTixFile :: (MonadIO m ,MonadReader env m ,HasConfig env ,MonadLogger m ,MonadBaseControl IO m ,MonadCatch m ,HasEnvConfig env )
69- => PackageName -> Path Abs File -> m ()
70- updateTixFile pkgName tixSrc = do
71- case stripSuffix " .tix" (toFilePath (filename tixSrc)) of
72- Nothing -> error " Invariant violated: updateTixFile expected a tix filepath."
73- Just testName -> do
74- exists <- fileExists tixSrc
75- when exists $ do
76- tixDest <- tixFilePath pkgName testName
77- removeFileIfExists tixDest
78- createTree (parent tixDest)
79- -- Remove exe modules because they are problematic. This could be revisited if there's a GHC
80- -- version that fixes https://ghc.haskell.org/trac/ghc/ticket/1853
81- mtix <- readTixOrLog tixSrc
82- case mtix of
83- Nothing -> $ logError $ " Failed to read " <> T. pack (toFilePath tixSrc)
84- Just tix -> do
85- liftIO $ writeTix (toFilePath tixDest) (removeExeModules tix)
86- removeFileIfExists tixSrc
69+ => PackageName -> Path Abs File -> String -> m ()
70+ updateTixFile pkgName tixSrc testName = do
71+ exists <- fileExists tixSrc
72+ when exists $ do
73+ tixDest <- tixFilePath pkgName testName
74+ removeFileIfExists tixDest
75+ createTree (parent tixDest)
76+ -- Remove exe modules because they are problematic. This could be revisited if there's a GHC
77+ -- version that fixes https://ghc.haskell.org/trac/ghc/ticket/1853
78+ mtix <- readTixOrLog tixSrc
79+ case mtix of
80+ Nothing -> $ logError $ " Failed to read " <> T. pack (toFilePath tixSrc)
81+ Just tix -> do
82+ liftIO $ writeTix (toFilePath tixDest) (removeExeModules tix)
83+ removeFileIfExists tixSrc
8784
8885testExeName :: (MonadReader env m ,HasConfig env ) => String -> m String
8986testExeName testName = do
0 commit comments