Safe Haskell | None |
---|---|
Language | Haskell2010 |
HUnit utilities
Synopsis
- data HUnitGroupLabelNotSpecifiedException
- data HUnitDuplicateGroupLabelException
- data HUnitLabelNotFoundException
- data HUnitNonListGroupException
- data HUnitExpectedExceptionNotThrown
- hunitCatchException :: Exception e => Text -> IO a -> IO e
- data HUnitMainException
- hunitMain :: Vector Test -> IO ()
- hunitRun :: Vector Test -> IO ()
- hunitRunGroup :: Vector Test -> Text -> IO ()
- hunitRunSingle :: Vector Test -> Text -> Text -> IO ()
Documentation
data HUnitGroupLabelNotSpecifiedException Source #
Exception which indicates that specified test group is invalid
Instances
Show HUnitGroupLabelNotSpecifiedException Source # | |
Defined in VtUtils.HUnit | |
Exception HUnitGroupLabelNotSpecifiedException Source # | |
data HUnitDuplicateGroupLabelException Source #
Exception thrown on the duplicate group label
Instances
Show HUnitDuplicateGroupLabelException Source # | |
Defined in VtUtils.HUnit | |
Exception HUnitDuplicateGroupLabelException Source # | |
data HUnitLabelNotFoundException Source #
Exception thrown if specified label not found
Instances
data HUnitNonListGroupException Source #
Exception thrown if specified group does not contain a list of tests
Instances
data HUnitExpectedExceptionNotThrown Source #
Exception for hunitCatchException
function
Instances
Show HUnitExpectedExceptionNotThrown Source # | |
Defined in VtUtils.HUnit | |
Exception HUnitExpectedExceptionNotThrown Source # | |
hunitCatchException :: Exception e => Text -> IO a -> IO e Source #
Runs the specified action and catches and returs exception of the specified type
Throws an exception, if exception of specified type is not thrown by the specified action
Arguments:
msg :: Text
: Error message to include with exception that is thrown on erroraction :: IO a
IO action that should throw the exception
Return value: exception record thrown by the specified action
data HUnitMainException Source #
Exception for hunitMain
function
Instances
Show HUnitMainException Source # | |
Defined in VtUtils.HUnit showsPrec :: Int -> HUnitMainException -> ShowS # show :: HUnitMainException -> String # showList :: [HUnitMainException] -> ShowS # | |
Exception HUnitMainException Source # | |
Defined in VtUtils.HUnit |
hunitMain :: Vector Test -> IO () Source #
Runs all, group or one of specified HUnit
tests depending on the command line arguments
Example specifying argument to stack test
invocation:
stack test --ta "GroupName testName"
If no arguments are specified - all test are run.grlabel
If single argument is specified - it is interpreted as a name of the group.grlabel
If two argument are specified - first one is interpreted as a group name, and second one as a test name
Throws an exception on invalid command line argument
Tests results are printed to stdout
Arguments:
tests :: Vector Test
: HUnit tests to run
hunitRun :: Vector Test -> IO () Source #
Runs all HUnit tests from a specified Vector
Tests results are printed to stdout
Arguments:
tests :: Vector Test
: HUnit tests to run
hunitRunGroup :: Vector Test -> Text -> IO () Source #
Runs a subset of HUnit
tests with a specified label value
Throws an exception if no tests in the specified Vector
have specified label
or if some tests in the specified Vector
have no label at all
Tests results are printed to stdout
Arguments:
tests :: Vector Test
: HUnit testslabel :: Text
: Group label
hunitRunSingle :: Vector Test -> Text -> Text -> IO () Source #
Runs a single test from a specified Vector
of HUnit
tests
Throws an exception if a test with a specified group label and test label is not found in specified Vector of tests
Tests results are printed to stdout
Arguments:
tests :: Vector Test
: HUnit testsgrlabel :: Text
: Group labeltslabel :: Text
: Test label