summaryrefslogtreecommitdiff
path: root/t/win32
diff options
context:
space:
mode:
authorMarcel Gruenauer <hanekomu@gmail.com>2013-01-22 20:15:08 +0100
committerSteve Hay <steve.m.hay@googlemail.com>2013-06-12 18:11:52 +0100
commit0511665b4b04e5ba7bba14613845524d42f7e938 (patch)
tree9d64f07d74093a19fdb7f2e27c132bdcb42ba59d /t/win32
parent8a753380757ead7b856564fd8b22a477e9738cd1 (diff)
downloadperl-0511665b4b04e5ba7bba14613845524d42f7e938.tar.gz
converted t/win32.t/system* to test.pl style
Diffstat (limited to 't/win32')
-rw-r--r--t/win32/system.t39
-rw-r--r--t/win32/system_tests7
2 files changed, 23 insertions, 23 deletions
diff --git a/t/win32/system.t b/t/win32/system.t
index ba09210577..b81c7abc79 100644
--- a/t/win32/system.t
+++ b/t/win32/system.t
@@ -7,9 +7,12 @@ BEGIN {
@INC = ('../lib', '../../lib');
# XXX this could be further munged to enable some parts on other
# platforms
+ require './test.pl';
+}
+
+BEGIN {
unless ($^O =~ /^MSWin/) {
- print "1..0 # skipped: windows specific test\n";
- exit 0;
+ skip_all 'windows specific test';
}
}
@@ -81,7 +84,7 @@ END {
chdir($cwd) && rmtree("$cwd/$testdir") if -d "$cwd/$testdir";
}
if (open(my $EIN, "$cwd/win32/${exename}_exe.uu")) {
- print "# Unpacking $exename.exe\n";
+ note "Unpacking $exename.exe";
my $e;
{
local $/;
@@ -99,18 +102,18 @@ else {
{
$minus_o = "-o $exename.exe";
}
- print "# Compiling $exename.c\n# $Config{cc} $Config{ccflags} $exename.c\n";
+ note "Compiling $exename.c";
+ note "$Config{cc} $Config{ccflags} $exename.c";
if (system("$Config{cc} $Config{ccflags} $minus_o $exename.c >log 2>&1") != 0) {
- print "# Could not compile $exename.c, status $?\n"
- ."# Where is your C compiler?\n"
- ."1..0 # skipped: can't build test executable\n";
- exit(0);
+ note "Could not compile $exename.c, status $?";
+ note "Where is your C compiler?";
+ skip_all "can't build test executable";
}
unless (-f "$exename.exe") {
if (open(LOG,'<log'))
{
while(<LOG>) {
- print "# ",$_;
+ note $_;
}
}
else {
@@ -121,16 +124,14 @@ else {
copy("$plxname.bat","$plxname.cmd");
chdir($cwd);
unless (-x "$testdir/$exename.exe") {
- print "# Could not build $exename.exe\n"
- ."1..0 # skipped: can't build test executable\n";
- exit(0);
+ note "Could not build $exename.exe";
+ skip_all "can't build test executable";
}
open my $T, "$^X -I../lib -w win32/system_tests |"
or die "Can't spawn win32/system_tests: $!";
my $expect;
my $comment = "";
-my $test = 0;
while (<$T>) {
chomp;
if (/^1\.\./) {
@@ -146,13 +147,11 @@ while (<$T>) {
}
else {
if ($expect ne $_) {
- print "# $comment\n" if $comment;
- print "# want: $expect\n";
- print "# got : $_\n";
- print "not ";
- }
- ++$test;
- print "ok $test\n";
+ note $comment if $comment;
+ note "want: $expect";
+ note "got : $_";
+ }
+ ok($expect eq $_);
}
}
close $T;
diff --git a/t/win32/system_tests b/t/win32/system_tests
index f73745ae8f..7d2eb1c063 100644
--- a/t/win32/system_tests
+++ b/t/win32/system_tests
@@ -3,6 +3,7 @@
use Config;
use Cwd;
use strict;
+use './test.pl';
$| = 1;
@@ -84,13 +85,13 @@ my @av = (
['" "', 'a" "b" "c', "abc"],
);
-print "1.." . (@commands * @av * 2) . "\n";
+plan @commands * @av * 2;
for my $cmds (@commands) {
for my $args (@av) {
my @all_args;
my @cmds = defined($cmds) ? (ref($cmds) ? @$cmds : $cmds) : ();
my @args = defined($args) ? (ref($args) ? @$args : $args) : ();
- print "######## [@cmds]\n";
+ note "####### [@cmds]";
print "<", join('><',
$cmds[$#cmds],
map { my $x = $_; $x =~ s/"//g; $x } @args),
@@ -106,7 +107,7 @@ for my $cmds (@commands) {
$^D = 0;
my $cmdstr = join " ", map { /\s|^$/ && !/\"/
? qq["$_"] : $_ } @cmds, @args;
- print "######## '$cmdstr'\n";
+ note "####### '$cmdstr'";
if (system($cmdstr) != 0) {
print "Failed, status($?)\n";
if ($Config{ccflags} =~ /\bDDEBUGGING\b/) {