Cabal-3.10.1.0: A framework for packaging Haskell software

Safe Haskell | Safe-Inferred
Language | Haskell2010

Distribution.Simple.Test.Log

Synopsis

- data PackageLog = PackageLog {
  - package :: PackageId
  - compiler :: CompilerId
  - platform :: Platform
  - testSuites :: [TestSuiteLog]
  }
- data TestLogs
  - = TestLog {
    - testName :: String
    - testOptionsReturned :: Options
    - testResult :: Result
    }
  - | GroupLogs String [TestLogs]
- data TestSuiteLog = TestSuiteLog {
  - testSuiteName :: UnqualComponentName
  - testLogs :: TestLogs
  - logFile :: FilePath
  }
- countTestResults :: TestLogs -> (Int, Int, Int)
- localPackageLog :: PackageDescription -> LocalBuildInfo -> PackageLog
- summarizePackage :: Verbosity -> PackageLog -> IO Bool
- summarizeSuiteFinish :: TestSuiteLog -> String
- summarizeSuiteStart :: String -> String
- summarizeTest :: Verbosity -> TestShowDetails -> TestLogs -> IO ()
- suiteError :: TestLogs -> Bool
- suiteFailed :: TestLogs -> Bool
- suitePassed :: TestLogs -> Bool
- testSuiteLogPath :: PathTemplate -> PackageDescription -> LocalBuildInfo -> String -> TestLogs -> FilePath

# Documentation

data PackageLog Source #

Logs all test results for a package, broken down first by test suite and then by test case.

Constructors

PackageLog |

Fields

- package :: PackageId
- compiler :: CompilerId
- platform :: Platform
- testSuites :: [TestSuiteLog]

#### Instances

Instances details

Read PackageLog Source # |
Instance details Defined in Distribution.Simple.Test.Log Methods readsPrec :: Int -> ReadS PackageLog Source # readList :: ReadS [PackageLog] Source # readPrec :: ReadPrec PackageLog Source # readListPrec :: ReadPrec [PackageLog] Source #
Show PackageLog Source # |
Instance details Defined in Distribution.Simple.Test.Log Methods showsPrec :: Int -> PackageLog -> ShowS Source # show :: PackageLog -> String Source # showList :: [PackageLog] -> ShowS Source #
Eq PackageLog Source # |
Instance details Defined in Distribution.Simple.Test.Log Methods (==) :: PackageLog -> PackageLog -> Bool # (/=) :: PackageLog -> PackageLog -> Bool #

data TestLogs Source #

Constructors

TestLog |

Fields

- testName :: String
- testOptionsReturned :: Options
- testResult :: Result

GroupLogs String [TestLogs] |

#### Instances

Instances details

Read TestLogs Source # |
Instance details Defined in Distribution.Simple.Test.Log Methods readsPrec :: Int -> ReadS TestLogs Source # readList :: ReadS [TestLogs] Source # readPrec :: ReadPrec TestLogs Source # readListPrec :: ReadPrec [TestLogs] Source #
Show TestLogs Source # |
Instance details Defined in Distribution.Simple.Test.Log Methods showsPrec :: Int -> TestLogs -> ShowS Source # show :: TestLogs -> String Source # showList :: [TestLogs] -> ShowS Source #
Eq TestLogs Source # |
Instance details Defined in Distribution.Simple.Test.Log Methods (==) :: TestLogs -> TestLogs -> Bool # (/=) :: TestLogs -> TestLogs -> Bool #

data TestSuiteLog Source #

Logs test suite results, itemized by test case.

Constructors

TestSuiteLog |

Fields

- testSuiteName :: UnqualComponentName
- testLogs :: TestLogs
- logFile :: FilePath

#### Instances

Instances details

Read TestSuiteLog Source # |
Instance details Defined in Distribution.Simple.Test.Log Methods readsPrec :: Int -> ReadS TestSuiteLog Source # readList :: ReadS [TestSuiteLog] Source # readPrec :: ReadPrec TestSuiteLog Source # readListPrec :: ReadPrec [TestSuiteLog] Source #
Show TestSuiteLog Source # |
Instance details Defined in Distribution.Simple.Test.Log Methods showsPrec :: Int -> TestSuiteLog -> ShowS Source # show :: TestSuiteLog -> String Source # showList :: [TestSuiteLog] -> ShowS Source #
Eq TestSuiteLog Source # |
Instance details Defined in Distribution.Simple.Test.Log Methods (==) :: TestSuiteLog -> TestSuiteLog -> Bool # (/=) :: TestSuiteLog -> TestSuiteLog -> Bool #

countTestResults Source #

Arguments

:: TestLogs |
-> (Int, Int, Int) | Passes, fails, and errors, respectively.

Count the number of pass, fail, and error test results in a `TestLogs` tree.

localPackageLog :: PackageDescription -> LocalBuildInfo -> PackageLog Source #

A `PackageLog` with package and platform information specified.

summarizePackage :: Verbosity -> PackageLog -> IO Bool Source #

Print a summary to the console after all test suites have been run indicating the number of successful test suites and cases. Returns `True` if all test suites passed and `False` otherwise.

summarizeSuiteFinish :: TestSuiteLog -> String Source #

Print a summary of the test suite's results on the console, suppressing output for certain verbosity or test filter levels.

summarizeSuiteStart :: String -> String Source #

summarizeTest :: Verbosity -> TestShowDetails -> TestLogs -> IO () Source #

Print a summary of a single test case's result to the console, suppressing output for certain verbosity or test filter levels.

suiteError :: TestLogs -> Bool Source #

From a `TestSuiteLog`, determine if the test suite encountered errors.

suiteFailed :: TestLogs -> Bool Source #

From a `TestSuiteLog`, determine if the test suite failed.

suitePassed :: TestLogs -> Bool Source #

From a `TestSuiteLog`, determine if the test suite passed.

testSuiteLogPath Source #

Arguments

:: PathTemplate |
-> PackageDescription |
-> LocalBuildInfo |
-> String | test suite name
-> TestLogs | test suite results
-> FilePath |