[svn:parrot] r39958 - in branches/darwinhints: . t/configure

jkeenan at svn.parrot.org jkeenan at svn.parrot.org
Thu Jul 9 02:34:48 UTC 2009


Author: jkeenan
Date: Thu Jul  9 02:34:48 2009
New Revision: 39958
URL: https://trac.parrot.org/parrot/changeset/39958

Log:
Make name of test file more self-documenting.

Added:
   branches/darwinhints/t/configure/049-options_test_prepare.t
      - copied, changed from r39957, branches/darwinhints/t/configure/049-options_test.t
Deleted:
   branches/darwinhints/t/configure/049-options_test.t
Modified:
   branches/darwinhints/MANIFEST

Modified: branches/darwinhints/MANIFEST
==============================================================================
--- branches/darwinhints/MANIFEST	Thu Jul  9 02:33:11 2009	(r39957)
+++ branches/darwinhints/MANIFEST	Thu Jul  9 02:34:48 2009	(r39958)
@@ -1,7 +1,7 @@
 # ex: set ro:
 # $Id$
 #
-# generated by tools/dev/mk_manifest_and_skip.pl Wed Jul  8 01:32:16 2009 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Thu Jul  9 02:34:23 2009 UT
 #
 # See below for documentation on the format of this file.
 #
@@ -1644,7 +1644,7 @@
 t/configure/046-inter.t                                     [test]
 t/configure/047-inter.t                                     [test]
 t/configure/048-return_result_undef.t                       [test]
-t/configure/049-options_test.t                              [test]
+t/configure/049-options_test_prepare.t                      [test]
 t/configure/050-fatal.t                                     [test]
 t/configure/051-fatal_step.t                                [test]
 t/configure/059-silent.t                                    [test]

Deleted: branches/darwinhints/t/configure/049-options_test.t
==============================================================================
--- branches/darwinhints/t/configure/049-options_test.t	Thu Jul  9 02:34:48 2009	(r39957)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,160 +0,0 @@
-#! perl
-# Copyright (C) 2007, Parrot Foundation.
-# $Id$
-# 049-options_test.t
-
-use strict;
-use warnings;
-use Carp;
-use Cwd;
-use File::Basename qw( basename fileparse );
-use File::Path qw( mkpath );
-use File::Spec ();
-use File::Temp 0.13 qw| tempdir |;
-use Test::More tests => 10;
-use lib qw( lib );
-use IO::CaptureOutput qw| capture |;
-use Parrot::Configure::Options::Test::Prepare ();
-
-my $cwd = cwd();
-{
-    my $tdir = tempdir( CLEANUP => 1 );
-    chdir $tdir or croak "Unable to change to temporary directory";
-    my $good_test = q{001-sometest.t};
-    my $bad_test  = q{someothertest.t};
-    touch_in_this_dir($good_test);
-    touch_in_this_dir($bad_test);
-    my %tests_seen = map { basename($_), 1 }
-        Parrot::Configure::Options::Test::Prepare::_get_framework_tests($tdir);
-    ok($tests_seen{$good_test},
-        "Correctly named test identified");
-    ok(! $tests_seen{$bad_test},
-        "Incorrectly named test excluded");
-
-    ok( chdir $cwd, "Able to change back to starting directory");
-}
-
-{
-    my $tdir = tempdir( CLEANUP => 1 );
-    chdir $tdir or croak "Unable to change to temporary directory";
-    my $init_test = q{init/sometest-01.t};
-    my $init_hints_test = q{init/hints/sometest-01.t};
-    my $inter_test = q{inter/sometest-01.t};
-    my $auto_test = q{auto/sometest-01.t};
-    my $gen_test = q{gen/sometest-01.t};
-    my $bad_test  = q{bad/sometest-01.t};
-    my $lack_number_test = q{init/test.t};
-    my $CamelCase_test = q{gen/CamelCase-01.t};
-    touch($init_test);
-    touch($init_hints_test);
-    touch($inter_test);
-    touch($auto_test);
-    touch($gen_test);
-    touch($bad_test);
-    touch($lack_number_test);
-    touch($CamelCase_test);
-
-    my ( $steps_tests_simple_ref, $steps_tests_complex_ref )  =
-        Parrot::Configure::Options::Test::Prepare::_find_steps_tests($tdir);
-    my $full_bad_test = File::Spec->catfile( $tdir, $bad_test );
-    ok( ! exists $steps_tests_simple_ref->{$full_bad_test},
-        "File in incorrect directory correctly excluded from list of configuration step tests");
-    my $full_lack_number_test = File::Spec->catfile( $tdir, $lack_number_test );
-    ok( ! exists $steps_tests_simple_ref->{$full_lack_number_test},
-        "File lacking 2-digit number correctly excluded from list of configuration step tests");
-    my $full_init_hints_test = File::Spec->catfile( $tdir, $init_hints_test );
-    ok( exists $steps_tests_simple_ref->{$full_init_hints_test},
-        "File in second-level directory correctly included in list of configuration step tests");
-    my $full_CamelCase_test = File::Spec->catfile( $tdir, $CamelCase_test );
-    ok( ! exists $steps_tests_simple_ref->{$full_CamelCase_test},
-        "File containing capital letters in name correctly excluded from list of configuration step tests");
-
-    my @tests_expected = qw(
-        init::sometest
-        init::hints::sometest
-        inter::sometest
-        auto::sometest
-        gen::sometest
-    );
-    my $not_expected = q{gen::missing};
-    push @tests_expected, $not_expected;
-    my %tests_seen = ();
-    {
-        my ($stdout, $stderr);
-        capture (
-            sub { %tests_seen = map { $_, 1}
-                Parrot::Configure::Options::Test::Prepare::_prepare_steps_tests_list(
-                    $tdir,
-                    $steps_tests_complex_ref,
-                    \@tests_expected,
-                ) },
-            \$stdout,
-            \$stderr,
-        );
-        like($stderr, qr/No tests exist for configure step $not_expected/,
-            "Warning about step class lacking test captured");
-    }
-#    foreach my $type ( qw| init inter auto gen | ) {
-#        my $t = $type . q(_sometest-01.t);
-#        ok($tests_seen{$t}, "Found needed test");
-#    }
-
-    ok( chdir $cwd, "Able to change back to starting directory");
-}
-
-pass("Completed all tests in $0");
-
-sub touch {
-    my $path = shift;
-    my ($base, $dirs) = fileparse($path);
-    my $cwd = cwd();
-    unless ( -d $dirs ) {
-        mkpath( [ $dirs ], 0, 0777 ) or croak "Unable to create dirs: $!";
-    }
-    chdir $dirs or croak "Unable to change dir: $!";
-    touch_in_this_dir( $base );
-    chdir $cwd or croak "Unable to change back dir: $!";
-    ( -e $path ) or croak "Didn't create file: $!";
-}
-
-sub touch_in_this_dir {
-    my $file = shift;
-    open my $FH, '>', $file or croak "Unable to open $file for writing";
-    print $FH "Hello, world\n";
-    close $FH or croak "Unable to close $file after writing";
-}
-
-################### DOCUMENTATION ###################
-
-=head1 NAME
-
-049-options_test.t - test Parrot::Configure::Options::Test
-
-=head1 SYNOPSIS
-
-    % prove t/configure/049-options_test.t
-
-=head1 DESCRIPTION
-
-The files in this directory test functionality used by F<Configure.pl>.
-
-The tests in this file test Parrot::Configure::Options::Test::Prepare
-subroutines.
-
-=head1 AUTHOR
-
-James E Keenan
-
-=head1 SEE ALSO
-
-Parrot::Configure::Options::Test, F<Configure.pl>.
-
-=cut
-
-# Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:
-

Copied and modified: branches/darwinhints/t/configure/049-options_test_prepare.t (from r39957, branches/darwinhints/t/configure/049-options_test.t)
==============================================================================
--- branches/darwinhints/t/configure/049-options_test.t	Thu Jul  9 02:33:11 2009	(r39957, copy source)
+++ branches/darwinhints/t/configure/049-options_test_prepare.t	Thu Jul  9 02:34:48 2009	(r39958)
@@ -1,7 +1,7 @@
 #! perl
 # Copyright (C) 2007, Parrot Foundation.
 # $Id$
-# 049-options_test.t
+# 049-options_test_prepare.t
 
 use strict;
 use warnings;
@@ -128,11 +128,11 @@
 
 =head1 NAME
 
-049-options_test.t - test Parrot::Configure::Options::Test
+049-options_test_prepare.t - test Parrot::Configure::Options::Test
 
 =head1 SYNOPSIS
 
-    % prove t/configure/049-options_test.t
+    % prove t/configure/049-options_test_prepare.t
 
 =head1 DESCRIPTION
 


More information about the parrot-commits mailing list