r65145 - in /trunk/libtest-regression-perl: Changes MANIFEST MANIFEST.SKIP META.yml Makefile.PL debian/changelog lib/Test/Regression.pm t/perlcriticrc t/podspell.t

periapt-guest at users.alioth.debian.org periapt-guest at users.alioth.debian.org
Sun Nov 21 00:44:53 UTC 2010


Author: periapt-guest
Date: Sun Nov 21 00:44:41 2010
New Revision: 65145

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=65145
Log:
IGNORE-VERSION: 0.06-1
* New upstream release

Added:
    trunk/libtest-regression-perl/MANIFEST.SKIP
      - copied unchanged from r65144, branches/upstream/libtest-regression-perl/current/MANIFEST.SKIP
Modified:
    trunk/libtest-regression-perl/Changes
    trunk/libtest-regression-perl/MANIFEST
    trunk/libtest-regression-perl/META.yml
    trunk/libtest-regression-perl/Makefile.PL
    trunk/libtest-regression-perl/debian/changelog
    trunk/libtest-regression-perl/lib/Test/Regression.pm
    trunk/libtest-regression-perl/t/perlcriticrc
    trunk/libtest-regression-perl/t/podspell.t

Modified: trunk/libtest-regression-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-regression-perl/Changes?rev=65145&op=diff
==============================================================================
--- trunk/libtest-regression-perl/Changes (original)
+++ trunk/libtest-regression-perl/Changes Sun Nov 21 00:44:41 2010
@@ -16,3 +16,7 @@
 	Tested for zero-length output in generating file (rt53893).
 	Added tests for 'open' and 'print' functions failing.
 	Migrated to OS independent access to file system in test scripts
+
+0.06    19-11-2010
+        Switched to binmode for better portability (rt60638).
+        Thank to Christian Walde. Also switched to utf8 format for code.

Modified: trunk/libtest-regression-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-regression-perl/MANIFEST?rev=65145&op=diff
==============================================================================
--- trunk/libtest-regression-perl/MANIFEST (original)
+++ trunk/libtest-regression-perl/MANIFEST Sun Nov 21 00:44:41 2010
@@ -1,21 +1,22 @@
+Build.PL
 Changes
 lib/Test/Regression.pm
 Makefile.PL
-Build.PL
 MANIFEST
+MANIFEST.SKIP
+META.yml
 README
 t/00-load.t
 t/boilerplate.t
 t/changes.t
+t/lib/OutputDir.pm
 t/manifest.t
-t/print.t
 t/open.t
 t/perlcritic.t
 t/perlcriticrc
 t/pod-coverage.t
 t/pod.t
 t/podspell.t
+t/prereq.t
+t/print.t
 t/regression.t
-t/prereq.t
-META.yml
-t/lib/OutputDir.pm

Modified: trunk/libtest-regression-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-regression-perl/META.yml?rev=65145&op=diff
==============================================================================
--- trunk/libtest-regression-perl/META.yml (original)
+++ trunk/libtest-regression-perl/META.yml Sun Nov 21 00:44:41 2010
@@ -1,33 +1,33 @@
 ---
-name: Test-Regression
-version: 0.05
+abstract: 'Test library that can be run in two modes; one to generate outputs and a second to compare against them'
 author:
   - 'Nicholas Bamber <nicholas at periapt.co.uk>'
-abstract: Test library that can be run in two modes; one to generate outputs and a second to compare against them
-license: perl
-resources:
-  license: http://dev.perl.org/licenses/
-  repository: http://github.com/periapt/test-regression/tree
 build_requires:
   DirHandle: 0
   File::Spec: 0
   Test::MockObject: 0
+configure_requires:
+  Module::Build: 0.36
+generated_by: 'Module::Build version 0.3607'
+keywords:
+  - Test
+  - Regression
+license: perl
+meta-spec:
+  url: http://module-build.sourceforge.net/META-spec-v1.4.html
+  version: 1.4
+name: Test-Regression
+provides:
+  Test::Regression:
+    file: lib/Test/Regression.pm
+    version: 0.06
 requires:
   Algorithm::Diff: 0
   FileHandle: 0
   Test::Differences: 0
   Test::More: 0
   Text::Diff: 0
-configure_requires:
-  Module::Build: 0.35
-provides:
-  Test::Regression:
-    file: lib/Test/Regression.pm
-    version: 0.05
-generated_by: Module::Build version 0.35
-meta-spec:
-  url: http://module-build.sourceforge.net/META-spec-v1.4.html
-  version: 1.4
-keywords:
-  - Test
-  - Regression
+resources:
+  license: http://dev.perl.org/licenses/
+  repository: http://github.com/periapt/test-regression/tree
+version: 0.06

Modified: trunk/libtest-regression-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-regression-perl/Makefile.PL?rev=65145&op=diff
==============================================================================
--- trunk/libtest-regression-perl/Makefile.PL (original)
+++ trunk/libtest-regression-perl/Makefile.PL Sun Nov 21 00:44:41 2010
@@ -1,21 +1,21 @@
-# Note: this file was auto-generated by Module::Build::Compat version 0.35
+# Note: this file was auto-generated by Module::Build::Compat version 0.3607
 use ExtUtils::MakeMaker;
 WriteMakefile
 (
-          'PL_FILES' => {},
-          'INSTALLDIRS' => 'site',
           'NAME' => 'Test::Regression',
-          'EXE_FILES' => [],
           'VERSION_FROM' => 'lib/Test/Regression.pm',
           'PREREQ_PM' => {
-                           'Test::MockObject' => 0,
+                           'Algorithm::Diff' => 0,
+                           'DirHandle' => 0,
                            'File::Spec' => 0,
                            'FileHandle' => 0,
-                           'Text::Diff' => 0,
+                           'Test::Differences' => 0,
+                           'Test::MockObject' => 0,
                            'Test::More' => 0,
-                           'Test::Differences' => 0,
-                           'DirHandle' => 0,
-                           'Algorithm::Diff' => 0
-                         }
+                           'Text::Diff' => 0
+                         },
+          'INSTALLDIRS' => 'site',
+          'EXE_FILES' => [],
+          'PL_FILES' => {}
         )
 ;

Modified: trunk/libtest-regression-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-regression-perl/debian/changelog?rev=65145&op=diff
==============================================================================
--- trunk/libtest-regression-perl/debian/changelog (original)
+++ trunk/libtest-regression-perl/debian/changelog Sun Nov 21 00:44:41 2010
@@ -1,3 +1,11 @@
+libtest-regression-perl (0.06-1) UNRELEASED; urgency=low
+
+  IGNORE-VERSION: 0.06-1
+
+  * New upstream release
+
+ -- Nicholas Bamber <nicholas at periapt.co.uk>  Sun, 21 Nov 2010 00:45:32 +0000
+
 libtest-regression-perl (0.05-1) unstable; urgency=low
 
   * Initial Release. (Closes: #594699)

Modified: trunk/libtest-regression-perl/lib/Test/Regression.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-regression-perl/lib/Test/Regression.pm?rev=65145&op=diff
==============================================================================
--- trunk/libtest-regression-perl/lib/Test/Regression.pm (original)
+++ trunk/libtest-regression-perl/lib/Test/Regression.pm Sun Nov 21 00:44:41 2010
@@ -3,6 +3,7 @@
 use warnings;
 use strict;
 use FileHandle;
+use utf8;
 
 =head1 NAME
 
@@ -10,23 +11,26 @@
 
 =head1 VERSION
 
-Version 0.05
+Version 0.06
 
 =cut
 
-our $VERSION = '0.05';
+our $VERSION = '0.06';
 
 =head1 SYNOPSIS
 
   use Test::Regression;
+
   ok_regression(sub {return "hello world"}, "t/out/hello_world.txt");
 
 =head1 DESCRIPTION
 
-Using the various Test:: modules you can compare the output of a function against what you expect.
-However if the output is complex and changes from version to version, maintenance of the expected
-output could be costly. This module allows one to use the test code to generate the expected output,
-so that if the differences with model output are expected, one can easily refresh the model output.
+Using the various Test:: modules you can compare the output of a function
+against what you expect. However if the output is complex and changes from
+version to version, maintenance of the expected output could be costly. This
+module allows one to use the test code to generate the expected output,
+so that if the differences with model output are expected, one can easily
+refresh the model output.
 
 =head1 EXPORT
 
@@ -44,53 +48,58 @@
 
 =head2 ok_regression
 
-This function requires two arguments: a CODE ref and a file path. 
-The CODE ref is expected to return a SCALAR string which 
-can be compared against previous runs.
-If the TEST_REGRESSION_GEN is set to a true value, then the CODE ref is run and the 
-output written to the file. Otherwise the output of the
+This function requires two arguments: a CODE ref and a file path. The CODE ref
+is expected to return a SCALAR string which can be compared against previous
+runs. If the TEST_REGRESSION_GEN is set to a true value, then the CODE ref is
+run and the output written to the file. Otherwise the output of the
 file is compared against the contents of the file.
 There is a third optional argument which is the test name.
 
 =cut
 
 sub ok_regression {
-	my $code_ref = shift;
-	my $file = shift;
-	my $test_name = shift;
-	my $output = eval {&$code_ref();};
-	my $tb = $CLASS->builder;
-	if ($@) {
-		$tb->diag($@);
-		return $tb->ok(0, $test_name);
-	}
+    my $code_ref  = shift;
+    my $file      = shift;
+    my $test_name = shift;
+    my $output    = eval { &$code_ref(); };
+    my $tb        = $CLASS->builder;
+    if ($@) {
+        $tb->diag($@);
+        return $tb->ok( 0, $test_name );
+    }
 
-	# generate the output files if required
-	if ($ENV{TEST_REGRESSION_GEN}) {
-		my $fh = FileHandle->new;
-		$fh->open(">$file") ||  return $tb->ok(0, "$test_name: cannot open $file");
-		if (length $output) {
-			$fh->print($output) || return $tb->ok(0, "actual write failed: $file");
-		}
-		return $tb->ok(1, $test_name);
-	}
+    # generate the output files if required
+    if ( $ENV{TEST_REGRESSION_GEN} ) {
+        my $fh = FileHandle->new;
+        $fh->open(">$file")
+          || return $tb->ok( 0, "$test_name: cannot open $file" );
+        $fh->binmode;
+        if ( length $output ) {
+            $fh->print($output)
+              || return $tb->ok( 0, "actual write failed: $file" );
+        }
+        return $tb->ok( 1, $test_name );
+    }
 
-	# compare the files
-	return $tb->ok(0, "$test_name: cannot read $file") unless -r $file;
-	my $fh = FileHandle->new;
-	$fh->open("<$file") ||  return $tb->ok(0, "$test_name: cannot open $file");
-	my $content = join '', (<$fh>);
-	eq_or_diff($output, $content, $test_name);
-	return $output eq $file;
+    # compare the files
+    return $tb->ok( 0, "$test_name: cannot read $file" ) unless -r $file;
+    my $fh = FileHandle->new;
+    $fh->open("<$file") || return $tb->ok( 0, "$test_name: cannot open $file" );
+    $fh->binmode;
+    my $content = join '', (<$fh>);
+    eq_or_diff( $output, $content, $test_name );
+    return $output eq $file;
 }
 
 =head1 ENVIRONMENT VARIABLES
 
 =head2 TEST_REGRESSION_GEN
 
-If the TEST_REGRESSION_GEN environment file is unset or false in a perl sense, then the named output files must exist and be readable and the
-test will run normally comparing the outputs of the CODE refs against the contents of those files. If the environment variable is true in 
-a perl sense, then model output files will be overwritten with the output of the CODE ref.
+If the TEST_REGRESSION_GEN environment file is unset or false in a perl sense,
+then the named output files must exist and be readable and the test will run
+normally comparing the outputs of the CODE refs against the contents of those
+files. If the environment variable is true in a perl sense, then model output
+files will be overwritten with the output of the CODE ref.
 
 =head1 AUTHOR
 
@@ -104,9 +113,10 @@
 
 =head2 testing of STDERR
 
-The testing of stderr from this module is not as thorough as I would like. L<Test::Builder::Tester> allows turning
-off of stderr checking but not matching by regular expression. Handcrafted efforts currently fall foul of L<Test::Harness>.
-Still it is I believe adequately tested in terms of coverage.
+The testing of stderr from this module is not as thorough as I would like.
+L<Test::Builder::Tester> allows turning off of stderr checking but not matching
+by regular expression. Handcrafted efforts currently fall foul of
+L<Test::Harness>. Still it is I believe adequately tested in terms of coverage.
 
 =head1 SUPPORT
 
@@ -144,13 +154,16 @@
 
 =item Some documentation improvements have been suggested by toolic (http://perlmonks.org/?node_id=622051).
 
-=item Thanks to Filip GraliE<0x144>ski for pointing out I need to test against output of zero length and providing a patch.
+=item Thanks to Filip Graliński for pointing out I need to test against output of zero length and providing a patch.
+
+=item Thanks to Christian Walde for pestering me about newline Windows
+compatibility issues and for providing a patch.
 
 =back 
 
 =head1 COPYRIGHT & LICENSE
 
-Copyright 2009 Nicholas Bamber.
+Copyright 2009-10 Nicholas Bamber.
 
 This program is free software; you can redistribute it and/or modify it
 under the terms of either: the GNU General Public License as published
@@ -161,4 +174,4 @@
 
 =cut
 
-1; # End of Test::Regression
+1;    # End of Test::Regression

Modified: trunk/libtest-regression-perl/t/perlcriticrc
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-regression-perl/t/perlcriticrc?rev=65145&op=diff
==============================================================================
--- trunk/libtest-regression-perl/t/perlcriticrc (original)
+++ trunk/libtest-regression-perl/t/perlcriticrc Sun Nov 21 00:44:41 2010
@@ -1,2 +1,2 @@
 severity = 1
-exclude = Subroutines::ProhibitExplicitReturnUndef Subroutines::RequireArgUnpacking ClassHierarchies::ProhibitAutoloading RegularExpressions Miscellanea::RequireRcsKeywords Documentation::RequirePodAtEnd ControlStructures::ProhibitUnlessBlocks ControlStructures::ProhibitNegativeExpressionsInUnlessAndUntilConditions ControlStructures::ProhibitPostfixControls Documentation::RequirePodSections References::ProhibitDoubleSigils Variables::ProhibitPunctuationVars ValuesAndExpressions::ProhibitInterpolationOfLiterals Subroutines::ProhibitManyArgs ValuesAndExpressions::ProhibitNoisyQuotes ValuesAndExpressions::ProhibitEmptyQuotes
+exclude = Subroutines::ProhibitExplicitReturnUndef Subroutines::RequireArgUnpacking ClassHierarchies::ProhibitAutoloading RegularExpressions Miscellanea::RequireRcsKeywords Documentation::RequirePodAtEnd ControlStructures::ProhibitUnlessBlocks ControlStructures::ProhibitNegativeExpressionsInUnlessAndUntilConditions ControlStructures::ProhibitPostfixControls Documentation::RequirePodSections References::ProhibitDoubleSigils Variables::ProhibitPunctuationVars ValuesAndExpressions::ProhibitInterpolationOfLiterals Subroutines::ProhibitManyArgs ValuesAndExpressions::ProhibitNoisyQuotes ValuesAndExpressions::ProhibitEmptyQuotes Documentation::RequirePodLinksIncludeText

Modified: trunk/libtest-regression-perl/t/podspell.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-regression-perl/t/podspell.t?rev=65145&op=diff
==============================================================================
--- trunk/libtest-regression-perl/t/podspell.t (original)
+++ trunk/libtest-regression-perl/t/podspell.t Sun Nov 21 00:44:41 2010
@@ -15,6 +15,6 @@
    plan( skip_all => $msg );
 }
 
-Test::Spelling::add_stopwords(qw(CPAN Bamber AnnoCPAN RT internalId lang param HTML URLs href sitemap SQL bladger javascript loopName URL globalvars pageId pageid sitemaps XML changefreq en lastmod notfound pagelookup runmode runmodes url utf namespace upto stderr yml toolic Filip Grali));
+Test::Spelling::add_stopwords(qw(CPAN Bamber Walde AnnoCPAN RT internalId lang param HTML URLs href sitemap SQL bladger javascript loopName URL globalvars pageId pageid sitemaps XML changefreq en lastmod notfound pagelookup runmode runmodes url utf namespace upto stderr yml toolic Filip Grali));
 Test::Spelling::all_pod_files_spelling_ok();
 




More information about the Pkg-perl-cvs-commits mailing list