develooper Front page | perl.cvs.parrot | Postings from January 2009

[svn:parrot] r35982 - trunk/t/tools/pmc2cutils

From:
cotto
Date:
January 24, 2009 20:03
Subject:
[svn:parrot] r35982 - trunk/t/tools/pmc2cutils
Message ID:
20090125040349.2D44ACB9AE@x12.develooper.com
Author: cotto
Date: Sat Jan 24 20:03:48 2009
New Revision: 35982

Modified:
   trunk/t/tools/pmc2cutils/04-dump_pmc.t

Log:
[t] force some pmc2c tests generate .dump files (TT #219)


Modified: trunk/t/tools/pmc2cutils/04-dump_pmc.t
==============================================================================
--- trunk/t/tools/pmc2cutils/04-dump_pmc.t	(original)
+++ trunk/t/tools/pmc2cutils/04-dump_pmc.t	Sat Jan 24 20:03:48 2009
@@ -108,6 +108,16 @@
     $dump_file = $self->dump_vtable("$main::topdir/src/vtable.tbl");
     ok( -e $dump_file, "dump_vtable created vtable.dump" );
 
+    #create a dump for default.pmc
+    Parrot::Pmc2c::Pmc2cMain->new(
+        {
+            include => \@include, 
+            opt=>\%opt,
+            args=>[qq{$temppmcdir/default.pmc}],
+            bin=>$Bin
+        }
+    )->dump_pmc();
+
     ok( $self->dump_pmc(),               "dump_pmc succeeded" );
     ok( -f qq{$temppmcdir/default.dump}, "default.dump created as expected" );
     ok( -f qq{$temppmcdir/array.dump},   "array.dump created as expected" );
@@ -202,6 +212,16 @@
     $dump_file = $self->dump_vtable("$main::topdir/src/vtable.tbl");
     ok( -e $dump_file, "dump_vtable created vtable.dump" );
 
+    #create a dump for default.pmc
+    Parrot::Pmc2c::Pmc2cMain->new(
+        {
+            include => \@include, 
+            opt=>\%opt,
+            args=>[qq{$temppmcdir/default.pmc}],
+            bin=>$Bin
+        }
+    )->dump_pmc();
+
     ok( $self->dump_pmc(),               "dump_pmc succeeded" );
     ok( -f qq{$temppmcdir/default.dump}, "default.dump created as expected" );
     ok( -f qq{$temppmcdir/null.dump},    "null.dump created as expected" );
@@ -211,7 +231,7 @@
 
 # @args hold default.pmc and 3 other .pmc files in dependency order
 {
-    my $tdir = tempdir( CLEANUP => 1 );
+    my $tdir = tempdir( CLEANUP => 0 );
     ok( chdir $tdir, 'changed to temp directory for testing' );
     my $pmcdir = q{src/pmc};
     ok( ( mkdir qq{$tdir/src} ), "created src/ under tempdir" );
@@ -248,6 +268,18 @@
     $dump_file = $self->dump_vtable("$main::topdir/src/vtable.tbl");
     ok( -e $dump_file, "dump_vtable created vtable.dump" );
 
+    #create dumps for dependencies of boolean
+    for my $pmc ( qq{$temppmcdir/default.pmc},  qq{$temppmcdir/scalar.pmc}, qq{$temppmcdir/integer.pmc} ) {
+        Parrot::Pmc2c::Pmc2cMain->new(
+            {
+                include => \@include, 
+                opt=>\%opt,
+                args=>[$pmc],
+                bin=>$Bin
+            }
+        )->dump_pmc();
+    }
+
     ok( $self->dump_pmc(),               "dump_pmc succeeded" );
     ok( -f qq{$temppmcdir/default.dump}, "default.dump created as expected" );
     ok( -f qq{$temppmcdir/scalar.dump},  "scalar.dump created as expected" );
@@ -260,7 +292,7 @@
 # how should a missing dependency be handled?
 # scalar requires integer
 {
-    my $tdir = tempdir( CLEANUP => 1 );
+    my $tdir = tempdir( CLEANUP => 0 );
     ok( chdir $tdir, 'changed to temp directory for testing' );
     my $pmcdir = q{src/pmc};
     ok( ( mkdir qq{$tdir/src} ), "created src/ under tempdir" );
@@ -304,7 +336,7 @@
     like(
         $@,
         qr/^cannot find file 'scalar\.dump' in path/,
-        "dump_pmc failed on integer because prerequisite scalar wasn't supplied to 'args' key"
+        "ERROR WAS '$@', path is $temppmcdir"
     );
 
     ok( chdir $cwd, "changed back to original directory" );
@@ -343,6 +375,16 @@
     $dump_file = $self->dump_vtable("$main::topdir/src/vtable.tbl");
     ok( -e $dump_file, "dump_vtable created vtable.dump" );
 
+    #create a dump for default.pmc
+    Parrot::Pmc2c::Pmc2cMain->new(
+        {
+            include => \@include, 
+            opt=>\%opt,
+            args=>[qq{$temppmcdir/default.pmc}],
+            bin=>$Bin
+        }
+    )->dump_pmc();
+
     ok( $self->dump_pmc(),               "dump_pmc succeeded" );
     ok( -f qq{$temppmcdir/default.dump}, "default.dump created as expected" );
     ok( -f qq{$temppmcdir/array.dump},   "array.dump created as expected" );
@@ -427,6 +469,16 @@
     $dump_file = $self->dump_vtable("$main::topdir/src/vtable.tbl");
     ok( -e $dump_file, "dump_vtable created vtable.dump" );
 
+    #create a dump for default.pmc
+    Parrot::Pmc2c::Pmc2cMain->new(
+        {
+            include => \@include, 
+            opt=>\%opt,
+            args=>[qq{$temppmcdir/default.pmc}],
+            bin=>$Bin
+        }
+    )->dump_pmc();
+
     ok( $self->dump_pmc(),               "dump_pmc succeeded" );
     ok( -f qq{$temppmcdir/default.dump}, "default.dump created as expected" );
     ok( -f qq{$temppmcdir/array.dump},   "array.dump created as expected" );
@@ -485,6 +537,16 @@
     $dump_file = $self->dump_vtable("$main::topdir/src/vtable.tbl");
     ok( -e $dump_file, "dump_vtable created vtable.dump" );
 
+    #create a dump for default.pmc
+    Parrot::Pmc2c::Pmc2cMain->new(
+        {
+            include => \@include, 
+            opt=>\%opt,
+            args=>[qq{$temppmcdir/default.pmc}],
+            bin=>$Bin
+        }
+    )->dump_pmc();
+
     ok( $self->dump_pmc(),               "dump_pmc succeeded" );
     ok( -f qq{$temppmcdir/array.dump},   "array.dump created as expected" );
     ok( -f qq{$temppmcdir/default.dump}, "default.dump created as expected" );



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About