Test Anything Protocol

Test Anything Protocol

The Test Anything Protocol (TAP) is a protocol to allow communication betwen 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

TAP was created for the first version of Perl (released in 1987), as part of the Perl's core test harness (t/TEST). The module was written by Tim Bunce and Andreas König to allow Perl module authors to take advantage of TAP.

Development of TAP, including standardization of the protocol, writing of test producers and consumers, and evangelizing the language is coordinated at the TestAnything websitecite web |url=http://www.testanything.org/ |title=The Test Anything Protocol website |accessdate=2008-09-04] .

Specification

Despite being almost 20 years old and widely used, no formal specification exists for this protocol. The behavior of the Test::Harness module is the de-facto TAP standard, along with a writeup of the specification on CPANcite web |url=http://search.cpan.org/perldoc/TAP |title=TAP specification |accessdate=2008-09-04 | publisher=CPAN ] .

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

Usage examples

TAP's general format is:

1..N ok 1 Description # Directive # Diagnostic .... ok 47 Description ok 48 Description more tests....

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 ok 3 - Read the rest of the file not ok 4 - Summarized correctly # TODO Not written yet

External Links

* [http://testanything.org/ http://testanything.org/] is a site dedicated to the discussion, development and promotion of TAP.

List of TAP Parsers

These are libraries which parse TAP and display the results.

* [http://search.cpan.org/dist/Test-Harness/ Test::Harness] is the oldest and most complete TAP parser. It is limited in how it displays TAP. Though it most often runs tests written in Perl, it can launch any process which generates TAP. Most of the TAP spec is taken from the behavior of Test::Harness.
** The original Test::Harness has now been deprecated, the new Test::Harness provides a minimal compatibility layer with previous behavior, but any new development shouldn't use this module, rather the T

* The t/TEST parser contained in the Perl source code.
* [http://search.cpan.org/dist/TAP-Parser/ T
] is a new and more flexible parser being written by Curtis "Ovid" Poe, Andy Armstrong and other people. It was formerly called TAPx::Parser. It will shortly become Test::Harness 3.
* [http://web-cpan.berlios.de/modules/Test-Run/ Test::Run] is a fork of Test::Harness being written by Shlomi Fish.
* [http://www.digitalsandwich.com/archives/52-TAP-Compliant-PHP-Testing-Harness.html test-harness.php] A TAP parser for PHP.

List of TAP Producers

These are libraries for writing tests which output TAP.

* [http://search.cpan.org/perldoc?Test::More Test::More] is the most popular testing module for Perl.
* [http://www.phpunit.de/ PHPUnit] is the xUnit implementation for PHP.
* [http://shiflett.org/code/test-more.php test-more.php] is a testing module for PHP based on Test::More.
* [http://jc.ngo.org.uk/trac-bin/trac.cgi/wiki/LibTap libtap] is a TAP producer written in C.
* [http://openjsan.org/doc/t/th/theory/Test/Simple/ Test.Simple] is a port of the Perl Test::Simple and Test::More modules to JavaScript by David Wheeler.
* [http://git.codesimply.com/?p=PyTAP.git;a=summary PyTAP] A beginning TAP implementation for Python.
* [http://www.kindahl.net/mytap/doc/ MyTAP] MySQL unit test library used for writing TAP producers in C or C++
* [http://rubyforge.org/projects/test-spec Bacon] A Ruby library that supports a spec-based syntax and that can produce TAP output
* [http://code.google.com/p/pluto-test-framework/ PLUTO] PL/SQL Unit Testing for Oracle
* [http://pgtap.projects.postgresql.org/ pgTAP] PostgreSQL stored procedures that emit TAP
* [http://www.snaptest.net SnapTest] a PHP unit testing framework with TAP v13 compliant output.

References


Wikimedia Foundation. 2010.

Игры ⚽ Нужен реферат?

Look at other dictionaries:

  • Second Test, 2007–08 Border-Gavaskar Trophy — Umpire Steve Bucknor, whose decisions in the Test were controversial and led to him being dropped from officiating in the Third Test …   Wikipedia

  • Turing test — dablink|For the Doctor Who novel named after the test, see The Turing Test (novel).For the opera named after the test, see under the composer, Julian Wagstaff.The Turing test is a proposal for a test of a machine s ability to demonstrate… …   Wikipedia

  • Second Test, 2007-08 Border-Gavaskar Trophy — The Second Test in the Indian cricket team s tour of Australia for the 2007/08 summer was a controversial Test cricket match played over five days at the Sydney Cricket Ground from January 2 to January 6 2008. Australia won the match by 122 runs… …   Wikipedia

  • BitTorrent (protocol) — BitTorrent is a peer to peer file sharing protocol used to distribute large amounts of data. The initial distributor of the complete file or collection acts as the first seed . Each peer who downloads the data also uploads them to other peers.… …   Wikipedia

  • TAP — may refer to: * Tap (valve), controls the release of a liquid or gas * Tap or Flap consonant, a type of consonantal sound * Telephone tapping, the monitoring of telephone conversations by a third party * Tap (transformer), an intermediate… …   Wikipedia

  • Liste von Modultest-Software — Inhaltsverzeichnis 1 ABAP 2 C 3 C++ 4 Cobol 5 Delphi …   Deutsch Wikipedia

  • Tap — Unter Tap versteht man: einen Tanzschritt, siehe Tap (Tanzschritt) eine Artikulationsart, siehe Tap (Phonetik) Tap ist der Nachname des in der Schweiz lebenden kambodschanischen Künstlers Paintwo Die Abkürzung TAP steht für: „Tandem Affinity… …   Deutsch Wikipedia

  • Comparison of web application frameworks — This is a comparison of notable web application frameworks. Contents 1 General 1.1 Perl 1.2 PHP 1.3 Java 1.4 Python …   Wikipedia

  • Сравнение каркасов веб-приложений — Это сравнительная таблица фреймворков веб приложений. Содержание 1 Фреймворки 1.1 ASP.NET 1.2 C++ 1.3 ColdFusion Markup Language (CFML) …   Википедия

  • Coronary artery bypass surgery — Heart bypass redirects here. For the technique to take over the function of the heart and lungs during surgery, see Cardiopulmonary bypass. Coronary artery bypass surgery Intervention Early in a coronary artery bypass sur …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”