Author: jkeenan
Date: Fri Nov 23 05:20:30 2007
New Revision: 22982

Added:
   branches/nointer/t/configure/064-init_miniparrot.t   (contents, props 
changed)
   branches/nointer/t/configure/065-init_hints-01.t   (contents, props changed)
   branches/nointer/t/configure/065-init_hints-02.t   (contents, props changed)
   branches/nointer/t/configure/065-init_hints-03.t   (contents, props changed)
   branches/nointer/t/configure/065-init_hints-04.t   (contents, props changed)
   branches/nointer/t/configure/066-init_headers.t   (contents, props changed)
Modified:
   branches/nointer/MANIFEST

Log:
Add tests for initiation steps P::C::Initialize::Miniparrot, ::Hints,
::Headers.


Modified: branches/nointer/MANIFEST
==============================================================================
--- branches/nointer/MANIFEST   (original)
+++ branches/nointer/MANIFEST   Fri Nov 23 05:20:30 2007
@@ -1,7 +1,7 @@
 # ex: set ro:
 # $Id$
 #
-# generated by tools/dev/mk_manifest_and_skip.pl Fri Nov 23 13:07:12 2007 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Fri Nov 23 13:17:06 2007 UT
 #
 # See tools/dev/install_files.pl for documentation on the
 # format of this file.
@@ -3016,11 +3016,17 @@
 t/configure/057-fatal_step.t                                []
 t/configure/058-fatal_step.t                                []
 t/configure/059-interactive.t                               []
-t/configure/060-initialize.t                                []
 t/configure/062-init_defaults-01.t                          []
+t/configure/062-init_defaults-02.t                          []
 t/configure/063-init_install-01.t                           []
 t/configure/063-init_install-02.t                           []
 t/configure/063-init_install-03.t                           []
+t/configure/064-init_miniparrot.t                           []
+t/configure/065-init_hints-01.t                             []
+t/configure/065-init_hints-02.t                             []
+t/configure/065-init_hints-03.t                             []
+t/configure/065-init_hints-04.t                             []
+t/configure/066-init_headers.t                              []
 t/configure/101-init_manifest-01.t                          []
 t/configure/101-init_manifest-02.t                          []
 t/configure/102-init_defaults-01.t                          []

Added: branches/nointer/t/configure/064-init_miniparrot.t
==============================================================================
--- (empty file)
+++ branches/nointer/t/configure/064-init_miniparrot.t  Fri Nov 23 05:20:30 2007
@@ -0,0 +1,83 @@
+#! perl
+# Copyright (C) 2007, The Perl Foundation.
+# $Id$
+# 064-init_miniparrot.t
+
+use strict;
+use warnings;
+
+use Test::More tests => 16;
+use Carp;
+use Cwd;
+use File::Temp qw(tempdir);
+use lib qw( lib t/configure/testlib );
+use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Initialize;
+
+my $cwd = cwd();
+my $args  = process_options(
+    {
+        argv => [q{--miniparrot}],
+        mode => q{configure},
+    }
+);
+my $init = Parrot::Configure::Initialize->new($args);
+ok(defined $init,
+    "Parrot::Configure::Initialize returned defined value");
+isa_ok($init, "Parrot::Configure::Initialize");
+ok($init->init_defaults(), 'init_defaults() completed okay');
+
+is( $init->get('miniparrot'),  undef, "miniparrot is not yet enabled" );
+is( $init->get('jitarchname'), undef, "jitarchname undef as expected" );
+is( $init->get('jitcpuarch'),  undef, "jitcpuarch undef as expected" );
+is( $init->get('jitcpu'),      undef, "jitcpu undef as expected" );
+is( $init->get('jitosname'),   undef, "jitosname undef as expected" );
+
+ok($init->init_miniparrot(), 'init_miniparrot() completed okay');
+
+ok( $init->get('miniparrot'),  "miniparrot is enabled" );
+is( $init->get('jitarchname'), 'nojit', "jitarchname as expected" );
+is( $init->get('jitcpuarch'),  'i386',  "jitcpuarch as expected" );
+is( $init->get('jitcpu'),      'I386',  "jitcpu as expected" );
+is( $init->get('jitosname'),   'nojit', "jitosname as expected" );
+ok( !$init->get('jitcapable'), "not jitcapable as expected" );
+
+pass("Completed all tests in $0");
+
+################### DOCUMENTATION ###################
+
+=head1 NAME
+
+064-init_miniparrot.t - Test Parrot::Configure::Initialize
+
+=head1 SYNOPSIS
+
+    % prove t/configure/064-init_miniparrot.t
+
+=head1 DESCRIPTION
+
+The files in this directory test functionality used by F<Configure.pl>.
+
+The tests in this file test whether the C<--miniparrot> option overrides the
+default settings.
+
+=head1 AUTHOR
+
+James E Keenan
+
+=head1 SEE ALSO
+
+Parrot::Configure, Parrot::Configure::Initialize,
+Parrot::Configure::Initialize::Defaults,
+Parrot::Configure::Initialize::Miniparrot, F<Configure.pl>.
+
+=cut
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:
+
+

Added: branches/nointer/t/configure/065-init_hints-01.t
==============================================================================
--- (empty file)
+++ branches/nointer/t/configure/065-init_hints-01.t    Fri Nov 23 05:20:30 2007
@@ -0,0 +1,81 @@
+#! perl
+# Copyright (C) 2007, The Perl Foundation.
+# $Id$
+# 065-init_hints-01.t
+
+use strict;
+use warnings;
+
+use Test::More tests =>  7;
+use Carp;
+use Cwd;
+use File::Temp qw(tempdir);
+use lib qw( lib t/configure/testlib );
+use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Initialize;
+use Parrot::IO::Capture::Mini;
+
+my $cwd = cwd();
+my $args  = process_options(
+    {
+        argv => [q{--verbose}],
+        mode => q{configure},
+    }
+);
+my $init = Parrot::Configure::Initialize->new($args);
+ok(defined $init,
+    "Parrot::Configure::Initialize returned defined value");
+isa_ok($init, "Parrot::Configure::Initialize");
+ok($init->init_defaults(), 'init_defaults() completed okay');
+ok($init->init_install(), 'init_install() completed okay');
+
+# need to capture the --verbose output, because the fact that it does not end
+# in a newline confuses Test::Harness
+{
+    my $tie_out = tie *STDOUT, "Parrot::IO::Capture::Mini"
+        or croak "Unable to tie";
+    my $ret = $init->init_hints();
+    my @lines = $tie_out->READLINE;
+    ok( @lines, "verbose output:  hints were captured" );
+    ok( $ret, "init_hints() returned true value" );
+}
+untie *STDOUT;
+
+pass("Completed all tests in $0");
+
+################### DOCUMENTATION ###################
+
+=head1 NAME
+
+065-init_hints-01.t - Test Parrot::Configure::Initialize
+
+=head1 SYNOPSIS
+
+    % prove t/configure/065-init_hints-01.t
+
+=head1 DESCRIPTION
+
+The files in this directory test functionality used by F<Configure.pl>.
+
+The tests in this file test configuration initialization as conducted by
+Parrot::Configure::Initialize::Hints.
+
+=head1 AUTHOR
+
+James E Keenan
+
+=head1 SEE ALSO
+
+Parrot::Configure, Parrot::Configure::Initialize,
+Parrot::Configure::Initialize::Hints, F<Configure.pl>.
+
+=cut
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:
+
+

Added: branches/nointer/t/configure/065-init_hints-02.t
==============================================================================
--- (empty file)
+++ branches/nointer/t/configure/065-init_hints-02.t    Fri Nov 23 05:20:30 2007
@@ -0,0 +1,102 @@
+#! perl
+# Copyright (C) 2007, The Perl Foundation.
+# $Id$
+# 065-init_hints-02.t
+
+use strict;
+use warnings;
+
+use Test::More tests =>  7;
+use Carp;
+use Cwd;
+use File::Path ();
+use File::Temp qw(tempdir);
+use lib qw( lib t/configure/testlib );
+use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Initialize;
+use Parrot::IO::Capture::Mini;
+
+my $cwd = cwd();
+my $args  = process_options(
+    {
+        argv => [q{--verbose}],
+        mode => q{configure},
+    }
+);
+my $init = Parrot::Configure::Initialize->new($args);
+ok(defined $init,
+    "Parrot::Configure::Initialize returned defined value");
+isa_ok($init, "Parrot::Configure::Initialize");
+ok($init->init_defaults(), 'init_defaults() completed okay');
+ok($init->init_install(), 'init_install() completed okay');
+
+{
+    my $tdir = tempdir( CLEANUP => 1 );
+    File::Path::mkpath(qq{$tdir/Parrot/Configure/Initialize/Hints})
+        or croak "Unable to create directory for local hints";
+    my $localhints = qq{$tdir/Parrot/Configure/Initialize/Hints/local.pm};
+    open my $FH, '>', $localhints
+        or croak "Unable to open temp file for writing";
+    print $FH <<END;
+package Parrot::Configure::Initialize::Hints::local;
+use strict;
+sub runstep {
+    return 1;
+}
+1;
+END
+    close $FH or croak "Unable to close temp file after writing";
+    unshift( @INC, $tdir );
+
+    # need to capture the --verbose output,
+    # because the fact that it does not end
+    # in a newline confuses Test::Harness
+    {
+        my $tie_out = tie *STDOUT, "Parrot::IO::Capture::Mini"
+            or croak "Unable to tie";
+        my $ret = $init->init_hints();
+        my @lines = $tie_out->READLINE;
+        ok( @lines, "verbose output:  hints were captured" );
+        ok( $ret, "init_hints() returned true value" );
+    }
+    unlink $localhints or croak "Unable to delete $localhints";
+}
+untie *STDOUT;
+pass("Completed all tests in $0");
+
+################### DOCUMENTATION ###################
+
+=head1 NAME
+
+065-init_hints-02.t - Test Parrot::Configure::Initialize
+
+=head1 SYNOPSIS
+
+    % prove t/configure/065-init_hints-02.t
+
+=head1 DESCRIPTION
+
+The files in this directory test functionality used by F<Configure.pl>.
+
+The tests in this file test configuration initialization as conducted by
+Parrot::Configure::Initialize::Hints.
+
+=head1 AUTHOR
+
+James E Keenan
+
+=head1 SEE ALSO
+
+Parrot::Configure, Parrot::Configure::Initialize,
+Parrot::Configure::Initialize::Hints, F<Configure.pl>.
+
+=cut
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:
+
+

Added: branches/nointer/t/configure/065-init_hints-03.t
==============================================================================
--- (empty file)
+++ branches/nointer/t/configure/065-init_hints-03.t    Fri Nov 23 05:20:30 2007
@@ -0,0 +1,99 @@
+#! perl
+# Copyright (C) 2007, The Perl Foundation.
+# $Id$
+# 065-init_hints-03.t
+
+use strict;
+use warnings;
+
+use Test::More tests =>  7;
+use Carp;
+use Cwd;
+use File::Path ();
+use File::Temp qw(tempdir);
+use lib qw( lib t/configure/testlib );
+use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Initialize;
+use Parrot::IO::Capture::Mini;
+
+my $cwd = cwd();
+my $args  = process_options(
+    {
+        argv => [q{--verbose}],
+        mode => q{configure},
+    }
+);
+my $init = Parrot::Configure::Initialize->new($args);
+ok(defined $init,
+    "Parrot::Configure::Initialize returned defined value");
+isa_ok($init, "Parrot::Configure::Initialize");
+ok($init->init_defaults(), 'init_defaults() completed okay');
+ok($init->init_install(), 'init_install() completed okay');
+
+{
+    my $tdir = tempdir( CLEANUP => 1 );
+    File::Path::mkpath(qq{$tdir/Parrot/Configure/Initialize/Hints})
+        or croak "Unable to create directory for local hints";
+    my $localhints = qq{$tdir/Parrot/Configure/Initialize/Hints/local.pm};
+    open my $FH, '>', $localhints
+        or croak "Unable to open temp file for writing";
+    print $FH <<END;
+package Parrot::Configure::Initialize::Hints::local;
+use strict;
+1;
+END
+    close $FH or croak "Unable to close temp file after writing";
+    unshift( @INC, $tdir );
+
+    # need to capture the --verbose output,
+    # because the fact that it does not end
+    # in a newline confuses Test::Harness
+    {
+        my $tie_out = tie *STDOUT, "Parrot::IO::Capture::Mini"
+            or croak "Unable to tie";
+        my $ret = $init->init_hints();
+        my @lines = $tie_out->READLINE;
+        ok( @lines, "verbose output:  hints were captured" );
+        ok( $ret, "init_hints() returned true value" );
+    }
+    unlink $localhints or croak "Unable to delete $localhints";
+}
+untie *STDOUT;
+pass("Completed all tests in $0");
+
+################### DOCUMENTATION ###################
+
+=head1 NAME
+
+065-init_hints-03.t - Test Parrot::Configure::Initialize
+
+=head1 SYNOPSIS
+
+    % prove t/configure/065-init_hints-03.t
+
+=head1 DESCRIPTION
+
+The files in this directory test functionality used by F<Configure.pl>.
+
+The tests in this file test configuration initialization as conducted by
+Parrot::Configure::Initialize::Hints.
+
+=head1 AUTHOR
+
+James E Keenan
+
+=head1 SEE ALSO
+
+Parrot::Configure, Parrot::Configure::Initialize,
+Parrot::Configure::Initialize::Hints, F<Configure.pl>.
+
+=cut
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:
+
+

Added: branches/nointer/t/configure/065-init_hints-04.t
==============================================================================
--- (empty file)
+++ branches/nointer/t/configure/065-init_hints-04.t    Fri Nov 23 05:20:30 2007
@@ -0,0 +1,77 @@
+#! perl
+# Copyright (C) 2007, The Perl Foundation.
+# $Id$
+# 065-init_hints-04.t
+
+use strict;
+use warnings;
+
+use Test::More tests =>  6;
+use Carp;
+use lib qw( lib t/configure/testlib );
+use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Initialize;
+use Parrot::IO::Capture::Mini;
+
+my $cwd = cwd();
+my $args  = process_options(
+    {
+        argv => [],
+        mode => q{configure},
+    }
+);
+my $init = Parrot::Configure::Initialize->new($args);
+ok(defined $init,
+    "Parrot::Configure::Initialize returned defined value");
+isa_ok($init, "Parrot::Configure::Initialize");
+ok($init->init_defaults(), 'init_defaults() completed okay');
+ok($init->init_install(), 'init_install() completed okay');
+
+{
+    local $^O = q{imaginaryOS};
+    my $ret;
+    eval { $ret = $init->init_hints(); };
+    like(
+        $@,
+        qr{^Can't locate Parrot/Configure/Initialize/Hints/$^O}i, #'
+        "Got expected error message upon bad value for \$^O"
+    );
+}
+pass("Completed all tests in $0");
+
+################### DOCUMENTATION ###################
+
+=head1 NAME
+
+065-init_hints-04.t - Test Parrot::Configure::Initialize
+
+=head1 SYNOPSIS
+
+    % prove t/configure/065-init_hints-04.t
+
+=head1 DESCRIPTION
+
+The files in this directory test functionality used by F<Configure.pl>.
+
+The tests in this file test configuration initialization as conducted by
+Parrot::Configure::Initialize::Hints.
+
+=head1 AUTHOR
+
+James E Keenan
+
+=head1 SEE ALSO
+
+Parrot::Configure, Parrot::Configure::Initialize,
+Parrot::Configure::Initialize::Hints, F<Configure.pl>.
+
+=cut
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:
+
+

Added: branches/nointer/t/configure/066-init_headers.t
==============================================================================
--- (empty file)
+++ branches/nointer/t/configure/066-init_headers.t     Fri Nov 23 05:20:30 2007
@@ -0,0 +1,94 @@
+#! perl
+# Copyright (C) 2007, The Perl Foundation.
+# $Id$
+# 066-init_headers.t
+
+use strict;
+use warnings;
+
+use Test::More tests =>  8;
+use Carp;
+use Cwd;
+use File::Copy;
+use File::Temp qw(tempdir);
+use Tie::File;
+use lib qw( lib t/configure/testlib );
+use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Initialize;
+use Parrot::IO::Capture::Mini;
+
+my $args  = process_options(
+    {
+        argv => [],
+        mode => q{configure},
+    }
+);
+my $init = Parrot::Configure::Initialize->new($args);
+ok(defined $init,
+    "Parrot::Configure::Initialize returned defined value");
+isa_ok($init, "Parrot::Configure::Initialize");
+ok($init->init_defaults(), 'init_defaults() completed okay');
+ok($init->init_install(), 'init_install() completed okay');
+ok($init->init_hints(), 'init_hints() completed okay');
+
+my $cwd = cwd();
+{
+    my $tdir = tempdir( CLEANUP => 1 );
+    chdir $tdir or croak "Unable to change to tempdir for testing";
+    copy qq{$cwd/MANIFEST}, qq{$tdir/MANIFEST}
+        or croak "Unable to copy MANIFEST for testing";
+    my @lines;
+    tie @lines, 'Tie::File', qq{$tdir/MANIFEST}
+        or croak "Unable to tie to temporary MANIFEST";
+    push @lines, q{include/parrot/phony.h    [main]include};
+    untie @lines;
+    my $ret = $init->init_headers();
+    ok( $ret, "init_headers() returned true value" );
+    like(
+        $init->get(q{TEMP_nongen_headers}),
+        qr{\$\(INC_DIR\)/phony\.h\\},
+        qq{Header added to MANIFEST for testing purposes correctly detected in 
Parrot::Configure object data structure}
+    );
+
+    chdir $cwd
+        or croak "Unable to change back to starting directory after testing";
+}
+pass("Completed all tests in $0");
+
+################### DOCUMENTATION ###################
+
+=head1 NAME
+
+066-init_headers.t - Test Parrot::Configure::Initialize
+
+=head1 SYNOPSIS
+
+    % prove t/configure/066-init_headers.t
+
+=head1 DESCRIPTION
+
+The files in this directory test functionality used by F<Configure.pl>.
+
+The tests in this file test configuration initialization conducted by
+Parrot::Configure::Initialize::Headers.
+
+=head1 AUTHOR
+
+James E Keenan
+
+=head1 SEE ALSO
+
+Parrot::Configure, Parrot::Configure::Initialize,
+Parrot::Configure::Initialize::Headers,
+F<Configure.pl>.
+
+=cut
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:
+
+

Reply via email to