[libcgi-test-perl] 13/24: Another step on the path to Windows glory.
Axel Beckert
abe at deuxchevaux.org
Mon Jan 11 00:38:08 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 bb7e159f4abe3a8826a652e1af8ec53d01d21fbf
Author: Alex Tokarev <nohuhu at nohuhu.org>
Date: Thu Sep 4 19:51:52 2014 -0700
Another step on the path to Windows glory.
---
MANIFEST | 14 +++++++-------
Makefile.PL | 38 ++++++++++++++++++++++++++++----------
t/01_env.t | 2 +-
t/02_parsing.t | 44 +-------------------------------------------
t/cgi/dumpargs.in | 23 +----------------------
t/cgi/getform.in | 23 +----------------------
t/cgi/printenv.in | 23 +----------------------
7 files changed, 40 insertions(+), 127 deletions(-)
diff --git a/MANIFEST b/MANIFEST
index 1cc659b..d965759 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -36,11 +36,11 @@ t/browse.pl
t/cgi/dumpargs.in
t/cgi/getform.in
t/cgi/printenv.in
-t/env.t
-t/get.t
-t/parsing.t
-t/play_get.t
-t/play_multi.t
-t/play_post.t
+t/01_env.t
+t/02_parsing.t
+t/03_get.t
+t/04_post.t
+t/05_play_get.t
+t/06_play_post.t
+t/07_play_multi.t
t/pod.t
-t/post.t
diff --git a/Makefile.PL b/Makefile.PL
index e7c861b..1f88785 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -9,14 +9,16 @@
#
#
use ExtUtils::MakeMaker;
+use Config;
-die "OS unsupported" if $^O =~ /Win32/;
+# /win/ won't work since it will also match Darwin (Mac OS X)
+my ($WINDOWS) = $^O =~ /Win32|cygwin/;
# 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;
+ map { "$cgi_dir/$_" } grep { /\.in$/ } readdir $dh;
};
for my $file ( @cgi_files ) {
@@ -26,14 +28,27 @@ for my $file ( @cgi_files ) {
<$fin>;
};
- $text =~ s{exec perl -S}{exec $^X -S};
- $file =~ s{\.in}{};
+ $text =~ s{#!PERL}{#!${^X}};
- open my $fout, '>', $file or die "Can't open $file for writing: $!";
- print $fout $text;
- close $fout;
+ if ( $WINDOWS ) {
+ $file =~ s{\.in}{\.bat};
+ $file =~ s{/}{\\\\}g;
- chmod 0755, $file;
+ my $pl2bat = $Config{bin} . '\\pl2bat.bat';
+
+ open my $fout, "| $pl2bat > $file" or die "Can't pipe to pl2bat: $!";
+ print $fout $text;
+ close $fout;
+ }
+ else {
+ $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
@@ -56,7 +71,7 @@ WriteMakefile(
},
ABSTRACT => 'CGI regression test framework',
- AUTHOR => 'Raphael Manfredi <Raphael_Manfredi at pobox.com>',
+ AUTHOR => 'Alex Tokarev <tokarev at cpan.org>',
LICENSE => 'perl',
META_MERGE => {
@@ -67,7 +82,10 @@ WriteMakefile(
},
clean => {
- FILES => 't/cgi/dumpargs t/cgi/getform t/cgi/printenv',
+ FILES => q|
+ t/cgi/dumpargs t/cgi/getform t/cgi/printenv
+ t/cgi/dumpargs.bat t/cgi/getform.bat t/cgi/printenv.bat
+ |,
},
);
diff --git a/t/01_env.t b/t/01_env.t
index f958af7..1293731 100644
--- a/t/01_env.t
+++ b/t/01_env.t
@@ -69,7 +69,7 @@ sub parse_content {
my ($h, $cref) = @_;
%$h = ();
foreach my $l (split /\n/, $$cref) {
- my ($k, $v) = $l =~ /^([^=]+)\s*=\s*(.*)$/;
+ my ($k, $v) = $l =~ /^([^\s=]+)\s*=\s*(.*)$/;
$h->{$k} = $v;
}
}
diff --git a/t/02_parsing.t b/t/02_parsing.t
index 7613af8..e9d3f8d 100644
--- a/t/02_parsing.t
+++ b/t/02_parsing.t
@@ -1,49 +1,7 @@
-#
-# $Id: parsing.t,v 1.2 2003/09/29 11:00:50 mshiltonj Exp $
-#
-# Copyright (c) 2001, Raphael Manfredi
-#
-# You may redistribute only under the terms of the Artistic License,
-# as specified in the README file that comes with the distribution.
-#
-# HISTORY
-# $Log: parsing.t,v $
-# Revision 1.2 2003/09/29 11:00:50 mshiltonj
-# CGI::Test has changed ownership. The new owner is Steven Hilton
-# <mshiltonj at mshiltonj.com>. Many thanks to Raphael Manfredi
-# and Steve Fink.
-#
-# CGI::Test is now hosted as a SourceForge project. It is located
-# at <http://cgi-test.sourceforge.net>.
-#
-# POD updated to reflect the above.
-#
-# make() method on various objects has been deprecated, and has been
-# replaced by more conventional (for me, at least) new() method.
-# Support for make() may be removed in a later release.
-#
-# Entire codebase reformatted using perltidy
-# Go to <http://perltidy.sourceforge.net/> to see how neat it is.
-#
-# Self-referential object variable name standardized to '$this'
-# throughout code.
-#
-# Revision 1.1.1.1 2003/09/23 09:47:26 mshiltonj
-# Initial Import
-#
-# Revision 0.1.1.1 2001/04/17 10:42:25 ram
-# patch2: fixed test 4 to match even if there are parameters in type
-#
-# Revision 0.1 2001/03/31 10:54:03 ram
-# Baseline for first Alpha release.
-#
-# $EndLog$
-#
+use Test::More tests => 40;
use CGI::Test;
-print "1..40\n";
-
my $BASE = "http://server:18/cgi-bin";
my $ct = CGI::Test->new(
diff --git a/t/cgi/dumpargs.in b/t/cgi/dumpargs.in
index 9b86897..4790d96 100755
--- a/t/cgi/dumpargs.in
+++ b/t/cgi/dumpargs.in
@@ -1,25 +1,4 @@
-# feed this into perl
- eval 'exec perl -S $0 ${1+"$@"}'
- if $running_under_some_shell;
-
-#
-# $Id: dumpargs,v 1.1.1.1 2003/09/23 09:47:26 mshiltonj Exp $
-#
-# Copyright (c) 2001, Raphael Manfredi
-#
-# You may redistribute only under the terms of the Artistic License,
-# as specified in the README file that comes with the distribution.
-#
-# HISTORY
-# $Log: dumpargs,v $
-# Revision 1.1.1.1 2003/09/23 09:47:26 mshiltonj
-# Initial Import
-#
-# Revision 0.1 2001/03/31 10:54:03 ram
-# Baseline for first Alpha release.
-#
-# $EndLog$
-#
+#!PERL
use CGI qw/:standard/;
diff --git a/t/cgi/getform.in b/t/cgi/getform.in
index 5e7e006..e4cbc7b 100755
--- a/t/cgi/getform.in
+++ b/t/cgi/getform.in
@@ -1,25 +1,4 @@
-# feed this into perl
- eval 'exec perl -S $0 ${1+"$@"}'
- if $running_under_some_shell;
-
-#
-# $Id: getform,v 1.1.1.1 2003/09/23 09:47:26 mshiltonj Exp $
-#
-# Copyright (c) 2001, Raphael Manfredi
-#
-# You may redistribute only under the terms of the Artistic License,
-# as specified in the README file that comes with the distribution.
-#
-# HISTORY
-# $Log: getform,v $
-# Revision 1.1.1.1 2003/09/23 09:47:26 mshiltonj
-# Initial Import
-#
-# Revision 0.1 2001/03/31 10:54:03 ram
-# Baseline for first Alpha release.
-#
-# $EndLog$
-#
+#!PERL
use CGI qw/:standard/;
diff --git a/t/cgi/printenv.in b/t/cgi/printenv.in
index e2c610d..9ea1f4e 100755
--- a/t/cgi/printenv.in
+++ b/t/cgi/printenv.in
@@ -1,25 +1,4 @@
-# feed this into perl
- eval 'exec perl -S $0 ${1+"$@"}'
- if $running_under_some_shell;
-
-#
-# $Id: printenv,v 1.1.1.1 2003/09/23 09:47:26 mshiltonj Exp $
-#
-# Copyright (c) 2001, Raphael Manfredi
-#
-# You may redistribute only under the terms of the Artistic License,
-# as specified in the README file that comes with the distribution.
-#
-# HISTORY
-# $Log: printenv,v $
-# Revision 1.1.1.1 2003/09/23 09:47:26 mshiltonj
-# Initial Import
-#
-# Revision 0.1 2001/03/31 10:54:03 ram
-# Baseline for first Alpha release.
-#
-# $EndLog$
-#
+#!PERL
print "Content-type: text/plain\r\n\r\n";
while (($key, $val) = each %ENV) {
--
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