#! perl -w
# $Id: harness,v 1.3 2002/09/09 05:13:18 educated_foo Exp $

#Blatantly stolen from parrot/t/harness by Mike Lambert

use strict;
use lib '../../lib';
use Test::Harness qw(runtests);

#
# Suck the switches into the TEST_PROG_ARGS evar:
#

use Getopt::Std;
my %opts;
getopts('gjP', \%opts);
$ENV{TEST_PROG_ARGS} = join(' ', map { "-$_" } keys %opts );

$ENV{PARROT_QUICKTEST} = grep $_ eq 'quick', @ARGV;
@ARGV = grep $_ ne 'quick', @ARGV;

# Pass in a list of tests to run on the command line, else run all the tests.
my @tests = @ARGV ? @ARGV : grep !m{^t/parser/}, glob( "t/*/*.t" );
runtests(@tests);
