Skip to content
Snippets Groups Projects
Commit cf378963 authored by andreas.abel's avatar andreas.abel
Browse files

cabal-testsuite: Show instance for TestEnv

The `Show` instance for `TestEnv` is helpful in debugging testcases.
While it produces large Haskell expressions not for consumption by the
naked eye, it can be inspected in viewers like `ppshow`.

https://hackage.haskell.org/package/pretty-show
parent 06b5f12e
Branches ghc-8.6
No related merge requests found
...@@ -530,6 +530,7 @@ data TestEnv = TestEnv ...@@ -530,6 +530,7 @@ data TestEnv = TestEnv
-- relative to 'testSourceDir' -- relative to 'testSourceDir'
, testSourceCopyRelativeDir :: FilePath , testSourceCopyRelativeDir :: FilePath
} }
deriving Show
testRecordMode :: TestEnv -> RecordMode testRecordMode :: TestEnv -> RecordMode
testRecordMode env = fromMaybe (testRecordDefaultMode env) (testRecordUserMode env) testRecordMode env = fromMaybe (testRecordDefaultMode env) (testRecordUserMode env)
......
...@@ -19,11 +19,13 @@ import Control.Monad ...@@ -19,11 +19,13 @@ import Control.Monad
-- TODO: index this -- TODO: index this
data Plan = Plan { planInstallPlan :: [InstallItem] } data Plan = Plan { planInstallPlan :: [InstallItem] }
deriving Show
data InstallItem data InstallItem
= APreExisting = APreExisting
| AConfiguredGlobal ConfiguredGlobal | AConfiguredGlobal ConfiguredGlobal
| AConfiguredInplace ConfiguredInplace | AConfiguredInplace ConfiguredInplace
deriving Show
-- local or inplace package -- local or inplace package
data ConfiguredInplace = ConfiguredInplace data ConfiguredInplace = ConfiguredInplace
...@@ -31,11 +33,13 @@ data ConfiguredInplace = ConfiguredInplace ...@@ -31,11 +33,13 @@ data ConfiguredInplace = ConfiguredInplace
, configuredInplaceBuildInfo :: Maybe FilePath , configuredInplaceBuildInfo :: Maybe FilePath
, configuredInplacePackageName :: PackageName , configuredInplacePackageName :: PackageName
, configuredInplaceComponentName :: Maybe ComponentName } , configuredInplaceComponentName :: Maybe ComponentName }
deriving Show
data ConfiguredGlobal = ConfiguredGlobal data ConfiguredGlobal = ConfiguredGlobal
{ configuredGlobalBinFile :: Maybe FilePath { configuredGlobalBinFile :: Maybe FilePath
, configuredGlobalPackageName :: PackageName , configuredGlobalPackageName :: PackageName
, configuredGlobalComponentName :: Maybe ComponentName } , configuredGlobalComponentName :: Maybe ComponentName }
deriving Show
instance FromJSON Plan where instance FromJSON Plan where
parseJSON (Object v) = fmap Plan (v .: "install-plan") parseJSON (Object v) = fmap Plan (v .: "install-plan")
......
...@@ -37,6 +37,7 @@ data ScriptEnv = ScriptEnv ...@@ -37,6 +37,7 @@ data ScriptEnv = ScriptEnv
, runnerPackages :: [(OpenUnitId, ModuleRenaming)] , runnerPackages :: [(OpenUnitId, ModuleRenaming)]
, runnerWithSharedLib :: Bool , runnerWithSharedLib :: Bool
} }
deriving Show
{- {-
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment