automake-1.16: Introduction to TAP
15.4.1 Introduction to TAP
--------------------------
TAP, the Test Anything Protocol, is a simple text-based interface
between testing modules or programs and a test harness. The tests (also
called “TAP producers” in this context) write test results in a simple
format on standard output; a test harness (also called “TAP consumer”)
will parse and interpret these results, and properly present them to the
user, and/or register them for later analysis. The exact details of how
this is accomplished can vary among different test harnesses. The
Automake harness will present the results on the console in the usual
fashion (⇒Testsuite progress on console), and will use the ‘.trs’
files (⇒Basics of test metadata) to store the test results and
related metadata. Apart from that, it will try to remain as compatible
as possible with pre-existing and widespread utilities, such as the
‘prove’ utility
(https://metacpan.org/pod/distribution/Test-Harness/bin/prove), at least
for the simpler usages.
TAP started its life as part of the test harness for Perl, but today
it has been (mostly) standardized, and has various independent
implementations in different languages; among them, C, C++, Perl,
Python, PHP, and Java. For a semi-official specification of the TAP
protocol, please refer to the documentation of ‘Test::Harness’
(https://metacpan.org/pod/Test::Harness).
The most relevant real-world usages of TAP are obviously in the
testsuites of ‘perl’ and of many Perl modules. Still, other important
third-party packages, such as ‘git’ (https://git-scm.com/), also use TAP
in their testsuite.