fbpx
Wikipedia

Test Anything Protocol

The Test Anything Protocol (TAP) is a protocol to allow communication between unit tests and a test harness. It allows individual tests (TAP producers) to communicate test results to the testing harness in a language-agnostic way. Originally developed for unit testing of the Perl interpreter in 1987, producers and parsers are now available for many development platforms.

History edit

TAP was created for the first version of the Perl programming language (released in 1987), as part of the Perl's core test harness (t/TEST). The Test::Harness module was written by Tim Bunce and Andreas König to allow Perl module authors to take advantage of TAP. It became the de facto standard for Perl testing.[1][2][3]

Development of TAP, including standardization of the protocol, writing of test producers and consumers, and evangelizing the language is coordinated at the TestAnything website.[4]

As a protocol which is agnostic of programming language, TAP unit testing libraries expanded beyond their Perl roots and have been developed for various languages and systems such as PostgreSQL,[5] MySQL,[6] JavaScript[7] and other implementations listed on the project site.[4] A TAP C library is included as part of the FreeBSD Unix distribution and is used in the system's regression test suite.[8]

Specification edit

A formal specification for this protocol exists in the TAP::Spec::Parser and TAP::Parser::Grammar modules. The behavior of the Test::Harness module is the de facto TAP standard implementation, along with a writeup of the specification on https://testanything.org.

A project to produce an IETF standard for TAP was initiated in August 2008, at YAPC::Europe 2008.[4]

Usage examples edit

Here's an example of TAP's general format:

1..48 ok 1 Description # Directive # Diagnostic .... ok 47 Description ok 48 Description 

For example, a test file's output might look like:

1..4 ok 1 - Input file opened not ok 2 - First line of the input valid. More output from test 2. There can be arbitrary number of lines for any output so long as there is at least some kind of whitespace at beginning of line. ok 3 - Read the rest of the file #TAP meta information not ok 4 - Summarized correctly # TODO: not written yet 

See also edit

References edit

  1. ^ "A Perl toolbox for regression tests : Testing Tools". Nnc3.com. Retrieved 27 October 2017.
  2. ^ Schilli, Mike. "Print as Print Can » Linux Magazine". Linux Magazine. Retrieved 27 October 2017.
  3. ^ Szabo, Gabor. "TAP - Test Anything Protocol". Perl Maven. Retrieved 2019-08-07.
  4. ^ a b c "The Test Anything Protocol website". Testanything.org. Retrieved September 4, 2008.
  5. ^ McClive, Simon (2017-09-21). "Unit testing Postgres with pgTAP". Medium. Retrieved 2019-08-07.
  6. ^ Gravelle, Rob (2012-08-13). "Testing Your MySQL Stored Procedures with MyTAP". Database Journal. Retrieved 2019-08-07.
  7. ^ "Node Tap". Node Tap. Retrieved 2019-08-07.
  8. ^ "TAP(3) manual page". FreeBSD. Retrieved 2019-08-07.

External links edit

  • Site dedicated to the discussion, development and promotion of TAP

test, anything, protocol, this, article, about, software, unit, testing, protocol, known, network, tunnel, driver, this, article, needs, additional, citations, verification, please, help, improve, this, article, adding, citations, reliable, sources, unsourced,. This article is about the software unit testing protocol known as TAP For the network tunnel driver see TUN TAP This article needs additional citations for verification Please help improve this article by adding citations to reliable sources Unsourced material may be challenged and removed Find sources Test Anything Protocol news newspapers books scholar JSTOR October 2017 Learn how and when to remove this template message The Test Anything Protocol TAP is a protocol to allow communication between unit tests and a test harness It allows individual tests TAP producers to communicate test results to the testing harness in a language agnostic way Originally developed for unit testing of the Perl interpreter in 1987 producers and parsers are now available for many development platforms Contents 1 History 2 Specification 3 Usage examples 4 See also 5 References 6 External linksHistory editTAP was created for the first version of the Perl programming language released in 1987 as part of the Perl s core test harness t TEST The Test Harness module was written by Tim Bunce and Andreas Konig to allow Perl module authors to take advantage of TAP It became the de facto standard for Perl testing 1 2 3 Development of TAP including standardization of the protocol writing of test producers and consumers and evangelizing the language is coordinated at the TestAnything website 4 As a protocol which is agnostic of programming language TAP unit testing libraries expanded beyond their Perl roots and have been developed for various languages and systems such as PostgreSQL 5 MySQL 6 JavaScript 7 and other implementations listed on the project site 4 A TAP C library is included as part of the FreeBSD Unix distribution and is used in the system s regression test suite 8 Specification editA formal specification for this protocol exists in the TAP Spec Parser and TAP Parser Grammar modules The behavior of the Test Harness module is the de facto TAP standard implementation along with a writeup of the specification on https testanything org A project to produce an IETF standard for TAP was initiated in August 2008 at YAPC Europe 2008 4 Usage examples editHere s an example of TAP s general format 1 48 ok 1 Description Directive Diagnostic ok 47 Description ok 48 Description For example a test file s output might look like 1 4 ok 1 Input file opened not ok 2 First line of the input valid More output from test 2 There can be arbitrary number of lines for any output so long as there is at least some kind of whitespace at beginning of line ok 3 Read the rest of the file TAP meta information not ok 4 Summarized correctly TODO not written yetSee also editxUnitReferences edit A Perl toolbox for regression tests Testing Tools Nnc3 com Retrieved 27 October 2017 Schilli Mike Print as Print Can Linux Magazine Linux Magazine Retrieved 27 October 2017 Szabo Gabor TAP Test Anything Protocol Perl Maven Retrieved 2019 08 07 a b c The Test Anything Protocol website Testanything org Retrieved September 4 2008 McClive Simon 2017 09 21 Unit testing Postgres with pgTAP Medium Retrieved 2019 08 07 Gravelle Rob 2012 08 13 Testing Your MySQL Stored Procedures with MyTAP Database Journal Retrieved 2019 08 07 Node Tap Node Tap Retrieved 2019 08 07 TAP 3 manual page FreeBSD Retrieved 2019 08 07 External links editSite dedicated to the discussion development and promotion of TAP Retrieved from https en wikipedia org w index php title Test Anything Protocol amp oldid 1063420514, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.