Author: jkeenan
Date: Sun Oct 28 11:57:21 2007
New Revision: 22568

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

Log:
Add two more test files for testing auto::gcc.  On the basis of the results of
these tests and coverage analysis, one 'if' condition was deemed unnecessary
and eliminated.


Modified: branches/autogcc/MANIFEST
==============================================================================
--- branches/autogcc/MANIFEST   (original)
+++ branches/autogcc/MANIFEST   Sun Oct 28 11:57:21 2007
@@ -1,7 +1,7 @@
 # ex: set ro:
 # $Id$
 #
-# generated by tools/dev/mk_manifest_and_skip.pl Sun Oct 28 17:26:13 2007 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Sun Oct 28 18:50:12 2007 UT
 #
 # See tools/dev/install_files.pl for documentation on the
 # format of this file.
@@ -3012,6 +3012,8 @@
 t/configure/111-auto_gcc-06.t                               []
 t/configure/111-auto_gcc-07.t                               []
 t/configure/111-auto_gcc-08.t                               []
+t/configure/111-auto_gcc-09.t                               []
+t/configure/111-auto_gcc-10.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 11:57:21 2007
@@ -89,299 +89,296 @@
     my $warns;
     my $ccwarn = $conf->data->get('ccwarn');
 
-    if ($gccversion) {
-
-        # If using gcc, crank up its warnings as much as possible and make it
-        # behave  ansi-ish.  Here's an attempt at a list of nasty things we can
-        # use for a given version of gcc. The earliest documentation I
-        # currently have access to is for 2.95, so I don't know what version
-        # everything came in at. If it turns out that you're using 2.7.2 and
-        # -Wfoo isn't recognised there, move it up into the next version becone
-        # (2.8)
-
-        # Don't use -ansi -pedantic.  It makes it much harder to compile using
-        # the system headers, which may well be tuned to a non-strict
-        # environment -- especially since we are using perl5 compilation flags
-        # determined in a non-strict environment.  An example is Solaris 8.
-
-        my @opt_and_vers = (
-                  0 => ""
-                . " -W"
-                . " -Wall"
-                . " -Waggregate-return"
-                . " -Wbad-function-cast"
-                . " -Wcast-align"
-                . " -Wcast-qual"
-                . " -Wchar-subscripts "
-                . " -Wcomment"
-                . " -Wdisabled-optimization"
-                . " -Wformat-nonliteral"
-                . " -Wformat-security"
-                . " -Wformat-y2k"
-                . " -Wimplicit"
-                . " -Wimplicit-function-declaration"
-                . " -Wimplicit-int"
-                . " -Wimport"
-                . " -Winline"
-                . " -Wmain"
-                . " -Wmissing-braces"
-                . " -Wmissing-declarations"
-                . " -Wmissing-prototypes"
-                . " -Wnested-externs"
-                . " -Wno-unused"
-                . " -Wnonnull"
-                . " -Wpacked"
-                . " -Wparentheses"
-                . " -Wpointer-arith"
-                . " -Wreturn-type"
-                . " -Wsequence-point"
-                . " -Wshadow"
-                . " -Wsign-compare"
-                . " -Wstrict-aliasing"
-                . " -Wstrict-prototypes"
-                . " -Wswitch"
-                #. " -Wswitch-default"
-                #. " -Wswitch-enum"
-                . " -Wnested-externs"
-                . " -Wundef"
-                . " -Wunknown-pragmas"
-                . " -Wwrite-strings"
-                . (
-                    $conf->options->get('maintainer')
-                    ? " -Wlarger-than-4096"
-                    : ""
-                  ),
-
-            # others; ones we might like marked with ?
-            # ? -Wundef for undefined idenfiers in #if
-            # ? -Wbad-function-cast
-            #   Warn whenever a function call is cast to a non-matching type
-            # ? -Wmissing-declarations
-            #   Warn if a global function is defined without a previous
-            #   declaration -Wmissing-noreturn
-            # ? -Wredundant-decls
-            #    Warn if anything is declared more than once in the same scope,
-            # ? -Wnested-externs
-            #    Warn if an `extern' declaration is encountered within an
-            #    function.  -Wlong-long
-            # Ha. this is the default! with -pedantic.
-            # -Wno-long-long for the nicest bit of C99
-            #
-            # -Wcast-align is now removed: it gives too many false positives
-            #    e.g. when accessing registers - this is all aligned
-
-            2.7  => "",
-            2.8  => "-Wsign-compare",
-            2.95 => "",
-
-            # 2.95 does align functions per default -malign-functions=4
-            #      where the argument is used as a power of 2
-            # 3.x  does not align functions per default, its turned on with
-            #      -O2 and -O3
-            #      -falign-functions=16 is the real alignment, no exponent
-            3.0 => ""
-                . " -falign-functions=16"
-                . " -Wdisabled-optimization"
-                . " -Wformat-nonliteral"
-                . " -Wformat-security"
-                . " -mno-accumulate-outgoing-args"
-                . " -Wno-shadow"
-                . " -Wpacked"
-                . "",
-
-            3.4 => ""
-                . " -Wbad-function-cast"
-                . " -Wdeclaration-after-statement"
-                . " -Wextra"
-                . " -Winit-self"
-                . " -Winvalid-pch"
-                . " -Wold-style-definition"
-                . " -Wstrict-aliasing=2"
-                . "",
-
-            # -Wsequence-point is part of -Wall
-            # -Wfloat-equal may not be what we want
-            # We shouldn't be using __packed__, but I doubt -Wpacked will harm
-            # us -Wpadded may prove interesting, or even noisy.
-            # -Wunreachable-code might be useful in a non debugging version
-            4.0 => ""
-                . " -fvisibility=hidden"
-                . " -Wmissing-field-initializers"
-                . "",
-
-            # Needed to prevent C++ compatibility issues
-            4.1 => ""
-                . " -Wc++-compat"
-                . "",
-        );
-
-        my @cage_opt_and_vers = (
-                  0 => ""
-                . " -std=c89"
-                . " -Wall"
-                . " -Waggregate-return"
-                . " -Wextra"
-                . " -Wbad-function-cast"
-                . " -Wcast-align"
-                . " -Wcast-qual"
-                . " -Wchar-subscripts "
-                . " -Wcomment"
-                . " -Wconversion"
-                . " -Wdeclaration-after-statement"
-                . " -Wdisabled-optimization"
-                . " -Wformat"
-                . " -Wformat=2"
-                . " -Wformat-nonliteral"
-                . " -Wformat-security"
-                . " -Wformat-y2k"
-                . " -Wimplicit"
-                . " -Wimplicit-function-declaration"
-                . " -Wimplicit-int"
-                . " -Wimport"
-                . " -Winit-self"
-                . " -Winline"
-                . " -Winvalid-pch"
-                . " -Wlarger-than-4096"
-                . " -Wlong-long"
-                . " -Wmain"
-                . " -Wmissing-braces"
-                . " -Wmissing-declarations"
-                . " -Wmissing-format-attribute"
-                . " -Wmissing-noreturn"
-                . " -Wmissing-prototypes"
-                . " -Wnested-externs"
-                . " -Wnonnull"
-                . " -Wold-style-definition"
-                . " -Wpacked"
-                . " -Wpadded"
-                . " -Wparentheses"
-                . " -Wpointer-arith"
-                . " -Wredundant-decls"
-                . " -Wreturn-type"
-                . " -Wsequence-point"
-                . " -Wshadow"
-                . " -Wsign-compare"
-                . " -Wstrict-aliasing"
-                . " -Wstrict-aliasing=2"
-                . " -Wstrict-prototypes"
-                . " -Wswitch"
-                . " -Wswitch-default"
-                . " -Wswitch-enum"
-                . " -Wsystem-headers"
-                . " -Wtrigraphs"
-                . " -Wundef"
-                . " -Wunknown-pragmas"
-                . " -Wunreachable-code"
-                . " -Wunused-function"
-                . " -Wunused-label"
-                . " -Wunused-parameter"
-                . " -Wunused-value"
-                . " -Wunused-variable"
-                . " -Wwrite-strings"
-                #. "-fsyntax-only "
-                #. "-pedantic -pedantic-errors "
-                #. " -w "
-                #. " -Werror "
-                . " -Wno-deprecated-declarations"
-                . " -Wno-div-by-zero"
-                . " -Wno-endif-labels"
-                . " -Werror-implicit-function-declaration"
-                #. " -Wfloat-equal"
-                . " -Wno-format-extra-args"
-                . " -Wno-import"
-                . " -Wno-multichar"
-                #. " -Wuninitialized "
-                #     requires -O
-                #."-Wmost (APPLE ONLY)"
-                #C-only Warning Options
-                #. " -Wtraditional "
-                . "",
-
-            # others; ones we might like marked with ?
-            # ? -Wundef for undefined idenfiers in #if
-            # ? -Wbad-function-cast
-            #   Warn whenever a function call is cast to a non-matching type
-            # ? -Wmissing-declarations
-            #   Warn if a global function is defined without a previous
-            #   declaration -Wmissing-noreturn
-            # ? -Wredundant-decls
-            #    Warn if anything is declared more than once in the same scope,
-            # ? -Wnested-externs
-            #    Warn if an `extern' declaration is encountered within an
-            #    function.  -Wlong-long
-            # Ha. this is the default! with -pedantic.
-            # -Wno-long-long for the nicest bit of C99
-            #
-            # -Wcast-align is now removed: it gives too many false positives
-            #    e.g. when accessing registers - this is all aligned
-
-            2.7 => "",
-            2.8 => "",
-
-            #2.8  => "-Wsign-compare",
-            2.95 => "",
-
-            # 2.95 does align functions per default -malign-functions=4
-            #      where the argument is used as a power of 2
-            # 3.x  does not align functions per default, its turned on with
-            #      -O2 and -O3
-            #      -falign-functions=16 is the real alignment, no exponent
-            3.0 => "",
-
-            #3.0 => "-Wformat-nonliteral -Wformat-security -Wpacked "
-            #    . "-Wdisabled-optimization -mno-accumulate-outgoing-args "
-            #    . "-Wno-shadow -falign-functions=16 ",
-            4.0 => ""
-                #. " -Wfatal-errors"
-                . " -Wmissing-field-initializers"
-                . " -Wmissing-include-dirs"
-                . " -Wvariadic-macros"
-                #. " -Wno-discard-qual"
-                . " -Wno-pointer-sign"
-                . "",
-            4.1 => ""
-                . " -Wc++-compat"
-                . "",
-            4.2 => ""
-                . " -Wlogical-op"
-                . "",
-
-            # -Wsequence-point is part of -Wall
-            # -Wfloat-equal may not be what we want
-            # We shouldn't be using __packed__, but I doubt -Wpacked will harm
-            # us -Wpadded may prove interesting, or even noisy.
-            # -Wunreachable-code might be useful in a non debugging version
-        );
-
-        $warns = "";
-        my @warning_options = ( [EMAIL PROTECTED] );
-        push @warning_options, [EMAIL PROTECTED]
-            if $conf->options->get('cage');
-
-        foreach my $curr_opt_and_vers (@warning_options) {
-            while ( my ( $vers, $opt ) = splice @$curr_opt_and_vers, 0, 2 ) {
-                last if $vers > $gccversion;
-                next unless $opt;    # Ignore blank lines
-
-                if ( $opt =~ /-mno-accumulate-outgoing-args/ ) {
-                    use Config;
-                    if ( $Config{archname} !~ /86/ ) {
-                        $opt =~ s/-mno-accumulate-outgoing-args//;
-                    }
+    # If using gcc, crank up its warnings as much as possible and make it
+    # behave  ansi-ish.  Here's an attempt at a list of nasty things we can
+    # use for a given version of gcc. The earliest documentation I
+    # currently have access to is for 2.95, so I don't know what version
+    # everything came in at. If it turns out that you're using 2.7.2 and
+    # -Wfoo isn't recognised there, move it up into the next version becone
+    # (2.8)
+
+    # Don't use -ansi -pedantic.  It makes it much harder to compile using
+    # the system headers, which may well be tuned to a non-strict
+    # environment -- especially since we are using perl5 compilation flags
+    # determined in a non-strict environment.  An example is Solaris 8.
+
+    my @opt_and_vers = (
+              0 => ""
+            . " -W"
+            . " -Wall"
+            . " -Waggregate-return"
+            . " -Wbad-function-cast"
+            . " -Wcast-align"
+            . " -Wcast-qual"
+            . " -Wchar-subscripts "
+            . " -Wcomment"
+            . " -Wdisabled-optimization"
+            . " -Wformat-nonliteral"
+            . " -Wformat-security"
+            . " -Wformat-y2k"
+            . " -Wimplicit"
+            . " -Wimplicit-function-declaration"
+            . " -Wimplicit-int"
+            . " -Wimport"
+            . " -Winline"
+            . " -Wmain"
+            . " -Wmissing-braces"
+            . " -Wmissing-declarations"
+            . " -Wmissing-prototypes"
+            . " -Wnested-externs"
+            . " -Wno-unused"
+            . " -Wnonnull"
+            . " -Wpacked"
+            . " -Wparentheses"
+            . " -Wpointer-arith"
+            . " -Wreturn-type"
+            . " -Wsequence-point"
+            . " -Wshadow"
+            . " -Wsign-compare"
+            . " -Wstrict-aliasing"
+            . " -Wstrict-prototypes"
+            . " -Wswitch"
+            #. " -Wswitch-default"
+            #. " -Wswitch-enum"
+            . " -Wnested-externs"
+            . " -Wundef"
+            . " -Wunknown-pragmas"
+            . " -Wwrite-strings"
+            . (
+                $conf->options->get('maintainer')
+                ? " -Wlarger-than-4096"
+                : ""
+              ),
+
+        # others; ones we might like marked with ?
+        # ? -Wundef for undefined idenfiers in #if
+        # ? -Wbad-function-cast
+        #   Warn whenever a function call is cast to a non-matching type
+        # ? -Wmissing-declarations
+        #   Warn if a global function is defined without a previous
+        #   declaration -Wmissing-noreturn
+        # ? -Wredundant-decls
+        #    Warn if anything is declared more than once in the same scope,
+        # ? -Wnested-externs
+        #    Warn if an `extern' declaration is encountered within an
+        #    function.  -Wlong-long
+        # Ha. this is the default! with -pedantic.
+        # -Wno-long-long for the nicest bit of C99
+        #
+        # -Wcast-align is now removed: it gives too many false positives
+        #    e.g. when accessing registers - this is all aligned
+
+        2.7  => "",
+        2.8  => "-Wsign-compare",
+        2.95 => "",
+
+        # 2.95 does align functions per default -malign-functions=4
+        #      where the argument is used as a power of 2
+        # 3.x  does not align functions per default, its turned on with
+        #      -O2 and -O3
+        #      -falign-functions=16 is the real alignment, no exponent
+        3.0 => ""
+            . " -falign-functions=16"
+            . " -Wdisabled-optimization"
+            . " -Wformat-nonliteral"
+            . " -Wformat-security"
+            . " -mno-accumulate-outgoing-args"
+            . " -Wno-shadow"
+            . " -Wpacked"
+            . "",
+
+        3.4 => ""
+            . " -Wbad-function-cast"
+            . " -Wdeclaration-after-statement"
+            . " -Wextra"
+            . " -Winit-self"
+            . " -Winvalid-pch"
+            . " -Wold-style-definition"
+            . " -Wstrict-aliasing=2"
+            . "",
+
+        # -Wsequence-point is part of -Wall
+        # -Wfloat-equal may not be what we want
+        # We shouldn't be using __packed__, but I doubt -Wpacked will harm
+        # us -Wpadded may prove interesting, or even noisy.
+        # -Wunreachable-code might be useful in a non debugging version
+        4.0 => ""
+            . " -fvisibility=hidden"
+            . " -Wmissing-field-initializers"
+            . "",
+
+        # Needed to prevent C++ compatibility issues
+        4.1 => ""
+            . " -Wc++-compat"
+            . "",
+    );
+
+    my @cage_opt_and_vers = (
+              0 => ""
+            . " -std=c89"
+            . " -Wall"
+            . " -Waggregate-return"
+            . " -Wextra"
+            . " -Wbad-function-cast"
+            . " -Wcast-align"
+            . " -Wcast-qual"
+            . " -Wchar-subscripts "
+            . " -Wcomment"
+            . " -Wconversion"
+            . " -Wdeclaration-after-statement"
+            . " -Wdisabled-optimization"
+            . " -Wformat"
+            . " -Wformat=2"
+            . " -Wformat-nonliteral"
+            . " -Wformat-security"
+            . " -Wformat-y2k"
+            . " -Wimplicit"
+            . " -Wimplicit-function-declaration"
+            . " -Wimplicit-int"
+            . " -Wimport"
+            . " -Winit-self"
+            . " -Winline"
+            . " -Winvalid-pch"
+            . " -Wlarger-than-4096"
+            . " -Wlong-long"
+            . " -Wmain"
+            . " -Wmissing-braces"
+            . " -Wmissing-declarations"
+            . " -Wmissing-format-attribute"
+            . " -Wmissing-noreturn"
+            . " -Wmissing-prototypes"
+            . " -Wnested-externs"
+            . " -Wnonnull"
+            . " -Wold-style-definition"
+            . " -Wpacked"
+            . " -Wpadded"
+            . " -Wparentheses"
+            . " -Wpointer-arith"
+            . " -Wredundant-decls"
+            . " -Wreturn-type"
+            . " -Wsequence-point"
+            . " -Wshadow"
+            . " -Wsign-compare"
+            . " -Wstrict-aliasing"
+            . " -Wstrict-aliasing=2"
+            . " -Wstrict-prototypes"
+            . " -Wswitch"
+            . " -Wswitch-default"
+            . " -Wswitch-enum"
+            . " -Wsystem-headers"
+            . " -Wtrigraphs"
+            . " -Wundef"
+            . " -Wunknown-pragmas"
+            . " -Wunreachable-code"
+            . " -Wunused-function"
+            . " -Wunused-label"
+            . " -Wunused-parameter"
+            . " -Wunused-value"
+            . " -Wunused-variable"
+            . " -Wwrite-strings"
+            #. "-fsyntax-only "
+            #. "-pedantic -pedantic-errors "
+            #. " -w "
+            #. " -Werror "
+            . " -Wno-deprecated-declarations"
+            . " -Wno-div-by-zero"
+            . " -Wno-endif-labels"
+            . " -Werror-implicit-function-declaration"
+            #. " -Wfloat-equal"
+            . " -Wno-format-extra-args"
+            . " -Wno-import"
+            . " -Wno-multichar"
+            #. " -Wuninitialized "
+            #     requires -O
+            #."-Wmost (APPLE ONLY)"
+            #C-only Warning Options
+            #. " -Wtraditional "
+            . "",
+
+        # others; ones we might like marked with ?
+        # ? -Wundef for undefined idenfiers in #if
+        # ? -Wbad-function-cast
+        #   Warn whenever a function call is cast to a non-matching type
+        # ? -Wmissing-declarations
+        #   Warn if a global function is defined without a previous
+        #   declaration -Wmissing-noreturn
+        # ? -Wredundant-decls
+        #    Warn if anything is declared more than once in the same scope,
+        # ? -Wnested-externs
+        #    Warn if an `extern' declaration is encountered within an
+        #    function.  -Wlong-long
+        # Ha. this is the default! with -pedantic.
+        # -Wno-long-long for the nicest bit of C99
+        #
+        # -Wcast-align is now removed: it gives too many false positives
+        #    e.g. when accessing registers - this is all aligned
+
+        2.7 => "",
+        2.8 => "",
+
+        #2.8  => "-Wsign-compare",
+        2.95 => "",
+
+        # 2.95 does align functions per default -malign-functions=4
+        #      where the argument is used as a power of 2
+        # 3.x  does not align functions per default, its turned on with
+        #      -O2 and -O3
+        #      -falign-functions=16 is the real alignment, no exponent
+        3.0 => "",
+
+        #3.0 => "-Wformat-nonliteral -Wformat-security -Wpacked "
+        #    . "-Wdisabled-optimization -mno-accumulate-outgoing-args "
+        #    . "-Wno-shadow -falign-functions=16 ",
+        4.0 => ""
+            #. " -Wfatal-errors"
+            . " -Wmissing-field-initializers"
+            . " -Wmissing-include-dirs"
+            . " -Wvariadic-macros"
+            #. " -Wno-discard-qual"
+            . " -Wno-pointer-sign"
+            . "",
+        4.1 => ""
+            . " -Wc++-compat"
+            . "",
+        4.2 => ""
+            . " -Wlogical-op"
+            . "",
+
+        # -Wsequence-point is part of -Wall
+        # -Wfloat-equal may not be what we want
+        # We shouldn't be using __packed__, but I doubt -Wpacked will harm
+        # us -Wpadded may prove interesting, or even noisy.
+        # -Wunreachable-code might be useful in a non debugging version
+    );
+
+    $warns = "";
+    my @warning_options = ( [EMAIL PROTECTED] );
+    push @warning_options, [EMAIL PROTECTED]
+        if $conf->options->get('cage');
+
+    foreach my $curr_opt_and_vers (@warning_options) {
+        while ( my ( $vers, $opt ) = splice @$curr_opt_and_vers, 0, 2 ) {
+            last if $vers > $gccversion;
+            next unless $opt;    # Ignore blank lines
+
+            if ( $opt =~ /-mno-accumulate-outgoing-args/ ) {
+                use Config;
+                if ( $Config{archname} !~ /86/ ) {
+                    $opt =~ s/-mno-accumulate-outgoing-args//;
                 }
-                $warns .= " $opt";
             }
+            $warns .= " $opt";
         }
+    }
 
-        # if the user overwrites the warnings remove it from $warns
-        if ($ccwarn) {
-            my @warns = split ' ', $warns;
-            foreach my $w ( split ' ', $ccwarn ) {
-                $w =~ s/^-W(?:no-)?(.*)$/$1/;
-                @warns = grep !/^-W(?:no-)?$w$/, @warns;
-            }
-            $warns = join ' ', @warns;
+    # if the user overwrites the warnings remove it from $warns
+    if ($ccwarn) {
+        my @warns = split ' ', $warns;
+        foreach my $w ( split ' ', $ccwarn ) {
+            $w =~ s/^-W(?:no-)?(.*)$/$1/;
+            @warns = grep !/^-W(?:no-)?$w$/, @warns;
         }
+        $warns = join ' ', @warns;
     }
 
     $conf->data->set( sym_export => '__attribute__ ((visibility("default")))' )

Modified: branches/autogcc/t/configure/111-auto_gcc-08.t
==============================================================================
--- branches/autogcc/t/configure/111-auto_gcc-08.t      (original)
+++ branches/autogcc/t/configure/111-auto_gcc-08.t      Sun Oct 28 11:57:21 2007
@@ -5,7 +5,7 @@
 
 use strict;
 use warnings;
-use Test::More tests => 16;
+use Test::More qw(no_plan); # tests => 16;
 use Carp;
 use lib qw( lib t/configure/testlib );
 use_ok('config::init::defaults');
@@ -13,10 +13,10 @@
 use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
 use Parrot::Configure::Test qw( test_step_thru_runstep);
-use Parrot::IO::Capture::Mini;
+#use Parrot::IO::Capture::Mini;
 
 my $args = process_options( {
-    argv            => [ q{--verbose} ],
+    argv            => [],
     mode            => q{configure},
 } );
 
@@ -38,23 +38,23 @@
 isa_ok($step, $step_name);
 ok($step->description(), "$step_name has description");
 
-{
-    my $tie_out = tie *STDOUT, "Parrot::IO::Capture::Mini"
-        or croak "Unable to tie";
+#{
+#    my $tie_out = tie *STDOUT, "Parrot::IO::Capture::Mini"
+#        or croak "Unable to tie";
     my $gnucref = {};
     $gnucref->{__GNUC__} = q{123};
     $gnucref->{__GNUC_MINOR__} = q{456};
     ok($step->_evaluate_gcc($conf, $gnucref),
         "_evaluate_gcc() returned true value");
-    my @more_lines = $tie_out->READLINE;
-    ok( @more_lines, "verbose output captured" );
+#    my @more_lines = $tie_out->READLINE;
+#    ok( @more_lines, "verbose output captured" );
     ok(defined $conf->data->get( 'gccversion' ),
         "gccversion defined as expected");
     is($conf->data->get( 'gccversion' ), q{123.456},
         "Got expected value for gccversion");
     is($step->result(), q{yes}, "Got expected result");
-}
-untie *STDOUT;
+#}
+#untie *STDOUT;
 
 pass("Keep Devel::Cover happy");
 pass("Completed all tests in $0");

Added: branches/autogcc/t/configure/111-auto_gcc-09.t
==============================================================================
--- (empty file)
+++ branches/autogcc/t/configure/111-auto_gcc-09.t      Sun Oct 28 11:57:21 2007
@@ -0,0 +1,93 @@
+#! perl
+# Copyright (C) 2007, The Perl Foundation.
+# $Id$
+# 111-auto_gcc-09.t
+
+use strict;
+use warnings;
+use Test::More tests => 16;
+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);
+use Parrot::IO::Capture::Mini;
+
+my $args = process_options( {
+    argv            => [ q{--verbose} ],
+    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 $tie_out = tie *STDOUT, "Parrot::IO::Capture::Mini"
+        or croak "Unable to tie";
+    my $gnucref = {};
+    $gnucref->{__GNUC__} = q{123};
+    $gnucref->{__GNUC_MINOR__} = q{456};
+    ok($step->_evaluate_gcc($conf, $gnucref),
+        "_evaluate_gcc() returned true value");
+    my @more_lines = $tie_out->READLINE;
+    ok( @more_lines, "verbose output captured" );
+    ok(defined $conf->data->get( 'gccversion' ),
+        "gccversion defined as expected");
+    is($conf->data->get( 'gccversion' ), q{123.456},
+        "Got expected value for gccversion");
+    is($step->result(), q{yes}, "Got expected result");
+}
+untie *STDOUT;
+
+pass("Keep Devel::Cover happy");
+pass("Completed all tests in $0");
+
+################### DOCUMENTATION ###################
+
+=head1 NAME
+
+111-auto_gcc-09.t - test config::auto::gcc
+
+=head1 SYNOPSIS
+
+    % prove t/configure/111-auto_gcc-09.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-10.t
==============================================================================
--- (empty file)
+++ branches/autogcc/t/configure/111-auto_gcc-10.t      Sun Oct 28 11:57:21 2007
@@ -0,0 +1,91 @@
+#! perl
+# Copyright (C) 2007, The Perl Foundation.
+# $Id$
+# 111-auto_gcc-10.t
+
+use strict;
+use warnings;
+use Test::More qw(no_plan); # tests => 15;
+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);
+#use Parrot::IO::Capture::Mini;
+
+my $args = process_options( {
+#    argv            => [ q{--verbose} ],
+    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 $tie_out = tie *STDOUT, "Parrot::IO::Capture::Mini"
+#        or croak "Unable to tie";
+    my $gnucref = {};
+    $gnucref->{__GNUC__} = q{abc123};
+    ok($step->_evaluate_gcc($conf, $gnucref),
+        "_evaluate_gcc() returned true value");
+#    my @more_lines = $tie_out->READLINE;
+#    ok( @more_lines, "verbose output captured" );
+    ok(! defined $conf->data->get( 'gccversion' ),
+        "gccversion undef as expected");
+    is($step->result(), q{no}, "Got expected result");
+#}
+#untie *STDOUT;
+
+pass("Keep Devel::Cover happy");
+pass("Completed all tests in $0");
+
+################### DOCUMENTATION ###################
+
+=head1 NAME
+
+111-auto_gcc-10.t - test config::auto::gcc
+
+=head1 SYNOPSIS
+
+    % prove t/configure/111-auto_gcc-10.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