[svn:parrot] r37910 - branches/install_tools/t/tools/install

jkeenan at svn.parrot.org jkeenan at svn.parrot.org
Sat Apr 4 23:35:39 UTC 2009


Author: jkeenan
Date: Sat Apr  4 23:35:39 2009
New Revision: 37910
URL: https://trac.parrot.org/parrot/changeset/37910

Log:
Limiting this test file to tests focused on Parrot::Install::install_files().

Modified:
   branches/install_tools/t/tools/install/02-install_files.t

Modified: branches/install_tools/t/tools/install/02-install_files.t
==============================================================================
--- branches/install_tools/t/tools/install/02-install_files.t	Sat Apr  4 23:34:38 2009	(r37909)
+++ branches/install_tools/t/tools/install/02-install_files.t	Sat Apr  4 23:35:39 2009	(r37910)
@@ -1,12 +1,12 @@
 #! perl
 # Copyright (C) 2007, Parrot Foundation.
 # $Id$
-# 01-install_files.t
+# 02-install_files.t
 
 use strict;
 use warnings;
 
-use Test::More qw(no_plan); # tests =>  8;
+use Test::More tests => 11;
 use Carp;
 use File::Path qw( mkpath );
 use File::Temp qw( tempdir );
@@ -14,85 +14,9 @@
 use Parrot::Install qw(
     install_files
     create_directories
-    lines_to_files
 );
 use IO::CaptureOutput qw( capture );
 
-################### DOCUMENTATION ###################
-
-=head1 NAME
-
-01-install_files.t - test subroutines exported by C<Parrot::Install>
-
-=head1 SYNOPSIS
-
-    % prove t/tools/install/01-install_files.t
-
-=head1 DESCRIPTION
-
-The files in this directory test functionality used by
-F<tools/dev/install_files.pl> and F<tools/dev/install_dev_files.pl> and
-exported by F<lib/Parrot/Install.pm>.
-
-=head1 AUTHOR
-
-James E Keenan
-
-=head1 SEE ALSO
-
-Parrot::Install, F<tools/dev/install_files.pl>, F<tools/dev/install_dev_files.pl>
-
-=cut
-
-{
-    my $tdir = tempdir( CLEANUP => 1 );
-    $tdir .= '/';
-
-    my @dirs = qw(foo/bar foo/bar/baz);
-    create_directories($tdir, { map { $_ => 1 } @dirs });
-    my $dirs_seen = 0;
-    foreach my $d (@dirs) {
-        $dirs_seen++ if -d "$tdir$d";
-    }
-    is($dirs_seen, 2, 'got expected number of directories created');
-}
-
-{
-    my $tdir = tempdir( CLEANUP => 1 );
-    $tdir .= '/';
-
-    my @dirs = qw(foo/bar foo/bar/baz);
-    my @created = mkpath( "$tdir$dirs[0]" );
-    ok( ( -d $created[0] ),
-        "one directory created before create_directories() is called" );
-
-    create_directories($tdir, { map { $_ => 1 } @dirs });
-    my $dirs_seen = 0;
-    foreach my $d (@dirs) {
-        $dirs_seen++ if -d "$tdir$d";
-    }
-    is($dirs_seen, 2,
-        "create_directories() handled case where one directory already existed" );
-}
-
-{
-    my $tdir = tempdir( CLEANUP => 1 );
-    $tdir .= '/';
-
-    my @dirs = qw(foo/bar foo/bar/baz);
-    my @created = mkpath( $tdir . 'foo' );
-    ok( ( -d $created[0] ),
-        "one directory created before create_directories() is called" );
-
-    create_directories($tdir, { map { $_ => 1 } @dirs });
-    my $dirs_seen = 0;
-    foreach my $d (@dirs) {
-        $dirs_seen++ if -d "$tdir$d";
-    }
-    is($dirs_seen, 2,
-        "create_directories() handled case where one path partially existed" );
-}
-
 {
     my $tdir = tempdir( CLEANUP => 1 );
     $tdir .= '/';
@@ -193,57 +117,33 @@
     }
 }
 
-# Can't safely run lines_to_files() more than once in a program until it's been fixed, 
-# and we can't fix it until its tested, so I've commented most of these out until we've
-# fixed lines_to_files() not to use @ARGV
-{
-    my($metatransforms, $othertransforms, $manifests, $options, $parrotdir,
-        $files, $installable_exe, $directories);
+pass("Completed all tests in $0");
 
-    # First lines_to_files test
-#    eval { lines_to_files(); };
-#    $@ or die "lines_to_files didn't die with no parameters\n";
-#    ok($@ =~ /^.manifests must be an array reference$/, 'lines_to_files dies with bad parameters');
-
-    # Second lines_to_files test
-#    eval { lines_to_files(
-#        $metatransforms, $othertransforms, 
-#        [qw(MANIFEST MANIFEST.generated)], 
-#        $options, $parrotdir
-#    ); };
-#    ok($@ =~ /^Unknown install location in MANIFEST for file/, 'fails for install locations not specified in transforms');
-
-    # Third lines_to_files test
-    $metatransforms = {
-        doc => {
-            optiondir => 'doc',
-            transform => sub {
-                my($dest) = @_;
-                $dest =~ s/^docs\/resources/resources/; # resources go in the top level of docs
-                $dest =~ s/^docs/pod/; # other docs are actually raw Pod
-                $parrotdir, $dest;
-            },
-        },
-    };
-    $othertransforms = {
-        '.*' => {
-            optiondir => 'foo',
-            transform => sub {
-                return(@_);
-            }
-        }
-    };
+################### DOCUMENTATION ###################
 
-    ($files, $installable_exe, $directories) = lines_to_files(
-        $metatransforms, $othertransforms, 
-        [qw(MANIFEST MANIFEST.generated)], 
-        { packages => 'main' }, $parrotdir
-    );
-    ok((ref($files) and ref($installable_exe) and ref($directories)), 'lines_to_files returns something vaguely sensible');
-    ok(1, 'lines_to_files passed all tests');
-}
+=head1 NAME
 
-pass("Completed all tests in $0");
+02-install_files.t - test subroutines exported by C<Parrot::Install>
+
+=head1 SYNOPSIS
+
+    % prove t/tools/install/02-install_files.t
+
+=head1 DESCRIPTION
+
+The files in this directory test functionality used by
+F<tools/dev/install_files.pl> and F<tools/dev/install_dev_files.pl> and
+exported by F<lib/Parrot/Install.pm>.
+
+=head1 AUTHOR
+
+James E Keenan and Timothy S Nelson
+
+=head1 SEE ALSO
+
+Parrot::Install, F<tools/dev/install_files.pl>, F<tools/dev/install_dev_files.pl>
+
+=cut
 
 # Local Variables:
 #   mode: cperl


More information about the parrot-commits mailing list