Author: autrijus
Date: Sat Mar 11 08:35:22 2006
New Revision: 11863
Modified:
trunk/languages/pugs/t/harness
Log:
* pugs: fix harness.
Modified: trunk/languages/pugs/t/harness
==============================================================================
--- trunk/languages/pugs/t/harness (original)
+++ trunk/languages/pugs/t/harness Sat Mar 11 08:35:22 2006
@@ -1,19 +1,17 @@
-# Copyright: 2005 The Perl Foundation. All Rights Reserved.
-# $Id: /mirror/trunk/languages/lua/t/harness 11501 2006-02-10T18:27:13.457666Z
particle $
+# $Id: /mirror/trunk/languages/pugs/t/harness 11501
2006-02-10T18:27:13.457666Z particle $
=head1 NAME
-languages/lua/t/harness - A harness for Parrot Lua
+languages/pugs/t/harness - A harness for Parrot Pugs
=head1 SYNOPSIS
- cd languages && perl -I../lib -Ilua/t lua/t/harness --files
+ cd languages && perl -I../lib pugs/t/harness --files
- cd languages && perl -I../lib -Ilua/t lua/t/harness
+ cd languages && perl -I../lib pugs/t/harness
- cd languages && perl -I../lib -Ilua/t lua/t/harness lua/t/examples.t
-
- cd languages && perl -I../lib lua/t/harness lua/t/pmc/nil.t
+ cd languages && perl -I../lib pugs/t/harness \
+ pugs/t/pmc/bit.t
=head1 DESCRIPTION
@@ -23,14 +21,6 @@
If I'm called with no args, I run the complete suite.
-If I'm called with "--use-lua", I run with the original C<lua>
-in order to valid of the test suite.
-
-If I'm called with "--use-monkey", I run with C<monkey>.
-
-If I'm called with "--use-lua2pir", I run with C<lua2pir> (and just after
-C<luac>).
-
Otherwise I run the tests that were passed on the command line.
=cut
@@ -43,66 +33,45 @@
use File::Spec;
use Test::Harness();
-my $language = 'lua';
+my $language = 'pugs';
if ( grep { m/^--files$/ } @ARGV ) {
# Only the Makefile in 'parrot/languages' uses --files
my $dir = File::Spec->catfile( $language, 't' );
my @files = glob( File::Spec->catfile( $dir, '*.t' ) );
- push @files, glob( File::Spec->catfile( $dir, '*/*.t' ) );
print join( "\n", @files );
print "\n" if scalar(@files);
-} else {
+} else {
my @files;
- # TODO: use Getopt::Long or such
- my $use_orig_lua = ( grep { m/^--use-lua$/ } @ARGV ) ? 1 : 0;
- my $use_monkey = ( grep { m/^--use-monkey$/ } @ARGV ) ? 1 : 0;
- my $use_lua2pir = ( grep { m/^--use-lua2pir$/ } @ARGV ) ? 1 : 0;
- @ARGV = grep { ! m/^--use-lua$/ } @ARGV;
- @ARGV = grep { ! m/^--use-monkey$/ } @ARGV;
- @ARGV = grep { ! m/^--use-lua2pir$/ } @ARGV;
+
if ( scalar(@ARGV) ) {
# Someone specified tests for me to run.
@files = grep { -f $_ } @ARGV
} else {
( undef, undef, my $current_dir ) = File::Spec->splitpath(
Cwd::getcwd() );
if ( $current_dir eq 'languages' ) {
- @files = glob( File::Spec->catfile( $language, 't', '*.t' ) );
- push @files, glob( File::Spec->catfile( $language, 't', '*', '*.t'
) )
- unless ( $use_orig_lua );
+ @files = glob( File::Spec->catfile( $language, 't', '*', '*.t' ) );
}
elsif ( $current_dir eq $language ) {
- @files = glob( File::Spec->catfile( 't', '*.t' ) );
- push @files, glob( File::Spec->catfile( 't', '*', '*.t' ) )
- unless ( $use_orig_lua );
+ @files = glob( File::Spec->catfile( 't', '*', '*.t' ) );
+ }
+ else {
+ die "Where am I?";
}
}
-
- if ( $use_orig_lua ) {
- $ENV{PARROT_LUA_TEST_PROG} = 'lua';
- Test::Harness::runtests( @files ) if scalar( @files );
- } elsif ( $use_monkey ) {
- $ENV{PARROT_LUA_TEST_PROG} = 'monkey';
- Test::Harness::runtests( @files ) if scalar( @files );
- } elsif ( $use_lua2pir ) {
- $ENV{PARROT_LUA_TEST_PROG} = 'lua2pir';
- Test::Harness::runtests( @files ) if scalar( @files );
- } else {
- $ENV{PARROT_LUA_TEST_PROG} = '';
- Test::Harness::runtests( @files ) if scalar( @files );
- }
+ Test::Harness::runtests( @files ) if scalar( @files );
}
=head1 HISTORY
-Mostly taken from F<languages/bc/t/harness>.
+Mostly taken from m4/t/harness.
=head1 SEE ALSO
-F<languages/tcl/t/harness>, F<languages/scheme/t/harness>,
F<languages/m4/t/harness>, F<languages/python/t/harness>
+ F<languages/tcl/t/harness>, F<languages/scheme/t/harness>,
F<languages/m4/t/harness>, F<languages/python/t/harness>
=head1 AUTHOR
-Francois Perrad
+Bernhard Schmalhofer - <[EMAIL PROTECTED]>
=cut