The attached coretest.patch file adds a "make coretest" target to
Parrot.  This target runs a smaller subset of tests than the normal
"make test" target.  On my system, "make test" completes in ~290
seconds, while "make coretest" completes in ~200.

The following tests are not included in make coretest:
    t/configure/
    t/postconfigure/
    t/compilers/json/
    t/examples/
    t/doc/
    t/distro/
    t/codingstd/

This patch also refactors the way that the default lists of test are
constructed in t/harness, so that we aren't globbing test directories
for lists of files we're not going to run anyway.

Lastly, this patch will make it possible for us to factor out the
$(RUNCORE_TESTS) variable that lists other "core tests" to be run for
the various runcores.  At present adding core tests to Parrot involves
updating both t/harness and the Makefile, this refactor will make it
possible to keep the list in one place (t/harness).

Feedback welcome.  If I hear support for this patch I'll go ahead and
apply it (with any suggested changes).

Thanks!

Pm

Index: t/harness
===================================================================
--- t/harness	(revision 23180)
+++ t/harness	(working copy)
@@ -102,6 +102,12 @@
 my $gc_debug = grep { $_ eq '--gc-debug' } @ARGV;
 @ARGV = grep { $_ ne '--gc-debug' } @ARGV;
 
+my $core_tests_only = grep { $_ eq '--core-tests' } @ARGV;
[EMAIL PROTECTED] = grep { $_ ne '--core-tests' } @ARGV;
+
+my $runcore_tests_only = grep { $_ eq '--runcore-tests' } @ARGV;
[EMAIL PROTECTED] = grep { $_ ne '--runcore-tests' } @ARGV;
+
 my $html = grep { $_ eq '--html' } @ARGV;
 @ARGV = grep { $_ ne '--html' } @ARGV;
 
@@ -134,6 +140,8 @@
     -D[number] ... pass debug flags to parrot interpreter
     --running-make-test
     --gc-debug
+    --core-tests
+    --runcore-tests
     --html
     --tr       ... run using Test::Run
 EOF
@@ -148,54 +156,85 @@
 $args =~ s/-D/-D$opts{D}/;
 $args .= ' --gc-debug'    if $gc_debug;
 # XXX find better way for passing run_exec to Parrot::Test
-$args .= ' --run-exec'    if $run_exec; 
+$args .= ' --run-exec'    if $run_exec;
 $ENV{TEST_PROG_ARGS} = $args;
 
-# Pass in a list of tests to run on the command line, else run all the tests.
-my @default_tests = map {glob "t/$_/*.t"} qw(
-    configure postconfigure compilers/imcc/* op pmc native_pbc dynpmc dynoplibs
-    compilers/pge compilers/pge/p5regex compilers/pge/p6regex 
-    compilers/pge/perl6regex compilers/tge compilers/json 
-    library examples run src tools perl doc stm
+# Build the lists of tests to be run
+
+# runcore tests are always run.
+my @runcore_tests = qw(
+    t/compilers/imcc/*/*.t
+    t/op/*.t
+    t/pmc/*.t
+    t/native_pbc/*.t
+    t/dynpmc/*.t
+    t/dynoplibs/*.t
+    t/compilers/pge/*.t
+    t/compilers/pge/p5regex/*.t
+    t/compilers/pge/perl6regex/*.t
+    t/compilers/tge/*.t
+    t/library/*.t
 );
 
-# append the distribution checking tests to the default tests
-my @distro_tests = map { "t/distro/$_" } qw(
-    manifest.t
+# core tests are run unless --runcore-tests is present.  Typically
+# this list and the list above are run in response to --core-tests
+my @core_tests = qw(
+    t/run/*.t
+    t/src/*.t
+    t/tools/*.t
+    t/perl/*.t
+    t/stm/*.t
 );
-push @default_tests, @distro_tests;
 
-# append the file_metadata.t only if we're running in a non-release checkout
-push @default_tests, 't/distro/file_metadata.t'
-    if -e "$Bin/../DEVELOPING";
-
-# collect the coding standard tests (that we want to run) together
-# append them to the list of default tests *only* if this is not a release
-my @coding_std_tests = map { "t/codingstd/$_" } qw(
-    c_code_coda.t
-    c_header_guards.t
-    c_indent.t
-    c_struct.t
-    check_toxxx.t
-    copyright.t
-    cppcomments.t
-    cuddled_else.t
-    filenames.t
-    gmt_utc.t
-    linelength.t
-    pccmethod_deps.t
-    pir_code_coda.t
-    svn_id.t
-    tabs.t
-    trailing_space.t
+# configure tests are tests to be run at the beginning of 'make test';
+# standard tests are other tests run by default with no core options
+# present
+my @configure_tests = qw( t/configure/*.t t/postconfigure/*.t );
+my @standard_tests = qw(
+    t/compilers/json/*.t
+    t/examples/*.t
+    t/doc/*.t
+    t/distro/manifest.t
 );
-# XXX: This takes WAY too long to run: perlcritic.t
 
-push @default_tests, @coding_std_tests
-    if -e "$Bin/../DEVELOPING";
+# add metadata.t and coding standards tests only if we're not DEVELOPING
+unless ( -e "$Bin/../DEVELOPING" ) {
+    push @standard_tests, 't/distro/metadata.t';
+    push @standard_tests, map { "t/codingstd/$_" } qw(
+        c_code_coda.t
+        c_header_guards.t
+        c_indent.t
+        c_struct.t
+        check_toxxx.t
+        copyright.t
+        cppcomments.t
+        cuddled_else.t
+        filenames.t
+        gmt_utc.t
+        linelength.t
+        pccmethod_deps.t
+        pir_code_coda.t
+        svn_id.t
+        tabs.t
+        trailing_space.t
+    );
+    # XXX: This takes WAY too long to run: perlcritic.t
+}
 
-my @tests = @ARGV ? map { glob( $_ ) } @ARGV : @default_tests;
+# build the list of default tests
+my @default_tests = @runcore_tests;
+unless ($runcore_tests_only) {
+   push @default_tests, @core_tests;
+   unless ($core_tests_only) {
+       unshift @default_tests, @configure_tests;
+       push @default_tests, @standard_tests;
+   }
+}
 
+# now build the list of tests to run, either from the command
+# line or from @default tests
+my @tests = map { glob( $_ ) } (@ARGV ? @ARGV : @default_tests);
+
 if ($use_test_run) {
     require Test::Run::CmdLine::Iface;
     my $test_run =
Index: config/gen/makefiles/root.in
===================================================================
--- config/gen/makefiles/root.in	(revision 23180)
+++ config/gen/makefiles/root.in	(working copy)
@@ -1402,10 +1402,15 @@
 # Run test cases with a single call of t/harness. Users have to look at only
 # one report. The default set of tests to run is contained in t/harness,
 # make any edits there.
-# Normal core
+# Normal test package
 test : test_prep
 	$(PERL) t/harness $(EXTRA_TEST_ARGS) $(PARROT_ARGS)
 
+# "core tests" -- test basic functionality but not ancillaries
+coretest : test_prep
+	$(PERL) t/harness $(EXTRA_TEST_ARGS) $(PARROT_ARGS) --core-tests
+
+
 # automake compatibility
 check : test
 

Reply via email to