Author: bernhard
Date: Fri Jun  1 13:11:57 2007
New Revision: 18725

Modified:
   trunk/languages/lisp/lib/Parrot/Test/Lisp.pm
   trunk/languages/t/harness

Log:
[languages/lisp]
Beautify Parrot::Test::Lisp.
Add 'lisp' to unified languages testing.


Modified: trunk/languages/lisp/lib/Parrot/Test/Lisp.pm
==============================================================================
--- trunk/languages/lisp/lib/Parrot/Test/Lisp.pm        (original)
+++ trunk/languages/lisp/lib/Parrot/Test/Lisp.pm        Fri Jun  1 13:11:57 2007
@@ -22,29 +22,25 @@
 sub output_is {
     my ( $self, $code, $output, $desc ) = @_;
 
-    my $count = $self->{builder}->current_test + 1;
+    my $count = $self->{builder}->current_test() + 1;
 
     my $lang_fn = File::Spec->rel2abs(Parrot::Test::per_test( '.l',  $count ));
     my $out_fn  = File::Spec->rel2abs(Parrot::Test::per_test( '.out', $count 
));
     Parrot::Test::write_code_to_file( $code, $lang_fn );
 
-    my $exit_code = 0;
-    my $pass      = 0;
-    my $args      = $ENV{TEST_PROG_ARGS} || '';
-    my $cmd       = "../../$self->{parrot} $args lisp.pbc $lang_fn";
+    my $args     = $ENV{TEST_PROG_ARGS} || '';
+    my $cmd      = "../../$self->{parrot} $args lisp.pbc $lang_fn";
+    my $lang_dir = File::Spec->catdir( $self->{relpath}, qw( languages lisp ) 
);
 
-    $exit_code = Parrot::Test::run_command(
+    my $exit_code = Parrot::Test::run_command(
         $cmd,
-        CD     => "$self->{relpath}/languages/lisp!",
+        CD     => $lang_dir,
         STDOUT => $out_fn,
         STDERR => $out_fn
     );
-    if ( ! $pass ) {
-        my $file = Parrot::Test::slurp_file($out_fn);
-        $pass = $self->{builder}->is_eq( Parrot::Test::slurp_file($out_fn), 
$output, $desc );
-        $self->{builder}->diag("'$cmd' failed with exit code $exit_code")
-            if $exit_code and not $pass;
-    }
+    my $pass = $self->{builder}->is_eq( Parrot::Test::slurp_file($out_fn), 
$output, $desc );
+    $self->{builder}->diag("'$cmd' failed with exit code $exit_code")
+        if $exit_code and not $pass;
 
     return $pass;
 }

Modified: trunk/languages/t/harness
==============================================================================
--- trunk/languages/t/harness   (original)
+++ trunk/languages/t/harness   Fri Jun  1 13:11:57 2007
@@ -79,7 +79,6 @@
 # cola                 not maintained
 # conversion           No t/harness
 # forth                No t/harness
-# lisp                 No t/harness
 # miniperl             not maintained, should be removed
 # perl6                test scripts are written in Perl 6, not Perl 5
 # pheme                test scripts are written in Scheme, not Perl 5
@@ -100,6 +99,7 @@
               HQ9plus
               jako
               lazy-k
+              lisp
               lua
               m4
               ook

Reply via email to