Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Haskell
Wiki community
Recent changes
Random page
HaskellWiki
Search
Search
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
HUnit 1.0 User's Guide
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Test Execution === All test controllers share a common test execution model. They differ only in how the results of test execution are shown. The execution of a test (a value of type <code>Test</code>) involves the serial execution (in the <code>IO</code> monad) of its constituent test cases. The test cases are executed in a depth-first, left-to-right order. During test execution, four counts of test cases are maintained: <haskell> data Counts = Counts { cases, tried, errors, failures :: Int } deriving (Eq, Show, Read) </haskell> * <code>cases</code> is the number of test cases included in the test. This number is a static property of a test and remains unchanged during test execution. * <code>tried</code> is the number of test cases that have been executed so far during the test execution. * <code>errors</code> is the number of test cases whose execution ended with an unexpected exception being raised. Errors indicate problems with test cases, as opposed to the code under test. * <code>failures</code> is the number of test cases whose execution asserted failure. Failures indicate problems with the code under test. Why is there no count for test case successes? The technical reason is that the counts are maintained such that the number of test case successes is always equal to <code>(tried - (errors + failures))</code>. The psychosocial reason is that, with test-centered development and the expectation that test failures will be few and short-lived, attention should be focused on the failures rather than the successes. As test execution proceeds, three kinds of reporting event are communicated to the test controller. (What the controller does in response to the reporting events depends on the controller.) ; start : Just prior to initiation of a test case, the path of the test case and the current counts (excluding the current test case) are reported. ; error : When a test case terminates with an error, the error message is reported, along with the test case path and current counts (including the current test case). ; failure : When a test case terminates with a failure, the failure message is reported, along with the test case path and current counts (including the test case). Typically, a test controller shows ''error'' and ''failure'' reports immediately but uses the ''start'' report merely to update an indication of overall test execution progress.
Summary:
Please note that all contributions to HaskellWiki are considered to be released under simple permissive license (see
HaskellWiki:Copyrights
for details). If you don't want your writing to be edited mercilessly and redistributed at will, then don't submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
DO NOT SUBMIT COPYRIGHTED WORK WITHOUT PERMISSION!
Cancel
Editing help
(opens in new window)
Toggle limited content width