doctest-parallel-0.2.6: Test interactive Haskell examples
Safe HaskellNone
LanguageHaskell2010

Test.DocTest.Internal.Runner

Synopsis

Documentation

data FromSetup Source #

Whether an "example" is part of setup block

Constructors

FromSetup 
NotFromSetup 

data Summary Source #

Summary of a test run.

Constructors

Summary 

Fields

  • sExamples :: Int

    Total number of lines of examples (excluding setup)

  • sTried :: Int

    Executed sTried lines so far

  • sErrors :: Int

    Couldn't execute sErrors examples

  • sFailures :: Int

    Got unexpected output for sFailures examples

Instances

Instances details
Eq Summary Source # 
Instance details

Defined in Test.DocTest.Internal.Runner

Methods

(==) :: Summary -> Summary -> Bool #

(/=) :: Summary -> Summary -> Bool #

Show Summary Source #

Format a summary.

Instance details

Defined in Test.DocTest.Internal.Runner

Semigroup Summary Source # 
Instance details

Defined in Test.DocTest.Internal.Runner

Monoid Summary Source #

Sum up summaries.

Instance details

Defined in Test.DocTest.Internal.Runner

runModules Source #

Arguments

:: ModuleConfig

Configuration options specific to module

-> Maybe Int

Number of threads to use. Defaults to getNumProcessors.

-> Bool

Verbose

-> Bool

Implicit Prelude

-> [String]

Arguments passed to the GHCi process.

-> Bool

Quiet mode activated

-> [Module [Located DocTest]]

Modules under test

-> IO Summary 

Run all examples from a list of modules.

count :: Module [Located DocTest] -> Int Source #

Count number of expressions in given module.

type Report = StateT ReportState IO Source #

A monad for generating test reports.

data ReportState Source #

Constructors

ReportState 

Fields

report :: String -> Report () Source #

Add output to the report.

report_ :: String -> Report () Source #

Add intermediate output to the report.

This will be overwritten by subsequent calls to report/report_. Intermediate out may not contain any newlines.

overwrite :: String -> Report () Source #

Add output to the report, overwrite any intermediate out.

shuffle :: Int -> [a] -> [a] Source #

Shuffle a list given a seed for an RNG

runModule :: ModuleConfig -> Bool -> [String] -> Chan ReportUpdate -> Module [Located DocTest] -> IO () Source #

Run all examples from given module.

data ReportUpdate Source #

Constructors

UpdateSuccess FromSetup Location

Test succeeded

UpdateFailure FromSetup Location Expression [String]

Test failed with unexpected result

UpdateError FromSetup Location Expression String

Test failed with an error

UpdateVerbose String

Message to send when verbose output is activated

UpdateModuleDone

All examples tested in module

UpdateStart Location Expression String

Indicate test has started executing (verbose output)

UpdateInternalError FromSetup (Module [Located DocTest]) SomeException

Exception caught while executing internal code

UpdateImportError ModuleName (Either String String)

Could not import module

UpdateOptionError Location String

Unrecognized flag in module specific option

runTestGroup :: FromSetup -> Bool -> Interpreter -> IO () -> Chan ReportUpdate -> [Located DocTest] -> IO Bool Source #

Run given test group.

The interpreter state is zeroed with :reload first. This means that you can reuse the same Interpreter for several test groups.

runExampleGroup :: FromSetup -> Bool -> Interpreter -> Chan ReportUpdate -> [Located Interaction] -> IO Bool Source #

Execute all expressions from given example in given Interpreter and verify the output.