File tree Expand file tree Collapse file tree 4 files changed +8
-9
lines changed
cabal-testsuite/src/Test/Cabal Expand file tree Collapse file tree 4 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -336,7 +336,6 @@ runTestM mode m = withSystemTempDirectory "cabal-testsuite" $ \tmp_dir -> do
336
336
testPlan = Nothing ,
337
337
testRecordDefaultMode = DoNotRecord ,
338
338
testRecordUserMode = Nothing ,
339
- testRecordNormalizer = id ,
340
339
testSourceCopyRelativeDir = " source"
341
340
}
342
341
let go = do cleanup
@@ -527,12 +526,11 @@ data TestEnv = TestEnv
527
526
, testRecordDefaultMode :: RecordMode
528
527
-- | User explicitly set record mode. Not implemented ATM.
529
528
, testRecordUserMode :: Maybe RecordMode
530
- -- | Function to normalize recorded output
531
- , testRecordNormalizer :: String -> String
532
529
-- | Name of the subdirectory we copied the test's sources to,
533
530
-- relative to 'testSourceDir'
534
531
, testSourceCopyRelativeDir :: FilePath
535
532
}
533
+ deriving Show
536
534
537
535
testRecordMode :: TestEnv -> RecordMode
538
536
testRecordMode env = fromMaybe (testRecordDefaultMode env) (testRecordUserMode env)
Original file line number Diff line number Diff line change @@ -19,23 +19,27 @@ import Control.Monad
19
19
20
20
-- TODO: index this
21
21
data Plan = Plan { planInstallPlan :: [InstallItem ] }
22
+ deriving Show
22
23
23
24
data InstallItem
24
25
= APreExisting
25
26
| AConfiguredGlobal ConfiguredGlobal
26
27
| AConfiguredInplace ConfiguredInplace
28
+ deriving Show
27
29
28
30
-- local or inplace package
29
31
data ConfiguredInplace = ConfiguredInplace
30
32
{ configuredInplaceDistDir :: FilePath
31
33
, configuredInplaceBuildInfo :: Maybe FilePath
32
34
, configuredInplacePackageName :: PackageName
33
35
, configuredInplaceComponentName :: Maybe ComponentName }
36
+ deriving Show
34
37
35
38
data ConfiguredGlobal = ConfiguredGlobal
36
39
{ configuredGlobalBinFile :: Maybe FilePath
37
40
, configuredGlobalPackageName :: PackageName
38
41
, configuredGlobalComponentName :: Maybe ComponentName }
42
+ deriving Show
39
43
40
44
instance FromJSON Plan where
41
45
parseJSON (Object v) = fmap Plan (v .: " install-plan" )
Original file line number Diff line number Diff line change @@ -679,7 +679,7 @@ recordHeader args = do
679
679
env <- getTestEnv
680
680
let mode = testRecordMode env
681
681
str_header = " # " ++ intercalate " " args ++ " \n "
682
- header = C. pack (testRecordNormalizer env str_header)
682
+ header = C. pack str_header
683
683
case mode of
684
684
DoNotRecord -> return ()
685
685
_ -> do
@@ -696,7 +696,7 @@ recordLog res = do
696
696
liftIO $ C. appendFile (testWorkDir env </> " test.log" )
697
697
(C. pack $ " + " ++ resultCommand res ++ " \n "
698
698
++ resultOutput res ++ " \n\n " )
699
- liftIO . C. appendFile (testActualFile env) . C. pack . testRecordNormalizer env $
699
+ liftIO . C. appendFile (testActualFile env) . C. pack $
700
700
case mode of
701
701
RecordAll -> unlines (lines (resultOutput res))
702
702
RecordMarked -> getMarkedOutput (resultOutput res)
@@ -787,10 +787,6 @@ recordMode mode = withReaderT (\env -> env {
787
787
testRecordUserMode = Just mode
788
788
})
789
789
790
- recordNormalizer :: (String -> String ) -> TestM a -> TestM a
791
- recordNormalizer f =
792
- withReaderT (\ env -> env { testRecordNormalizer = testRecordNormalizer env . f })
793
-
794
790
assertOutputContains :: MonadIO m => WithCallStack (String -> Result -> m () )
795
791
assertOutputContains needle result =
796
792
withFrozenCallStack $
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ data ScriptEnv = ScriptEnv
37
37
, runnerPackages :: [(OpenUnitId , ModuleRenaming )]
38
38
, runnerWithSharedLib :: Bool
39
39
}
40
+ deriving Show
40
41
41
42
{-
42
43
You can’t perform that action at this time.
0 commit comments