[svn:parrot] r49492 - in trunk: . compilers/data_json compilers/imcc compilers/pct compilers/pge compilers/tge config/auto/sizes config/auto/zlib docs/book/draft docs/book/pct docs/dev docs/pdds examples/embed examples/languages/abc examples/languages/squaak examples/pge examples/tools ext/nqp-rx include/parrot lib/Parrot lib/Parrot/Configure/Options lib/Parrot/Configure/Options/Test lib/Parrot/Configure/Step ports/cygwin ports/debian runtime/parrot/languages runtime/parrot/library runtime/parrot/library/Math src/call src/gc src/interp src/runcore t/codingstd t/compilers/tge t/configure t/examples t/oo t/pmc t/src t/steps/init/hints tools/build tools/dev tools/release
jkeenan at svn.parrot.org
jkeenan at svn.parrot.org
Sun Oct 10 14:40:36 UTC 2010
Author: jkeenan
Date: Sun Oct 10 14:40:36 2010
New Revision: 49492
URL: https://trac.parrot.org/parrot/changeset/49492
Log:
Merge tt1810_missing_step_tests branch into trunk. Only report missing step tests when --test or --test=build is used.
Modified:
trunk/ (props changed)
trunk/compilers/data_json/Rules.mak (props changed)
trunk/compilers/imcc/Rules.in (props changed)
trunk/compilers/pct/Rules.mak (props changed)
trunk/compilers/pge/Rules.mak (props changed)
trunk/compilers/tge/Rules.mak (props changed)
trunk/config/auto/sizes/intval_maxmin_c.in (props changed)
trunk/config/auto/zlib/ (props changed)
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/examples/tools/pgegrep (props changed)
trunk/ext/nqp-rx/Rules.mak (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/Configure/Options/Test.pm
trunk/lib/Parrot/Configure/Options/Test/Prepare.pm
trunk/lib/Parrot/Configure/Step/Test.pm (props changed)
trunk/lib/Parrot/H2inc.pm (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/runtime/parrot/languages/ (props changed)
trunk/runtime/parrot/library/Math/Rand.pir (props changed)
trunk/runtime/parrot/library/Rules.mak (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/string_gc.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/codingstd/pmc_docs.t (props changed)
trunk/t/compilers/tge/NoneGrammar.tg (props changed)
trunk/t/configure/049-options_test_prepare.t
trunk/t/examples/pgegrep.t (props changed)
trunk/t/oo/objects.t (props changed)
trunk/t/oo/root_new.t (props changed)
trunk/t/pmc/namespace-old.t (props changed)
trunk/t/src/embed.t (props changed)
trunk/t/steps/init/hints/linux-01.t (props changed)
trunk/tools/build/README (props changed)
trunk/tools/build/h2inc.pl (props changed)
trunk/tools/dev/README (props changed)
trunk/tools/dev/addopstags.pl (props changed)
trunk/tools/dev/dump_pbc.pl (props changed)
trunk/tools/dev/fetch_languages.pl (props changed)
trunk/tools/dev/headerizer.pl (props changed)
trunk/tools/dev/mk_gitignore.pl (props changed)
trunk/tools/dev/ncidef2pasm.pl (props changed)
trunk/tools/dev/parrot-config.pir (props changed)
trunk/tools/dev/perlcritic-cage.conf (props changed)
trunk/tools/dev/perlcritic.conf (props changed)
trunk/tools/dev/perltidy.conf (props changed)
trunk/tools/dev/update_copyright.pl (props changed)
trunk/tools/release/crow.pir (props changed)
trunk/tools/release/gen_release_info.pl (props changed)
trunk/tools/release/inc_ver.pir (props changed)
trunk/tools/release/release.json (props changed)
trunk/tools/release/templates.json (props changed)
Modified: trunk/lib/Parrot/Configure/Options/Test.pm
==============================================================================
--- trunk/lib/Parrot/Configure/Options/Test.pm Sun Oct 10 08:10:00 2010 (r49491)
+++ trunk/lib/Parrot/Configure/Options/Test.pm Sun Oct 10 14:40:36 2010 (r49492)
@@ -7,6 +7,7 @@
use Test::Harness;
use lib qw(lib);
use Parrot::Configure::Step::List qw( get_steps_list );
+use Parrot::Configure::Options::Test::Prepare qw( get_steps_missing_tests );
sub new {
my ( $class, $argsref ) = @_;
@@ -107,6 +108,11 @@
if ( $self->get_run('run_build_tests') ) {
print "\n\n";
print "As you requested, I will now run some tests of the build tools.\n\n";
+ my @steps_missing_tests = get_steps_missing_tests();
+ if (@steps_missing_tests) {
+ print "The following configuration steps lack corresponding tests:\n";
+ print " $_\n" for @steps_missing_tests;
+ }
runtests(@postconfiguration_tests) or die
"Post-configuration and build tools tests did not complete successfully; running 'make' might be dubious.";
}
Modified: trunk/lib/Parrot/Configure/Options/Test/Prepare.pm
==============================================================================
--- trunk/lib/Parrot/Configure/Options/Test/Prepare.pm Sun Oct 10 08:10:00 2010 (r49491)
+++ trunk/lib/Parrot/Configure/Options/Test/Prepare.pm Sun Oct 10 14:40:36 2010 (r49492)
@@ -4,13 +4,12 @@
use strict;
use warnings;
use Carp;
-use Data::Dumper;$Data::Dumper::Indent=1;
use File::Find;
-#use Scalar::Util qw( looks_like_number );
use base qw( Exporter );
our @EXPORT_OK = qw(
get_preconfiguration_tests
get_postconfiguration_tests
+ get_steps_missing_tests
);
use lib qw(lib);
use Parrot::Configure::Step::List qw( get_steps_list );
@@ -22,7 +21,7 @@
my ( $steps_tests_simple_ref, $steps_tests_complex_ref ) =
_find_steps_tests($steps_dir);
my @steps_expected = get_steps_list();
-my @steps_tests = _prepare_steps_tests_list(
+my ($steps_tests_ref, $steps_missing_tests_ref) = _prepare_steps_tests_list(
$steps_dir,
$steps_tests_complex_ref,
\@steps_expected,
@@ -34,13 +33,17 @@
sub get_postconfiguration_tests {
my @postconfiguration_tests = (
- @steps_tests,
+ @{$steps_tests_ref},
glob("t/postconfigure/*.t"),
glob("t/pharness/*.t"),
);
return @postconfiguration_tests;
};
+sub get_steps_missing_tests {
+ return @{$steps_missing_tests_ref};
+}
+
########## INTERNAL SUBROUTINES ##########
sub _get_framework_tests {
@@ -87,16 +90,14 @@
}
sub _prepare_steps_tests_list {
- my $steps_dir = shift;
- my $steps_tests_ref = shift;
- my $steps_expected_ref = shift;
- my @steps_tests;
+ my ($steps_dir, $steps_tests_ref, $steps_expected_ref) = @_;
+ my (@steps_tests, @steps_lacking_tests);
# The order of tests of config steps is governed by
# Parrot::Configure::Step::List::get_steps_list().
foreach my $step ( @{ $steps_expected_ref } ) {
my @module_path = split /::/, $step;
my $these_tests = $steps_tests_ref->{$module_path[0]}{$module_path[1]}
- or carp "No tests exist for configure step $step";
+ or push @steps_lacking_tests, $step;
foreach my $k (sort keys %$these_tests) {
if ( $k =~ m/^(\w+)-(\d{2})$/ ) {
my ($secondlevel, $number) = ($1, $2);
@@ -109,7 +110,7 @@
}
}
}
- return @steps_tests;
+ return (\@steps_tests, \@steps_lacking_tests);
}
1;
@@ -132,6 +133,7 @@
use Parrot::Configure::Options::Test::Prepare qw(
get_preconfiguration_tests
get_postconfiguration_tests
+ get_steps_missing_tests
);
...
@@ -163,6 +165,12 @@
t/tools/pmc2cutils/
t/pharness/
+=item * C<get_steps_missing_tests()>
+
+Returns a list of those configuration steps (in format like, I<e.g.,>
+C<auto::stat>) those configuration steps currently lacking tests in
+F<t/steps/>.
+
=back
=head1 AUTHOR
Modified: trunk/t/configure/049-options_test_prepare.t
==============================================================================
--- trunk/t/configure/049-options_test_prepare.t Sun Oct 10 08:10:00 2010 (r49491)
+++ trunk/t/configure/049-options_test_prepare.t Sun Oct 10 14:40:36 2010 (r49492)
@@ -10,9 +10,8 @@
use File::Basename qw( basename fileparse );
use File::Path qw( mkpath );
use File::Temp 0.13 qw| tempdir |;
-use Test::More tests => 10;
+use Test::More tests => 12;
use lib qw( lib );
-use IO::CaptureOutput qw| capture |;
use Parrot::Configure::Options::Test::Prepare ();
my $cwd = cwd();
@@ -75,24 +74,22 @@
auto::sometest
gen::sometest
);
- my $not_expected = q{gen::missing};
- push @tests_expected, $not_expected;
- my %tests_seen = ();
- {
- my ($stdout, $stderr);
- capture (
- sub { %tests_seen = map { $_, 1}
- Parrot::Configure::Options::Test::Prepare::_prepare_steps_tests_list(
- $tdir,
- $steps_tests_complex_ref,
- \@tests_expected,
- ) },
- \$stdout,
- \$stderr,
+ my @not_expected = ( q{gen::missing}, q{auto::fabulous} );
+ my @all_tests = ();
+ push @all_tests, (@tests_expected, @not_expected);
+ my ( $steps_tests_ref, $steps_lacking_tests_ref) =
+ Parrot::Configure::Options::Test::Prepare::_prepare_steps_tests_list(
+ $tdir,
+ $steps_tests_complex_ref,
+ \@all_tests,
);
- like($stderr, qr/No tests exist for configure step $not_expected/,
- "Warning about step class lacking test captured");
- }
+ is( scalar(@$steps_tests_ref), scalar(@tests_expected),
+ "Got expected number of existing steps" );
+ is( scalar(@$steps_lacking_tests_ref), scalar(@not_expected),
+ "Got expected number of missing steps" );
+ is( $steps_lacking_tests_ref->[0], $not_expected[0],
+ "Got expected missing step $not_expected[0]" );
+
ok( chdir $cwd, "Able to change back to starting directory");
}
More information about the parrot-commits
mailing list