3 # Copyright (C) 2005-2007, The Perl Foundation.
9 use vars
qw(@EXPORT @ISA);
16 @EXPORT = ( qw(output_is output_like output_isnt), @Test::More
::EXPORT
);
17 @ISA = qw(Exporter Test::More);
20 my ( $class, $plan, @args ) = @_;
22 Test
::More
->import( $plan, @args );
24 # __PACKAGE__->_export_to_level( 2, __PACKAGE__ );
25 my $callpkg = caller(2);
26 __PACKAGE__
->export($callpkg);
31 foreach my $meth (qw(is isnt like)) {
34 *{"URM::Test::output_$meth"} = sub {
35 my ( $lang_code, $output, $desc, @other ) = @_;
38 my ( $lang_f, $pasm_f, $by_f, $out_f ) = map { # JMG
40 $t =~ s/\.t$/_$count\.$_/;
42 } (qw(urm pasm pbc out)); # JMG
44 # STDERR is written into same output file
45 open LANG
, ">", "$lang_f" or die "Unable to open '$lang_f'"; # JMG
47 print LANG
$lang_code; # JMG
50 Parrot
::Test
::run_command
(
51 "$PConfig{perl} languages/urm/urmc -s languages/$lang_f",
52 CD
=> '..', # $self->{relpath},
56 Parrot
::Test
::run_command
(
57 "./parrot languages/$pasm_f @other",
58 CD
=> '..', # $self->{relpath},
62 my $prog_output = Parrot
::Test
::slurp_file
("$out_f");
64 @_ = ( $prog_output, $output, $desc );
66 #goto &{"Test::More::$meth"};
67 my $ok = &{"Test::More::$meth"}(@_);
69 # if( $ok ) { foreach my $meth ( $lang_f, $pasm_f, $by_f, $out_f ) { unlink $meth } } # JMG
75 my $urmc = "$PConfig{perl} $FindBin::RealBin$PConfig{slash}..$PConfig{slash}urmc";
76 my $compile = "-c -s";
82 my $ret = system("$urmc $compile $FindBin::RealBin$PConfig{slash}$file");
84 print STDERR
"TEST FAILED: $file ($ret)\n";
91 my ( $file, $expect ) = @_;
92 my $ret = `$urmc $run $FindBin::RealBin$PConfig{slash}$file`;
94 print STDERR
"TEST FAILED: $file didn't return a value, Parrot crashed?\n";
97 if ( $ret != $expect ) {
98 print STDERR
"TEST FAILED: $file (got $ret expected $expect)\n";
106 # cperl-indent-level: 4
109 # vim: expandtab shiftwidth=4: