[libcgi-test-perl] 07/24: Fixed a bug in test CGI scripts that lead to weird compile errors in Carp.
Axel Beckert
abe at deuxchevaux.org
Mon Jan 11 00:38:06 UTC 2016
This is an automated email from the git hooks/post-receive script.
abe pushed a commit to annotated tag 0.50
in repository libcgi-test-perl.
commit 468a45f85b40558448057f76f362cbc18157e788
Author: Alexander Tokarev <tokarev at cpan.org>
Date: Sun Mar 25 16:25:27 2012 -0700
Fixed a bug in test CGI scripts that lead to weird compile errors in Carp.
---
.gitignore | 3 ++-
Changes | 9 +++++++++
MANIFEST | 6 +++---
Makefile.PL | 29 ++++++++++++++++++++++++++++-
README | 5 +++--
lib/CGI/Test.pm | 2 +-
t/cgi/{dumpargs => dumpargs.in} | 2 +-
t/cgi/{getform => getform.in} | 2 +-
t/cgi/{printenv => printenv.in} | 2 +-
9 files changed, 49 insertions(+), 11 deletions(-)
diff --git a/.gitignore b/.gitignore
index 4a17d41..1b50d59 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
-.*.swp
\ No newline at end of file
+.*.swp
+*.tar.gz
diff --git a/Changes b/Changes
index e278007..8166221 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,12 @@
+Sun Mar 25 15:49:33 PSD 2012 Alexander Tokarev <tokarev at cpan.org>
+
+ Version 0.2.4
+
+ Fixed a bug in test CGI scripts that cause them to be executed
+ with perl from $PATH rather than the one used to test the
+ module itself. This sometimes resulted in weird errors deep
+ within Carp module.
+
Mon Nov 21 00:17:38 MSD 2011 Alexander Tokarev <tokarev at cpan.org>
Version 0.2.3
diff --git a/MANIFEST b/MANIFEST
index b1bae8b..1cc659b 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -33,9 +33,9 @@ Makefile.PL
MANIFEST
README
t/browse.pl
-t/cgi/dumpargs
-t/cgi/getform
-t/cgi/printenv
+t/cgi/dumpargs.in
+t/cgi/getform.in
+t/cgi/printenv.in
t/env.t
t/get.t
t/parsing.t
diff --git a/Makefile.PL b/Makefile.PL
index c7d4a42..69eba40 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -7,9 +7,32 @@
# as specified in the README file that comes with the distribution.
#
#
-
use ExtUtils::MakeMaker;
+# Munge test CGI scripts so that they run under current Perl
+my @cgi_files = do {
+ my $cgi_dir = 't/cgi';
+ opendir my $dh, $cgi_dir;
+ map { "$cgi_dir/$_" } grep { !/^\.\.?/ } readdir $dh;
+};
+
+for my $file ( @cgi_files ) {
+ my $text = do {
+ open my $fin, '<', $file or die "Can't open $file for reading: $!";
+ local $/ = undef;
+ <$fin>;
+ };
+
+ $text =~ s{exec perl -S}{exec $^X -S};
+ $file =~ s{\.in}{};
+
+ open my $fout, '>', $file or die "Can't open $file for writing: $!";
+ print $fout $text;
+ close $fout;
+
+ chmod 0755, $file;
+};
+
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
@@ -41,5 +64,9 @@ WriteMakefile(
repository => 'http://github.com/nohuhu/CGI-Test',
},
},
+
+ clean => {
+ FILES => 't/cgi/dumpargs t/cgi/getform t/cgi/printenv',
+ },
);
diff --git a/README b/README
index d8e7fc8..8a272ef 100644
--- a/README
+++ b/README
@@ -1,6 +1,8 @@
- CGI::Test 0.2.3
+ CGI::Test 0.2.4
Copyright (c) 2001, Raphael Manfredi
+ Current maintainer: Alexander Tokarev <tokarev at cpan.org>
+
------------------------------------------------------------------------
This program is free software; you can redistribute it and/or modify
it under the terms of the Artistic License, a copy of which can be
@@ -41,4 +43,3 @@ meaning it is ran by the HTTP server itself, and the inability to
handle cookies.
-- Raphael Manfredi <Raphael_Manfredi at pobox.com>
-
diff --git a/lib/CGI/Test.pm b/lib/CGI/Test.pm
index 8385fc6..1d58dcc 100644
--- a/lib/CGI/Test.pm
+++ b/lib/CGI/Test.pm
@@ -23,7 +23,7 @@ use File::Basename;
require Exporter;
use vars qw($VERSION @ISA @EXPORT);
-$VERSION = '0.2.3';
+$VERSION = '0.2.4';
@ISA = qw(Exporter);
@EXPORT = qw(ok);
diff --git a/t/cgi/dumpargs b/t/cgi/dumpargs.in
similarity index 96%
rename from t/cgi/dumpargs
rename to t/cgi/dumpargs.in
index afb7e79..9b86897 100755
--- a/t/cgi/dumpargs
+++ b/t/cgi/dumpargs.in
@@ -1,4 +1,4 @@
-: # feed this into perl
+# feed this into perl
eval 'exec perl -S $0 ${1+"$@"}'
if $running_under_some_shell;
diff --git a/t/cgi/getform b/t/cgi/getform.in
similarity index 98%
rename from t/cgi/getform
rename to t/cgi/getform.in
index 4612248..5e7e006 100755
--- a/t/cgi/getform
+++ b/t/cgi/getform.in
@@ -1,4 +1,4 @@
-: # feed this into perl
+# feed this into perl
eval 'exec perl -S $0 ${1+"$@"}'
if $running_under_some_shell;
diff --git a/t/cgi/printenv b/t/cgi/printenv.in
similarity index 96%
rename from t/cgi/printenv
rename to t/cgi/printenv.in
index c5e3747..e2c610d 100755
--- a/t/cgi/printenv
+++ b/t/cgi/printenv.in
@@ -1,4 +1,4 @@
-: # feed this into perl
+# feed this into perl
eval 'exec perl -S $0 ${1+"$@"}'
if $running_under_some_shell;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libcgi-test-perl.git
More information about the Pkg-perl-cvs-commits
mailing list