![]() More information about libtap, including download links, checksums, anonymous access to the Subersion repository, and a bug tracking system, can be found at:Īndy Lester, based on the original Test::Harness documentation by Michael Schwern. Modeled on the Test::More API, libtap contains all the functions you need to: Libtap makes it easy to write test programs in C that produce TAP-compatible output. The following sections are provided by their maintainers, and may not be up-to-date. Other languages have solutions that generate TAP, so that they can take advantage of Test::Harness. In Perl, we use Test::Simple and Test::More to generate TAP output. The following TAP listing declares that six tests follow as well as provides handy feedback as to what the test is about to do. Any such similarity is purely coincidental, unintentional, and unintended. EXAMPLESĪll names, places, and events depicted in any example are wholly fictitious and bear no resemblance to, connection with, or relation to any real entity. TAP::Harness reports TAP syntax errors at the end of a test run. Test::Harness silently ignores incorrect lines, but will become more stringent in the future. This is to allow for forward compatability. A TAP parser is required to not consider an unknown line as an error but may optionally choose to capture said line and hand it to the test harness, which may have custom behavior attached. # This starts the network part of the test.Īny output line that is not a version, a plan, a test line, a diagnostic or a bail out is considered an “unknown” line. If there is no number the harness must maintain its own counter until the script supplies test numbers again. TAP expects the ok or not ok to be followed by a test point number. Note that unlike the Directives below, ok and not ok are case-sensitive. This is the only mandatory part of the line. This tells whether the test point passed or failed. Each test line comprises the following elements: There must be at least one test line in TAP output. A test file prints one test line per test point executed. The plan cannot appear in the middle of the output, nor can it appear more than once. In this case the plan can be the last non-diagnostic line in the output. ![]() In certain instances a test file may not know how many test points it will ultimately be running. The plan is optional but if there is a plan before the test points it must be the first non-diagnostic line output by the test file. This is a safeguard in case your test file dies silently in the middle of its run.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |