Simple Smoke!

Derek Carter (goozbach)

Testing (the why and how)

We test to know when things are wrong

Perl gave us a great protocol... the (then unamed) Test Anything Protocol "TAP"

ok 1 - one is one
ok 2 - one is not three
ok 3 - Foobar contains foo
ok 4 - Foobar does not contain baz
not ok 5 - Today is Tuesday
#   Failed test 'Today is Tuesday'
#   in bash-TAP/tap-functions:like() at line 313.
#     'Thursday' doesn't match 'Tuesday'
# Looks like you failed 1 test of 5.

TAP libraries exist in almost all languages

TAP (the protocol)

Extremely simple protocol

Has at least the following

may have the following

other advanced items

you can find a ABNF styled protocol draft at the Testanything WIKI

The Problem

Big Test suites are hard to manage.

Things get lost, or aren't easy to see.

The Solution

Various TAP::Formatter Modules


Runs well by itself

use strict;
use warnings;
use TAP::Harness;

my @tests = glob( 't/*.t' );
my $harness = TAP::Harness->new({ formatter_class => 'TAP::Formatter::HTML' });
$harness->runtests( @tests );

TAP::Formatter::HTML -- External

To run externally you need to make some files avaliable

The easy way is to put these files in your webroot

TAP::Formatter::HTML -- External (cont)

Once you have your javascript and css files in your web root you need to modify your code to use them

my $formatter = TAP::Formatter::HTML->new;
$formatter->output_file( '/home/dcarter/projects/presentations/simple-smoke/test.html' );

my $harness = TAP::Harness->new({ formatter => $formatter });


Thank You

The entire presentation can be found at: