Author: fperrad
Date: Fri May  5 00:10:12 2006
New Revision: 12511

Modified:
   trunk/languages/ook/t/basic.t

Log:
more standard way ...

Modified: trunk/languages/ook/t/basic.t
==============================================================================
--- trunk/languages/ook/t/basic.t       (original)
+++ trunk/languages/ook/t/basic.t       Fri May  5 00:10:12 2006
@@ -1,9 +1,29 @@
 #! perl -w
 # $Id$
 
+=head1 NAME
+
+ook/t/basic.t - testing ook
+
+
+=head1 SYNOPSIS
+
+       % cd languages && perl ook/t/basic.t
+
+=head1 DESCRIPTION
+
+Test hello.ook.
+
+head1 TODO
+
+test executing test.ook
+ 
+=cut
+
 use strict;
 use warnings;
-use lib qw( ../../../lib );
+use FindBin;
+use lib "$FindBin::Bin/../../../lib";
 
 use Test::More tests => 1;
 use Parrot::Test  ();
@@ -11,24 +31,23 @@
 use File::Spec;
 
 # execute hello.ook
-my $path_to_parrot = Parrot::Test::path_to_parrot();
-my $languages_dir  = File::Spec->catdir( $path_to_parrot, 'languages' );
-my $ook            = "cd $path_to_parrot && 
.$PConfig{slash}parrot$PConfig{exe} languages/ook/ook.pbc";
+my $parrot    = File::Spec->catfile( File::Spec->updir(), $PConfig{test_prog} 
);
+my $ook       = $parrot . q{ } . File::Spec->catfile( 'ook', 'ook.pbc' );
+my $hello_ook = File::Spec->catfile( 'ook', 'hello.ook' ); 
 
 # Test running hello.ook
 
-my $out_fn = File::Spec->catfile( $languages_dir, 'ook', 'hello.out' );
+my $out_fn    = File::Spec->catfile( 'ook', 'hello.out' );
 
 # STDERR is written into same output file
 my $exit_code = Parrot::Test::run_command( 
-    "$ook languages/ook/hello.ook",
+    "$ook $hello_ook",
     STDOUT => $out_fn,
-    STDERR => $out_fn 
-                                         );
+    STDERR => $out_fn, 
+);
   
 my $out = Parrot::Test::slurp_file( $out_fn );
 is( $out, << 'OUT', 'output from hello.ook' );
 Hello World!
 OUT
 
-# TODO: test executing test.ook

Reply via email to