[svn:parrot] r41850 - in trunk: . config/auto/sizes config/gen/makefiles config/init docs/book/draft docs/book/pct docs/dev docs/pdds examples/embed examples/languages/abc examples/languages/squaak examples/pge include/parrot lib/Parrot/Harness ports/cpan ports/cygwin ports/debian ports/fedora ports/mandriva ports/suse runtime/parrot/languages runtime/parrot/library/Math src/call src/gc src/interp src/runcore t t/compilers/tge t/oo t/pharness t/pmc t/src tools/dev tools/util
jkeenan at svn.parrot.org
jkeenan at svn.parrot.org
Wed Oct 14 02:12:38 UTC 2009
Author: jkeenan
Date: Wed Oct 14 02:12:37 2009
New Revision: 41850
URL: https://trac.parrot.org/parrot/changeset/41850
Log:
Merge library_files branch into trunk. Replace EXTRA_TEST_FILES defined in Makefile with @library_files defined in lib/Parrot/Harness/DefaultTests.pm. Cf.: https://trac.parrot.org/parrot/ticket/1061.
Modified:
trunk/ (props changed)
trunk/config/auto/sizes/intval_maxmin_c.in (props changed)
trunk/config/gen/makefiles/root.in
trunk/config/init/defaults.pm
trunk/docs/book/draft/README (props changed)
trunk/docs/book/draft/appa_glossary.pod (props changed)
trunk/docs/book/draft/appb_patch_submission.pod (props changed)
trunk/docs/book/draft/appc_command_line_options.pod (props changed)
trunk/docs/book/draft/appd_build_options.pod (props changed)
trunk/docs/book/draft/appe_source_code.pod (props changed)
trunk/docs/book/draft/ch01_introduction.pod (props changed)
trunk/docs/book/draft/ch02_getting_started.pod (props changed)
trunk/docs/book/draft/ch07_dynpmcs.pod (props changed)
trunk/docs/book/draft/ch08_dynops.pod (props changed)
trunk/docs/book/draft/ch10_opcode_reference.pod (props changed)
trunk/docs/book/draft/ch11_directive_reference.pod (props changed)
trunk/docs/book/draft/ch12_operator_reference.pod (props changed)
trunk/docs/book/draft/chXX_hlls.pod (props changed)
trunk/docs/book/draft/chXX_library.pod (props changed)
trunk/docs/book/draft/chXX_testing_and_debugging.pod (props changed)
trunk/docs/book/pct/ch01_introduction.pod (props changed)
trunk/docs/book/pct/ch02_getting_started.pod (props changed)
trunk/docs/book/pct/ch03_compiler_tools.pod (props changed)
trunk/docs/book/pct/ch04_pge.pod (props changed)
trunk/docs/book/pct/ch05_nqp.pod (props changed)
trunk/docs/dev/c_functions.pod (props changed)
trunk/docs/pdds/pdd30_install.pod (props changed)
trunk/examples/embed/cotorra.c (props changed)
trunk/examples/languages/abc/ (props changed)
trunk/examples/languages/squaak/ (props changed)
trunk/examples/pge/demo.pir (props changed)
trunk/include/parrot/call.h (props changed)
trunk/include/parrot/gc_api.h (props changed)
trunk/include/parrot/runcore_api.h (props changed)
trunk/include/parrot/runcore_profiling.h (props changed)
trunk/include/parrot/runcore_trace.h (props changed)
trunk/lib/Parrot/Harness/DefaultTests.pm
trunk/ports/cpan/pause_guide.pod (props changed)
trunk/ports/cygwin/parrot-1.0.0-1.cygport (props changed)
trunk/ports/debian/libparrot-dev.install.in (props changed)
trunk/ports/debian/libparrot.install.in (props changed)
trunk/ports/debian/parrot-doc.install.in (props changed)
trunk/ports/debian/parrot.install.in (props changed)
trunk/ports/fedora/parrot.spec.fedora (props changed)
trunk/ports/mandriva/parrot.spec.mandriva (props changed)
trunk/ports/suse/parrot.spec.suse (props changed)
trunk/runtime/parrot/languages/ (props changed)
trunk/runtime/parrot/library/Math/Rand.pir (props changed)
trunk/src/call/ops.c (props changed)
trunk/src/call/pcc.c (props changed)
trunk/src/gc/alloc_memory.c (props changed)
trunk/src/gc/alloc_resources.c (props changed)
trunk/src/gc/api.c (props changed)
trunk/src/gc/malloc.c (props changed)
trunk/src/gc/malloc_trace.c (props changed)
trunk/src/gc/mark_sweep.c (props changed)
trunk/src/gc/system.c (props changed)
trunk/src/interp/inter_cb.c (props changed)
trunk/src/interp/inter_create.c (props changed)
trunk/src/interp/inter_misc.c (props changed)
trunk/src/runcore/cores.c (props changed)
trunk/src/runcore/main.c (props changed)
trunk/src/runcore/profiling.c (props changed)
trunk/src/runcore/trace.c (props changed)
trunk/t/compilers/tge/NoneGrammar.tg (props changed)
trunk/t/harness
trunk/t/oo/root_new.t (props changed)
trunk/t/pharness/01-default_tests.t
trunk/t/pmc/namespace-old.t (props changed)
trunk/t/src/embed.t (props changed)
trunk/tools/dev/fetch_languages.pl (props changed)
trunk/tools/dev/mk_gitignore.pl (props changed)
trunk/tools/util/perlcritic-cage.conf (props changed)
Modified: trunk/config/gen/makefiles/root.in
==============================================================================
--- trunk/config/gen/makefiles/root.in Wed Oct 14 02:10:42 2009 (r41849)
+++ trunk/config/gen/makefiles/root.in Wed Oct 14 02:12:37 2009 (r41850)
@@ -1423,15 +1423,7 @@
t/src/*.t
TOOLS_TEST_FILES := \
t/tools/*.t
-EXTRA_TEST_FILES := \
- t/compilers/json/*.t \
- t/compilers/pct/*.t \
- t/compilers/pge/*.t \
- t/compilers/pge/p5regex/*.t \
- t/compilers/pge/perl6regex/*.t \
- t/compilers/tge/*.t \
- t/library/*.t \
- t/tools/*.t
+LIBRARY_TEST_FILES := @library_tests@
PMC2CUTILS_DIR := t/tools/pmc2cutils
OPS2PMUTILS_DIR := t/tools/ops2pm
OPS2CUTILS_DIR := t/tools/ops2cutils
@@ -1458,10 +1450,6 @@
# We probably need a complete build before running the tests.
test_prep : all
-# We always want to test annotations are persisted in PBC during make test.
-test_pbc_annotation_persistence : test_prep
- $(PERL) t/harness $(EXTRA_TEST_ARGS) -r t/op/annotate.t
-
# 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. Some tests are run in a separate harness only because
@@ -1471,7 +1459,7 @@
test : test_core nqp_test
# Test Parrot core.
-test_core: test_prep test_pbc_annotation_persistence
+test_core: test_prep
$(PERL) t/harness $(EXTRA_TEST_ARGS)
# Test the NQP compiler
@@ -1507,7 +1495,7 @@
src_tests \
run_tests \
perl_tests \
- extra_tests \
+ library_tests \
nqp_test \
codetest \
benchmark_tests \
@@ -1603,9 +1591,9 @@
configure_tests :
$(PERL) t/harness $(CONFIGURE_TEST_FILES)
-# extra tests - tests needed by make fulltest and make cover for completion
-extra_tests : test_prep
- $(PERL) t/harness $(EXTRA_TEST_ARGS) $(EXTRA_TEST_FILES)
+# library tests - tests run by make test but not by make fulltest or make cover
+library_tests : test_prep
+ $(PERL) t/harness $(EXTRA_TEST_ARGS) $(LIBRARY_TEST_FILES)
###############################################################################
#
@@ -2124,7 +2112,7 @@
- at make@ perl_tests
cover-extra: cover.dummy
- - at make@ extra_tests
+ - at make@ library_tests
cover-nqp: cover.dummy
- at make@ nqp_test
Modified: trunk/config/init/defaults.pm
==============================================================================
--- trunk/config/init/defaults.pm Wed Oct 14 02:10:42 2009 (r41849)
+++ trunk/config/init/defaults.pm Wed Oct 14 02:12:37 2009 (r41850)
@@ -20,8 +20,9 @@
use Config;
use FindBin; # see build_dir
-use Parrot::Configure::Step;
use Parrot::BuildUtil;
+use Parrot::Configure::Step;
+use Parrot::Harness::DefaultTests ();
use Cwd qw(abs_path);
use File::Spec;
@@ -265,6 +266,8 @@
# remember corrected archname - jit.pm was using $Config('archname')
_64_bit_adjustments($conf);
+ _set_default_tests($conf);
+
return 1;
}
@@ -298,6 +301,20 @@
return 1;
}
+sub _set_default_tests {
+ my $conf = shift;
+ $conf->data->set( 'runcore_tests' =>
+ ( join ' ' => @Parrot::Harness::DefaultTests::runcore_tests ) );
+ $conf->data->set( 'core_tests' =>
+ ( join ' ' => @Parrot::Harness::DefaultTests::core_tests ) );
+ $conf->data->set( 'library_tests' =>
+ ( join ' ' => @Parrot::Harness::DefaultTests::library_tests ) );
+ $conf->data->set( 'configure_tests' =>
+ ( join ' ' => @Parrot::Harness::DefaultTests::configure_tests ) );
+ $conf->data->set( 'developing_tests' =>
+ ( join ' ' => @Parrot::Harness::DefaultTests::developing_tests ) );
+}
+
1;
# Local Variables:
Modified: trunk/lib/Parrot/Harness/DefaultTests.pm
==============================================================================
--- trunk/lib/Parrot/Harness/DefaultTests.pm Wed Oct 14 02:10:42 2009 (r41849)
+++ trunk/lib/Parrot/Harness/DefaultTests.pm Wed Oct 14 02:12:37 2009 (r41850)
@@ -7,20 +7,32 @@
=head1 DESCRIPTION
-This file exports by default a single subroutine, C<get_default_tests()>,
-which is the list of tests run by F<t/harness> by default.
-
-Upon request, this package exports six arrays holding various sets of tests:
+Upon request, this package exports six arrays holding various sets of paths to
+directories holding test files:
@runcore_tests
@core_tests
@library_tests
@configure_tests
- @standard_tests
@developing_tests
-In list context, C<get_default_tests()> returns the list of default tests. In
-scalar context it returns a reference to that list.
+Each of these arrays holds a list of paths containing wildcards which are
+expanded by the shell when provided to programs such as F<t/harness>. The
+paths describe directories holding test files.
+
+Example:
+
+ @core_tests = qw(
+ t/run/*.t
+ t/src/*.t
+ t/perl/*.t
+ );
+
+
+In addition, Parrot::Harness::Default Tests exports B<by default> one
+subroutine: C<get_default_tests()>. In list context, C<get_default_tests()>
+returns a list of shell-expandable paths to the most common tests. In scalar
+context it returns a reference to that list.
=cut
@@ -34,17 +46,15 @@
@core_tests,
@library_tests,
@configure_tests,
- @standard_tests,
@developing_tests
);
use base qw( Exporter );
-our @EXPORT = qw( get_default_tests );
+our @EXPORT = qw( get_common_tests );
our @EXPORT_OK = qw(
@runcore_tests
@core_tests
@library_tests
@configure_tests
- @standard_tests
@developing_tests
);
@@ -79,47 +89,27 @@
);
# 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
@configure_tests = qw( t/configure/*.t t/steps/*.t t/postconfigure/*.t );
- at standard_tests = qw(
- t/compilers/json/*.t
- t/examples/*.t
- t/doc/*.t
- t/distro/manifest.t
-);
-
- at developing_tests = ( 't/distro/file_metadata.t' );
-# Add in all t/codingstd except for a few skips.
-push @developing_tests, glob 't/codingstd/*.t';
-
-sub get_default_tests {
- my ($core_tests_only, $runcore_tests_only) = @_;
-
- # Add metadata.t and coding standards tests only if we're DEVELOPING
-
- # Note: As of 2008-10-21, we're no longer including @standard_tests in
- # @default_tests -- which means they're not included in 'make test'.
- # But, for the time being, at least, we are still making
- # it an exportable variable. So we'll test for it in
- # t/pharness/01-default_tests.t.
- if ( -e "DEVELOPING" ) {
- push @standard_tests, @developing_tests;
- }
+ at developing_tests = (
+ 't/distro/file_metadata.t',
+ ( glob 't/codingstd/*.t' ),
+);
- # build the list of default tests
- my @default_tests = @runcore_tests;
- unless ($runcore_tests_only) {
- push @default_tests, @core_tests;
- unless ($core_tests_only) {
- push @default_tests, @library_tests;
- unshift @default_tests, @configure_tests;
+sub get_common_tests {
+ my ($longopts) = @_;
+
+ my @common_tests = @runcore_tests;
+ unless ($longopts->{runcore_tests_only}) {
+ push @common_tests, @core_tests;
+ unless ($longopts->{core_tests_only}) {
+ push @common_tests, @library_tests;
+ unshift @common_tests, @configure_tests;
}
}
wantarray
- ? return @default_tests
- : return [ @default_tests ];
+ ? return @common_tests
+ : return [ @common_tests ];
}
1;
Modified: trunk/t/harness
==============================================================================
--- trunk/t/harness Wed Oct 14 02:10:42 2009 (r41849)
+++ trunk/t/harness Wed Oct 14 02:12:37 2009 (r41850)
@@ -4,6 +4,7 @@
use strict;
use warnings;
+use Data::Dumper;$Data::Dumper::Indent=1;
use lib qw( lib );
use Getopt::Std;
@@ -13,7 +14,7 @@
undef $Test::Harness::Switches;
use Parrot::Harness::DefaultTests qw(
- get_default_tests
+ get_common_tests
@developing_tests
);
use Parrot::Harness::Options qw(
@@ -50,19 +51,15 @@
);
$ENV{TEST_PROG_ARGS} = $args;
-# now build the list of tests to run, either from the command
-# line or from @default tests
-my @default_tests = get_default_tests(
- $longopts->{core_tests_only},
- $longopts->{runcore_tests_only}
-);
-
my @tests;
if ($longopts->{code}) {
@tests = @developing_tests;
}
else {
- @tests = map { glob($_) } (@ARGV ? @ARGV : @default_tests);
+ @tests = map { glob($_) } (@ARGV
+ ? @ARGV
+ : get_common_tests( $longopts )
+ );
}
my $harness;
Modified: trunk/t/pharness/01-default_tests.t
==============================================================================
--- trunk/t/pharness/01-default_tests.t Wed Oct 14 02:10:42 2009 (r41849)
+++ trunk/t/pharness/01-default_tests.t Wed Oct 14 02:12:37 2009 (r41850)
@@ -12,7 +12,7 @@
use Parrot::Config qw( %PConfig );
};
plan( skip_all => 't/harness only runs once configuration has completed' ) if $@;
-plan( tests => 30 );
+plan( tests => 29 );
use Carp;
use Cwd;
use File::Temp qw( tempdir );
@@ -21,7 +21,6 @@
@Parrot::Harness::DefaultTests::runcore_tests = qw( alpha.t );
@Parrot::Harness::DefaultTests::core_tests = qw( beta.t );
@Parrot::Harness::DefaultTests::configure_tests = qw( gamma.t );
- at Parrot::Harness::DefaultTests::standard_tests = qw( delta.t );
@Parrot::Harness::DefaultTests::developing_tests = qw( epsilon.t );
@Parrot::Harness::DefaultTests::library_tests = qw( zeta.t );
@@ -31,40 +30,42 @@
my %default_tests_seen;
my $cwd = cwd();
+my $longopts = {};
{
# Simulate non-existence of DEVELOPING
my $tdir1 = tempdir( CLEANUP => 1 );
ok( chdir $tdir1, "Able to change to tempdir for testing");
- ($core_tests_only, $runcore_tests_only) = (0,1);
+# ($core_tests_only, $runcore_tests_only) = (0,1);
+ $longopts = { core_tests_only => 0, runcore_tests_only => 1 };
ok(@default_tests =
- get_default_tests($core_tests_only, $runcore_tests_only),
- "get_default_tests() returned successfully");
+ get_common_tests( $longopts ),
+ "get_common_tests() returned successfully");
is(scalar(@default_tests), 1, "Got expected 1 test");
is($default_tests[0], q{alpha.t}, "runcore_tests only as expected");
@default_tests = ();
- ($core_tests_only, $runcore_tests_only) = (1,0);
+ $longopts = { core_tests_only => 1, runcore_tests_only => 0 };
ok(@default_tests =
- get_default_tests($core_tests_only, $runcore_tests_only),
- "get_default_tests() returned successfully");
+ get_common_tests( $longopts ),
+ "get_common_tests() returned successfully");
is(scalar(@default_tests), 2, "Got expected 2 tests");
is($default_tests[1], q{beta.t}, "core_tests only as expected");
@default_tests = ();
- ($core_tests_only, $runcore_tests_only) = (0,0);
+ $longopts = { core_tests_only => 0, runcore_tests_only => 0 };
ok(@default_tests =
- get_default_tests($core_tests_only, $runcore_tests_only),
- "get_default_tests() returned successfully");
+ get_common_tests( $longopts ),
+ "get_common_tests() returned successfully");
is(scalar(@default_tests), 4, "Got expected 4 tests");
is($default_tests[0], q{gamma.t}, "Start with configure_tests as expected");
is($default_tests[3], q{zeta.t}, "End with library_tests as expected");
@default_tests = ();
- ($core_tests_only, $runcore_tests_only) = (0,0);
+ $longopts = { core_tests_only => 0, runcore_tests_only => 0 };
ok($default_tests_ref =
- get_default_tests($core_tests_only, $runcore_tests_only),
- "get_default_tests() returned successfully");
+ get_common_tests( $longopts ),
+ "get_common_tests() returned successfully");
is(scalar(@{ $default_tests_ref }), 4, "Got expected 4 tests");
ok(chdir $cwd, "Able to change back to starting directory after testing");
@@ -79,46 +80,37 @@
print $FH qq{12345\n};
close $FH or croak "Unable to close file after writing";
- ($core_tests_only, $runcore_tests_only) = (0,1);
+ $longopts = { core_tests_only => 0, runcore_tests_only => 1 };
ok(@default_tests =
- get_default_tests($core_tests_only, $runcore_tests_only),
- "get_default_tests() returned successfully");
+ get_common_tests( $longopts ),
+ "get_common_tests() returned successfully");
is(scalar(@default_tests), 1, "Got expected 1 test");
is($default_tests[0], q{alpha.t}, "runcore_tests only as expected");
- # reset for subsequent tests
- @Parrot::Harness::DefaultTests::standard_tests = qw( delta.t );
@default_tests = ();
- ($core_tests_only, $runcore_tests_only) = (1,0);
+ $longopts = { core_tests_only => 1, runcore_tests_only => 0 };
ok(@default_tests =
- get_default_tests($core_tests_only, $runcore_tests_only),
- "get_default_tests() returned successfully");
+ get_common_tests( $longopts ),
+ "get_common_tests() returned successfully");
is(scalar(@default_tests), 2, "Got expected 2 tests");
is($default_tests[1], q{beta.t}, "core_tests only as expected");
- # reset for subsequent tests
- @Parrot::Harness::DefaultTests::standard_tests = qw( delta.t );
@default_tests = ();
- ($core_tests_only, $runcore_tests_only) = (0,0);
+ $longopts = { core_tests_only => 0, runcore_tests_only => 0 };
ok(@default_tests =
- get_default_tests($core_tests_only, $runcore_tests_only),
- "get_default_tests() returned successfully");
+ get_common_tests( $longopts ),
+ "get_common_tests() returned successfully");
is(scalar(@default_tests), 4, "Got expected 4 tests");
is($default_tests[0], q{gamma.t}, "Start with configure_tests as expected");
is($default_tests[3], q{zeta.t}, "End with library_tests as expected");
- is(scalar(@Parrot::Harness::DefaultTests::standard_tests),
- 2, "Got expected 2 coding standards tests");
- # reset for subsequent tests
- @Parrot::Harness::DefaultTests::standard_tests = qw( delta.t );
@default_tests = ();
- ($core_tests_only, $runcore_tests_only) = (0,0);
+ $longopts = { core_tests_only => 0, runcore_tests_only => 0 };
ok($default_tests_ref =
- get_default_tests($core_tests_only, $runcore_tests_only),
- "get_default_tests() returned successfully");
+ get_common_tests( $longopts ),
+ "get_common_tests() returned successfully");
is(scalar(@{ $default_tests_ref }), 4, "Got expected 4 tests");
# reset for subsequent tests
- @Parrot::Harness::DefaultTests::standard_tests = qw( delta.t );
ok(chdir $cwd, "Able to change back to starting directory after testing");
}
@@ -137,7 +129,7 @@
=head1 DESCRIPTION
-This file holds tests for Parrot::Harness::DefaultTests::get_default_tests().
+This file holds tests for Parrot::Harness::DefaultTests::get_common_tests().
=head1 AUTHOR
More information about the parrot-commits
mailing list