#! perl
# Copyright (C) 2008, Parrot Foundation.
# $Id: harness 36833 2009-02-17 20:09:26Z allison $

use strict;
use warnings;

use lib '../../lib';

use Test::Harness;

my @tests = @ARGV ? @ARGV : <t/*.t>;

eval { require TAP::Harness };
if ($@) {
    Test::Harness::runtests( @tests );
    exit;
}
else {
    my $harness = TAP::Harness->new({
        verbosity  => $ENV{HARNESS_VERBOSE},
        merge      => 0,
        jobs       => $ENV{TEST_JOBS} || 1,
        directives => 1,
    });

    my $results = $harness->runtests(@tests);
    exit ( $results->all_passed() ? 0 : 1 );
}
