Author: jkeenan
Date: Mon Aug 18 18:19:01 2008
New Revision: 30316

Added:
   branches/scriptconfigure/t/configure/testlib/herfoobar
      - copied, changed from r30314, 
/branches/scriptconfigure/t/configure/testlib/hisfoobar
Modified:
   branches/scriptconfigure/Configure.pl
   branches/scriptconfigure/MANIFEST
   branches/scriptconfigure/t/configure/062-options_conf_file.t

Log:
Add additional test of file-based configuration.  Begin to document file-based 
configuration in Configure.pl POD.

Modified: branches/scriptconfigure/Configure.pl
==============================================================================
--- branches/scriptconfigure/Configure.pl       (original)
+++ branches/scriptconfigure/Configure.pl       Mon Aug 18 18:19:01 2008
@@ -84,22 +84,42 @@
 
 =head1 NAME
 
-Configure.pl - Parrot's Configuration Script
+Configure.pl - Parrot's configuration script
 
 =head1 SYNOPSIS
 
     % perl Configure.pl [options]
 
+or:
+
+    % perl Configure.pl --file=/path/to/configuration/directives
+
 =head1 DESCRIPTION
 
 This is Parrot's configuration program. It should be run to create
 the necessary system-specific files before building Parrot.
 
-=head2 Command-line Options
+We now offer two interfaces to configuration:
+
+=over 4
+
+=item * Command-Line Interface
+
+All configuration options are placed on the command-line.  You may request
+interactive configuration.
 
-General Options
+=item * Configuration-File Interface
 
-=over
+All configuration options are placed in a special configuration file whose
+full path is invoked on the command-line as
+C<--file=/path/to/configuration/directives> as the sole command-line option.
+You may not request interactive configuration.
+
+=back
+
+=head2 General Options
+
+=over 4
 
 =item C<--help>
 
@@ -147,7 +167,8 @@
 
 =item C<--ask>
 
-This turns on the user prompts.
+This turns on the user prompts during configuraion.  Available only in
+Command-Line interface.  Not available in Configuration-File interface.
 
 =item C<--test>
 
@@ -178,9 +199,9 @@
 
 =back
 
-Compile Options
+=head2 Compile Options
 
-=over
+=over 4
 
 =item C<--debugging=0>
 
@@ -271,9 +292,9 @@
 
 =back
 
-Parrot Options
+=head2 Parrot Options
 
-=over
+=over 4
 
 =item C<--intval=(type)>
 
@@ -314,9 +335,9 @@
 
 =back
 
-International Components For Unicode (ICU) Options
+=head2 International Components For Unicode (ICU) Options
 
-=over
+=over 4
 
 =item C<--icu-config=/path/to/icu-config>
 
@@ -348,9 +369,9 @@
 
 =back
 
-Other Options
+=head2 Other Options
 
-=over
+=over 4
 
 =item C<--maintainer>
 

Modified: branches/scriptconfigure/MANIFEST
==============================================================================
--- branches/scriptconfigure/MANIFEST   (original)
+++ branches/scriptconfigure/MANIFEST   Mon Aug 18 18:19:01 2008
@@ -1,7 +1,7 @@
 # ex: set ro:
 # $Id$
 #
-# generated by tools/dev/mk_manifest_and_skip.pl Fri Aug  8 01:10:48 2008 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Tue Aug 19 00:20:50 2008 UT
 #
 # See tools/dev/install_files.pl for documentation on the
 # format of this file.
@@ -3334,6 +3334,7 @@
 t/configure/062-options_conf_file.t                         []
 t/configure/testlib/Make_VERSION_File.pm                    []
 t/configure/testlib/Tie/Filehandle/Preempt/Stdin.pm         []
+t/configure/testlib/herfoobar                               []
 t/configure/testlib/hisfoobar                               []
 t/configure/testlib/init/alpha.pm                           []
 t/configure/testlib/init/beta.pm                            []

Modified: branches/scriptconfigure/t/configure/062-options_conf_file.t
==============================================================================
--- branches/scriptconfigure/t/configure/062-options_conf_file.t        
(original)
+++ branches/scriptconfigure/t/configure/062-options_conf_file.t        Mon Aug 
18 18:19:01 2008
@@ -5,7 +5,7 @@
 
 use strict;
 use warnings;
-use Test::More tests =>  9;
+use Test::More tests =>  11;
 use lib qw( lib );
 use Parrot::Configure::Options ();
 use Parrot::Configure::Options::Conf::File qw(
@@ -215,9 +215,10 @@
 };
 like($@, qr/dizzy/, "Invalid option correctly detected during _set_steps()");
 
-########## Overall test of conditional_assignments() ##########
+########## Overall tests of conditional_assignments() ##########
 
 {
+    # hisfoobar expected to fail due to lack of ==cut 
     my $args = {
         mode => 'file',
         argv => [ q{--file=t/configure/testlib/hisfoobar} ],
@@ -240,6 +241,40 @@
         "Got expected die message for options_components()");
 }
 
+{
+    # herfoobar expected to succeed
+    my $args = {
+        mode => 'file',
+        argv => [ q{--file=t/configure/testlib/herfoobar} ],
+    };
+    my ($options_components, $script);
+    ($args, $options_components, $script) =
+        Parrot::Configure::Options::_process_options_components($args);
+    
+    my ($data, $short_circuits_seen_ref) =
+        Parrot::Configure::Options::_initial_pass(
+            $args, $options_components, $script
+        );
+   
+    my $steps_list_ref;
+    ($data, $steps_list_ref) =
+        &{ $options_components->{conditionals} }($data);
+    is_deeply($data, {
+        'link' => '/usr/bin/g++',
+        'maintainer' => undef,
+        'cxx' => '/usr/bin/g++',
+        'nomanicheck' => 1,
+        'file' => 't/configure/testlib/herfoobar',
+        'debugging' => 1,
+        'cc' => '/usr/bin/gcc',
+        'verbose-step' => 'init::hints',
+        'ld' => '/usr/bin/g++'
+      }, "Got expected configuration data");
+
+    is(scalar(@{ $steps_list_ref }), 66,
+        "Got expected number of configuration steps");
+}
+
 pass("Completed all tests in $0");
 
 ################### DOCUMENTATION ###################

Copied: branches/scriptconfigure/t/configure/testlib/herfoobar (from r30314, 
/branches/scriptconfigure/t/configure/testlib/hisfoobar)
==============================================================================
--- /branches/scriptconfigure/t/configure/testlib/hisfoobar     (original)
+++ branches/scriptconfigure/t/configure/testlib/herfoobar      Mon Aug 18 
18:19:01 2008
@@ -83,3 +83,5 @@
 gen::platform
 gen::config_pm
 
+==cut
+

Reply via email to