Test Anything Protocol

The Test Anything Protocol (TAP) is a protocol for communicating between test logic, called a TAP producer, and a test 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 the Perl programming language (released in 1987), as part of the Perl's core test harness. The  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.

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

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, MySQL, JavaScript and other implementations listed on the project site. A TAP C library is included as part of the FreeBSD Unix distribution and is used in the system's regression test suite.

Specification
A formal specification for this protocol exists in the  and   modules. The behavior of the  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.

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

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