Safe Haskell | None |
---|---|
Language | Haskell2010 |
A mostly-complete test selection and execution program for
running HUnit-Plus tests. The only thing missing are the actual
test suites, which are provided as parameters to createMain
.
Given a set of test suites, module can be used to create a test execution program as follows:
module Main(main) where import Test.HUnitPlus.Main import MyProgram.Tests(testsuites) main :: IO () main = createMain testsuites
Where testsuites
is a list of TestSuite
s.
The resulting program, when executed with no arguments will execute
all test suites and write a summary to stdout
. Additionally, the
test program has a number of options that control reporting and
test execution.
A summary of the options follows:
-c mode, --consolemode=mode
: Set the behavior of console reporting to mode. Can bequiet
,terminal
,text
, andverbose
. Default isterminal
.-t [file], --txtreport[=file]
: Write a text report to file (if specified; if not, the default is 'report.txt'). Formatting of the report is the same as theverbose
terminal mode.-x [file], --xmlreport[=file]
: Write a JUnit-style XML report to file (if specified; if not, the default is 'report.xml').-l file, --testlist=file
: Read a testlist from file. The file must contain a number of filters, one per line. Empty lines or lines beginning with '#' are ignored. Multiple files may be specified. The filters from all files are combined, and added to any filters specified on the command line.
Any additional arguments are assumed to be filters, which specify a
set of tests to be run. For more information on the format of
filters, see the Filter
module. If no filters are
given either on the command line or in testlist files, then all
tests will be run.
Documentation
Command-line options for generated programs.
Opts | |
|
data ConsoleMode Source
Console mode options.
Quiet | Do not generate any console output. |
Terminal | Report test counts interactively during execution, updating the number of tests run, skipped, failed, and errored as they execute. |
Text | Report a summary of tests run, skipped, failed, and errored after execution. |
Verbose | Report extra information as tests execute. |
Command-line options for the System.Console.CmdArgs module.
createMain :: [TestSuite] -> IO () Source
Create a standard test execution program from a set of test
suites. The resulting main
will process command line options as
described, execute the appropirate tests, and exit with success if
all tests passed, and fail otherwise.