[svn:parrot] r39515 - in trunk: . t/codingstd t/distro
jkeenan at svn.parrot.org
jkeenan at svn.parrot.org
Fri Jun 12 02:45:28 UTC 2009
Author: jkeenan
Date: Fri Jun 12 02:45:27 2009
New Revision: 39515
URL: https://trac.parrot.org/parrot/changeset/39515
Log:
1. Clarify messages in 3 tests; we're requiring test files for each PMC
rather than the other way around.
2. Move test to t/codingstd/ so that it gets run more frequently, as part of
'make codetest'.
Added:
trunk/t/codingstd/test_file_coverage.t
- copied, changed from r39514, trunk/t/distro/test_file_coverage.t
Deleted:
trunk/t/distro/test_file_coverage.t
Modified:
trunk/MANIFEST
Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST Fri Jun 12 02:33:52 2009 (r39514)
+++ trunk/MANIFEST Fri Jun 12 02:45:27 2009 (r39515)
@@ -1,7 +1,7 @@
# ex: set ro:
# $Id$
#
-# generated by tools/dev/mk_manifest_and_skip.pl Fri Jun 12 02:33:21 2009 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Fri Jun 12 02:43:29 2009 UT
#
# See below for documentation on the format of this file.
#
@@ -1520,6 +1520,7 @@
t/codingstd/pod_todo.t [test]
t/codingstd/svn_id.t [test]
t/codingstd/tabs.t [test]
+t/codingstd/test_file_coverage.t [test]
t/codingstd/trailing_space.t [test]
t/compilers/imcc/imcpasm/cfg.t [test]
t/compilers/imcc/imcpasm/opt0.t [test]
@@ -1658,7 +1659,6 @@
t/distro/file_metadata.t [test]
t/distro/manifest.t [test]
t/distro/meta_yml.t [test]
-t/distro/test_file_coverage.t [test]
t/dynoplibs/myops.t [test]
t/dynpmc/dynlexpad.t [test]
t/dynpmc/foo.t [test]
Copied and modified: trunk/t/codingstd/test_file_coverage.t (from r39514, trunk/t/distro/test_file_coverage.t)
==============================================================================
--- trunk/t/distro/test_file_coverage.t Fri Jun 12 02:33:52 2009 (r39514, copy source)
+++ trunk/t/codingstd/test_file_coverage.t Fri Jun 12 02:45:27 2009 (r39515)
@@ -15,11 +15,11 @@
=head1 NAME
-t/distro/test_file_coverage.t - make sure source files have matching tests
+t/codingstd/test_file_coverage.t - make sure source files have matching tests
=head1 SYNOPSIS
- % prove t/distro/test_file_coverage.t
+ % prove t/codingstd/test_file_coverage.t
=head1 DESCRIPTION
@@ -54,15 +54,16 @@
local $" = "\n\t";
# Tests in src/pmc
- ok( !@$test_pmc_miss, "there are PMC files for all test files in $test_pmc_dir" )
+ ok( !@$test_pmc_miss, "there are test files in $test_pmc_dir for all PMC files" )
or diag "files in $pmc_dir but not in test dir:\n\t@$test_pmc_miss";
# Tests in src/dynpmc
- ok( !@$test_dynpmc_miss, "there are PMC files for all test files in $test_dynpmc_dir" )
+ ok( !@$test_dynpmc_miss, "there are test files in $test_dynpmc_dir for all PMC files" )
or diag "files in $dynpmc_dir but not in test dir:\n\t@$test_dynpmc_miss";
# Tests in src/dynoplibs
- ok( !@$test_dynoplibs_miss, "there are OPS files for all test files in $test_dynoplibs_dir" )
+ ok( !@$test_dynoplibs_miss, "there are test files in $test_dynoplibs_dir
+ for all OPS files" )
or diag "files in $dynoplibs_dir but not in test dir:\n\t@$test_dynoplibs_miss";
} # PMC
Deleted: trunk/t/distro/test_file_coverage.t
==============================================================================
--- trunk/t/distro/test_file_coverage.t Fri Jun 12 02:45:27 2009 (r39514)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,121 +0,0 @@
-#! perl
-# Copyright (C) 2006-2007, Parrot Foundation.
-# $Id$
-
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-
-use Test::More;
-use File::Find qw( find );
-use File::Basename qw( fileparse );
-use File::Spec::Functions qw( catdir catfile );
-
-use Parrot::Config;
-
-=head1 NAME
-
-t/distro/test_file_coverage.t - make sure source files have matching tests
-
-=head1 SYNOPSIS
-
- % prove t/distro/test_file_coverage.t
-
-=head1 DESCRIPTION
-
-Makes sure that specific source files have matching test files.
-
-=cut
-
-## make sure PMC files match test files
-PMC: {
-
- # Set variables for pmc
- my $pmc_dir = 'src/pmc';
- my $pmc_suffix = '.pmc';
- my $test_pmc_dir = 't/pmc';
- my $test_pmc_suffix = '.t';
- my $test_pmc_miss = find_files($pmc_dir,$pmc_suffix,$test_pmc_dir,$test_pmc_suffix);
-
- # Set variables for dynpmc
- my $dynpmc_dir = 'src/dynpmc';
- my $dynpmc_suffix = '.pmc';
- my $test_dynpmc_dir = 't/dynpmc';
- my $test_dynpmc_suffix = '.t';
- my $test_dynpmc_miss = find_files($dynpmc_dir,$dynpmc_suffix,$test_dynpmc_dir,$test_dynpmc_suffix);
-
- # Set variables for dynoplibs
- my $dynoplibs_dir = 'src/dynoplibs';
- my $dynoplibs_suffix = '.ops';
- my $test_dynoplibs_dir = 't/dynoplibs';
- my $test_dynoplibs_suffix = '.t';
- my $test_dynoplibs_miss = find_files($dynoplibs_dir,$dynoplibs_suffix,$test_dynoplibs_dir,$test_dynoplibs_suffix);
-
- local $" = "\n\t";
-
- # Tests in src/pmc
- ok( !@$test_pmc_miss, "there are PMC files for all test files in $test_pmc_dir" )
- or diag "files in $pmc_dir but not in test dir:\n\t@$test_pmc_miss";
-
- # Tests in src/dynpmc
- ok( !@$test_dynpmc_miss, "there are PMC files for all test files in $test_dynpmc_dir" )
- or diag "files in $dynpmc_dir but not in test dir:\n\t@$test_dynpmc_miss";
-
- # Tests in src/dynoplibs
- ok( !@$test_dynoplibs_miss, "there are OPS files for all test files in $test_dynoplibs_dir" )
- or diag "files in $dynoplibs_dir but not in test dir:\n\t@$test_dynoplibs_miss";
-} # PMC
-
-# remember to change the number of tests :-)
-BEGIN { plan tests => 3; }
-
-sub files_of_type {
- my ( $listref, $ext ) = @_;
-
- return unless -f $File::Find::name && $File::Find::name =~ m/\Q$ext\E$/;
-
- my ( $name, $path, $suffix ) = fileparse( $File::Find::name, $ext );
-
- push @{$listref} => $name;
-}
-
-sub list_diff {
- my ( $a, $b ) = @_;
-
- my %elem;
- grep { $elem{$_}++ } @$a;
- grep { $elem{$_}-- } @$b;
-
- return [ sort grep { $elem{$_} > 0 } keys %elem ];
-}
-
-sub find_files {
-
- my ($type_dir,$type_suffix,$test_dir,$test_suffix) = @_;
-
- my ( @type_files, @test_files );
-
- # find suffix type files
- find {
- no_chdir => 1,
- wanted => sub { files_of_type( \@type_files, $type_suffix ) },
- } => catdir( $PConfig{build_dir}, $type_dir );
-
- # find test files
- find {
- no_chdir => 1,
- wanted => sub { files_of_type( \@test_files, $test_suffix ) },
- } => catdir( $PConfig{build_dir}, $test_dir );
-
- my $test = list_diff( \@type_files, \@test_files );
-
- return $test;
-
-}
-
-# Local Variables:
-# mode: cperl
-# cperl-indent-level: 4
-# fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:
More information about the parrot-commits
mailing list