Author: jkeenan
Date: Sat May  5 20:40:48 2007
New Revision: 18433

Modified:
   branches/reconfigure/Configure.pl
   branches/reconfigure/lib/Parrot/Configure/Options.pm

Log:
1.  First pass at adding 'test' option to Configure.pl.  Added code -- which
will probably be refactored further -- for handling that option.  Added
documentation.
2.  Added 'test' option to list of valid options and Usage message in
lib/Parrot/Configure/Options.pm.


Modified: branches/reconfigure/Configure.pl
==============================================================================
--- branches/reconfigure/Configure.pl   (original)
+++ branches/reconfigure/Configure.pl   Sat May  5 20:40:48 2007
@@ -60,6 +60,33 @@
 
 This turns on the user prompts.
 
+=item C<--test>
+
+Run certain tests along with F<Configure.pl>:
+
+=over 4
+
+=item C<--test=configure>
+
+Run tests found in F<t/configure/> I<before> beginning configuration.  These
+tests demonstrate that Parrot's configuration tools will work properly once
+configuration has begun.
+
+=item C<--test=build>
+
+Run tests found in F<t/postconfigure/>, F<t/tools/pmc2cutils/>,
+F<t/tools/ops2cutils/> and F<t/tools/ops2pmutils/> I<after> configuration has
+completed.  These tests demonstrate (a) that certain of Parrot's configuration
+tools are working properly post-configuration; and (b) that certain of
+Parrot's build tools will work properly once you call F<make>.
+
+=item C<--test>
+
+Run the tests described in C<--test=configure>, conduct configuration, then
+run the tests described in C<--test=build>.
+
+=back
+
 =back
 
 Compile Options
@@ -294,6 +321,32 @@
 
 my %args = %$args;
 
+my ($run_configure_tests, $run_build_tests);
+if (defined $args{test}) {
+    if ($args{test} eq '1') {
+        $run_configure_tests = 1;
+        $run_build_tests = 1;
+    } elsif ($args{test} eq 'configure') {
+        $run_configure_tests = 1;
+    } elsif ($args{test} eq 'build') {
+        $run_build_tests = 1;
+    } else {
+        die "'$args{test}' is a bad value for command-line option 'test'";
+    }
+}
+
+if ($run_configure_tests) {
+    print "As you requested, we'll start with some tests of the configuration 
tools.\n\n";
+    system(qq{prove t/configure/*.t})
+        and die "Unable to execute configuration tests";
+    print <<"TEST";
+
+I just ran some tests to demonstrate that
+Parrot's configuration tools will work as intended.
+
+TEST
+}
+
 # from Parrot::Configure::Messages
 print_introduction($parrot_version);
 
@@ -319,6 +372,13 @@
 }
 
 # tell users what to do next
+if ($run_build_tests) {
+    print "\n\n";
+    print "As you requested, I will now run some tests of the build 
tools.\n\n";
+    system(qq{prove t/postconfigure/*.t t/tools/pmc2cutils/*.t 
t/tools/ops2cutils/*.t t/tools/ops2pmutils/*.t})
+        and die "Unable to execute post-configuration and build tools tests";
+}
+
 # from Parrot::Configure::Messages
 print_conclusion($conf->data->get('make'));
 

Modified: branches/reconfigure/lib/Parrot/Configure/Options.pm
==============================================================================
--- branches/reconfigure/lib/Parrot/Configure/Options.pm        (original)
+++ branches/reconfigure/lib/Parrot/Configure/Options.pm        Sat May  5 
20:40:48 2007
@@ -16,8 +16,8 @@
         jitcapable ld ldflags lex libdir libexecdir libs link linkflags
         localstatedir m maintainer mandir miniparrot nomanicheck oldincludedir
         opcode ops optimize parrot_is_shared pmc prefix profile sbindir
-        sharedstatedir step sysconfdir verbose verbose-step version 
without-gdbm
-        without-gmp without-icu yacc);
+        sharedstatedir step sysconfdir test verbose verbose-step version 
+        without-gdbm without-gmp without-icu yacc);
 }
 
 sub process_options {
@@ -88,6 +88,11 @@
                         Execute a single configure step
 
    --ask                Have Configure ask for commonly-changed info
+   --test=configure     Run tests of configuration tools before configuring
+   --test=build         Run tests of build tools after configuring but before
+                        calling 'make'
+   --test               Run configuration tools tests, configure, then run
+                        build tools tests
 
 Compile Options:
 

Reply via email to