Author: jkeenan
Date: Sun Oct 28 12:52:47 2007
New Revision: 22573

Added:
   branches/autogcc/t/configure/111-auto_gcc-11.t   (contents, props changed)
   branches/autogcc/t/configure/111-auto_gcc-12.t   (contents, props changed)
   branches/autogcc/t/configure/111-auto_gcc-13.t   (contents, props changed)
Modified:
   branches/autogcc/MANIFEST
   branches/autogcc/config/auto/gcc.pm
   branches/autogcc/t/configure/111-auto_gcc-10.t

Log:
Add three more test files (t/configure/111-auto_gcc-11.t, -12.t, -13.t) for
testing auto::gcc.  On the basis of the results of these tests and coverage
analysis, one 'if' condition was simplified from 'miniparrot and gccversion'
to just 'miniparrot'.  Deleted commented-out code in -10.t.


Modified: branches/autogcc/MANIFEST
==============================================================================
--- branches/autogcc/MANIFEST   (original)
+++ branches/autogcc/MANIFEST   Sun Oct 28 12:52:47 2007
@@ -1,7 +1,7 @@
 # ex: set ro:
 # $Id$
 #
-# generated by tools/dev/mk_manifest_and_skip.pl Sun Oct 28 18:50:12 2007 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Sun Oct 28 19:40:59 2007 UT
 #
 # See tools/dev/install_files.pl for documentation on the
 # format of this file.
@@ -3014,6 +3014,9 @@
 t/configure/111-auto_gcc-08.t                               []
 t/configure/111-auto_gcc-09.t                               []
 t/configure/111-auto_gcc-10.t                               []
+t/configure/111-auto_gcc-11.t                               []
+t/configure/111-auto_gcc-12.t                               []
+t/configure/111-auto_gcc-13.t                               []
 t/configure/112-auto_backtrace.t                            []
 t/configure/113-auto_msvc.t                                 []
 t/configure/114-auto_attributes.t                           []

Modified: branches/autogcc/config/auto/gcc.pm
==============================================================================
--- branches/autogcc/config/auto/gcc.pm (original)
+++ branches/autogcc/config/auto/gcc.pm Sun Oct 28 12:52:47 2007
@@ -384,7 +384,7 @@
     $conf->data->set( sym_export => '__attribute__ ((visibility("default")))' )
         if $gccversion >= 4.0;
 
-    if ( defined $conf->options->get('miniparrot') && $gccversion ) {
+    if ( defined $conf->options->get('miniparrot') ) {
         # make the compiler act as ANSIish as possible, and avoid enabling
         # support for GCC-specific features.
         $conf->data->set(

Modified: branches/autogcc/t/configure/111-auto_gcc-10.t
==============================================================================
--- branches/autogcc/t/configure/111-auto_gcc-10.t      (original)
+++ branches/autogcc/t/configure/111-auto_gcc-10.t      Sun Oct 28 12:52:47 2007
@@ -13,7 +13,6 @@
 use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
 use Parrot::Configure::Test qw( test_step_thru_runstep);
-#use Parrot::IO::Capture::Mini;
 
 my $args = process_options( {
     argv            => [ ],

Added: branches/autogcc/t/configure/111-auto_gcc-11.t
==============================================================================
--- (empty file)
+++ branches/autogcc/t/configure/111-auto_gcc-11.t      Sun Oct 28 12:52:47 2007
@@ -0,0 +1,84 @@
+#! perl
+# Copyright (C) 2007, The Perl Foundation.
+# $Id$
+# 111-auto_gcc-11.t
+
+use strict;
+use warnings;
+use Test::More tests => 14;
+use Carp;
+use lib qw( lib t/configure/testlib );
+use_ok('config::init::defaults');
+use_ok('config::auto::gcc');
+use Parrot::Configure;
+use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Test qw( test_step_thru_runstep);
+
+my $args = process_options( {
+    argv            => [ q{--maintainer}, q{--cage} ],
+    mode            => q{configure},
+} );
+
+my $conf = Parrot::Configure->new();
+
+test_step_thru_runstep($conf, q{init::defaults}, $args);
+
+my ($task, $step_name, @step_params, $step, $ret);
+my $pkg = q{auto::gcc};
+
+$conf->add_steps($pkg);
+$conf->options->set(%{$args});
+$task = $conf->steps->[1];
+$step_name   = $task->step;
[EMAIL PROTECTED] = @{ $task->params };
+
+$step = $step_name->new();
+ok(defined $step, "$step_name constructor returned defined value");
+isa_ok($step, $step_name);
+ok($step->description(), "$step_name has description");
+
+my $gnucref = {};
+$gnucref->{__GNUC__} = q{3};
+$gnucref->{__GNUC_MINOR__} = q{1};
+$conf->data->set( ccwarn => q{-Wfoobar -Wnofoobaz} );
+ok($step->_evaluate_gcc($conf, $gnucref),
+    "_evaluate_gcc() returned true value");
+ok(defined $conf->data->get( 'gccversion' ),
+    "gccversion defined as expected");
+is($step->result(), q{yes}, "Got expected result");
+
+pass("Keep Devel::Cover happy");
+pass("Completed all tests in $0");
+
+################### DOCUMENTATION ###################
+
+=head1 NAME
+
+111-auto_gcc-11.t - test config::auto::gcc
+
+=head1 SYNOPSIS
+
+    % prove t/configure/111-auto_gcc-11.t
+
+=head1 DESCRIPTION
+
+The files in this directory test functionality used by F<Configure.pl>.
+
+The tests in this file test subroutines exported by config::auto::gcc.
+
+=head1 AUTHOR
+
+James E Keenan
+
+=head1 SEE ALSO
+
+config::auto::gcc, F<Configure.pl>.
+
+=cut
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:

Added: branches/autogcc/t/configure/111-auto_gcc-12.t
==============================================================================
--- (empty file)
+++ branches/autogcc/t/configure/111-auto_gcc-12.t      Sun Oct 28 12:52:47 2007
@@ -0,0 +1,85 @@
+#! perl
+# Copyright (C) 2007, The Perl Foundation.
+# $Id$
+# 111-auto_gcc-12.t
+
+use strict;
+use warnings;
+use Test::More qw(no_plan); # tests => 14;
+use Carp;
+use lib qw( lib t/configure/testlib );
+use_ok('config::init::defaults');
+use_ok('config::auto::gcc');
+use Parrot::Configure;
+use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Test qw( test_step_thru_runstep);
+
+my $args = process_options( {
+    argv            => [ q{--miniparrot} ],
+    mode            => q{configure},
+} );
+
+my $conf = Parrot::Configure->new();
+
+test_step_thru_runstep($conf, q{init::defaults}, $args);
+
+my ($task, $step_name, @step_params, $step, $ret);
+my $pkg = q{auto::gcc};
+
+$conf->add_steps($pkg);
+$conf->options->set(%{$args});
+$task = $conf->steps->[1];
+$step_name   = $task->step;
[EMAIL PROTECTED] = @{ $task->params };
+
+$step = $step_name->new();
+ok(defined $step, "$step_name constructor returned defined value");
+isa_ok($step, $step_name);
+ok($step->description(), "$step_name has description");
+
+my $gnucref = {};
+$gnucref->{__GNUC__} = q{3};
+$gnucref->{__GNUC_MINOR__} = q{1};
+ok($step->_evaluate_gcc($conf, $gnucref),
+    "_evaluate_gcc() returned true value");
+ok(! defined $conf->data->get( 'gccversion' ),
+    "gccversion undefined as expected");
+is($conf->data->get( 'ccwarn' ), q{-ansi -pedantic},
+    "ccwarn set as expected for miniparrot");
+is($step->result(), q{yes}, "Got expected result");
+
+pass("Keep Devel::Cover happy");
+pass("Completed all tests in $0");
+
+################### DOCUMENTATION ###################
+
+=head1 NAME
+
+111-auto_gcc-12.t - test config::auto::gcc
+
+=head1 SYNOPSIS
+
+    % prove t/configure/111-auto_gcc-12.t
+
+=head1 DESCRIPTION
+
+The files in this directory test functionality used by F<Configure.pl>.
+
+The tests in this file test subroutines exported by config::auto::gcc.
+
+=head1 AUTHOR
+
+James E Keenan
+
+=head1 SEE ALSO
+
+config::auto::gcc, F<Configure.pl>.
+
+=cut
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:

Added: branches/autogcc/t/configure/111-auto_gcc-13.t
==============================================================================
--- (empty file)
+++ branches/autogcc/t/configure/111-auto_gcc-13.t      Sun Oct 28 12:52:47 2007
@@ -0,0 +1,90 @@
+#! perl
+# Copyright (C) 2007, The Perl Foundation.
+# $Id$
+# 111-auto_gcc-13.t
+
+use strict;
+use warnings;
+use Test::More qw(no_plan); # tests => 14;
+use Carp;
+use lib qw( lib t/configure/testlib );
+use_ok('config::init::defaults');
+use_ok('config::auto::gcc');
+use Parrot::Configure;
+use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Test qw( test_step_thru_runstep);
+
+my $args = process_options( {
+    argv            => [ ],
+    mode            => q{configure},
+} );
+
+my $conf = Parrot::Configure->new();
+
+test_step_thru_runstep($conf, q{init::defaults}, $args);
+
+my ($task, $step_name, @step_params, $step, $ret);
+my $pkg = q{auto::gcc};
+
+$conf->add_steps($pkg);
+$conf->options->set(%{$args});
+$task = $conf->steps->[1];
+$step_name   = $task->step;
[EMAIL PROTECTED] = @{ $task->params };
+
+$step = $step_name->new();
+ok(defined $step, "$step_name constructor returned defined value");
+isa_ok($step, $step_name);
+ok($step->description(), "$step_name has description");
+
+my $gnucref = {};
+$gnucref->{__GNUC__} = q{3};
+$gnucref->{__GNUC_MINOR__} = q{1};
+{
+    local $^O = 'hpux';
+    ok($step->_evaluate_gcc($conf, $gnucref),
+        "_evaluate_gcc() returned true value");
+    ok(defined $conf->data->get( 'gccversion' ),
+        "gccversion defined as expected");
+    is($conf->data->get( 'gccversion' ), q{3.1},
+        "Got expected value for gccversion");
+    is($conf->data->get( 'HAS_aligned_funcptr' ), 0,
+        "Got expected value for HAS_aligned_funcptr");
+    is($step->result(), q{yes}, "Got expected result");
+}
+
+pass("Keep Devel::Cover happy");
+pass("Completed all tests in $0");
+
+################### DOCUMENTATION ###################
+
+=head1 NAME
+
+111-auto_gcc-13.t - test config::auto::gcc
+
+=head1 SYNOPSIS
+
+    % prove t/configure/111-auto_gcc-13.t
+
+=head1 DESCRIPTION
+
+The files in this directory test functionality used by F<Configure.pl>.
+
+The tests in this file test subroutines exported by config::auto::gcc.
+
+=head1 AUTHOR
+
+James E Keenan
+
+=head1 SEE ALSO
+
+config::auto::gcc, F<Configure.pl>.
+
+=cut
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:

Reply via email to