[svn:parrot] r36640 - trunk/t/pmc
rurban at svn.parrot.org
rurban at svn.parrot.org
Thu Feb 12 20:40:12 UTC 2009
Author: rurban
Date: Thu Feb 12 20:40:11 2009
New Revision: 36640
URL: https://trac.parrot.org/parrot/changeset/36640
Log:
- Fix TT #325 (3 randomly failing os.t tests on win32)
- skip/todo 2 failing stat and lstat tests on solaris ZFS
Modified:
trunk/t/pmc/os.t
Modified: trunk/t/pmc/os.t
==============================================================================
--- trunk/t/pmc/os.t Thu Feb 12 19:52:14 2009 (r36639)
+++ trunk/t/pmc/os.t Thu Feb 12 20:40:11 2009 (r36640)
@@ -13,6 +13,7 @@
my $MSWin32 = $^O =~ m!MSWin32!;
my $cygwin = $^O =~ m!cygwin!;
+my $solaris = $^O =~ m!solaris!;
my $MSVC = grep { $PConfig{cc} eq $_ } (qw(cl cl.exe));
=head1 NAME
@@ -37,7 +38,23 @@
# test 'cwd'
my $cwd = File::Spec->canonpath(getcwd);
-pir_output_is( <<'CODE', <<"OUT", 'Test cwd' );
+if (File::Spec->case_tolerant(substr($cwd,0,2))) {
+ $cwd = lc($cwd);
+ pir_output_is( <<'CODE', <<"OUT", 'Test cwd' );
+.sub main :main
+ $P1 = new ['OS']
+ $S1 = $P1."cwd"()
+ $S2 = downcase $S1
+ print $S2
+ print "\n"
+ end
+.end
+CODE
+$cwd
+OUT
+}
+else {
+ pir_output_is( <<'CODE', <<"OUT", 'Test cwd' );
.sub main :main
$P1 = new ['OS']
$S1 = $P1."cwd"()
@@ -48,13 +65,18 @@
CODE
$cwd
OUT
+}
# TEST chdir
chdir "src";
my $upcwd = File::Spec->canonpath(getcwd);
chdir '..';
-pir_output_is( <<'CODE', <<"OUT", 'Test chdir' );
+if (File::Spec->case_tolerant(substr($cwd,0,2))) {
+ $cwd = lc($cwd);
+ $upcwd = lc($upcwd);
+
+ pir_output_is( <<'CODE', <<"OUT", 'Test chdir' );
.sub main :main
$P1 = new ['OS']
@@ -62,15 +84,39 @@
$P1."chdir"($S1)
$S1 = $P1."cwd"()
- print $S1
- print "\n"
+ $S2 = downcase $S1
+ say $S2
$S1 = ".."
$P1."chdir"($S1)
$S1 = $P1."cwd"()
- print $S1
- print "\n"
+ $S2 = downcase $S1
+ say $S2
+
+ end
+.end
+CODE
+$upcwd
+$cwd
+OUT
+}
+else {
+ pir_output_is( <<'CODE', <<"OUT", 'Test chdir' );
+.sub main :main
+ $P1 = new ['OS']
+
+ $S1 = "src"
+ $P1."chdir"($S1)
+
+ $S1 = $P1."cwd"()
+ say $S1
+
+ $S1 = ".."
+ $P1."chdir"($S1)
+
+ $S1 = $P1."cwd"()
+ say $S1
end
.end
@@ -78,13 +124,16 @@
$upcwd
$cwd
OUT
+}
# Test mkdir
my $xpto = $upcwd;
$xpto =~ s/src([\/\\]?)$/xpto$1/;
-pir_output_is( <<'CODE', <<"OUT", 'Test mkdir' );
+if (File::Spec->case_tolerant(substr($cwd,0,2))) {
+
+ pir_output_is( <<'CODE', <<"OUT", 'Test mkdir' );
.sub main :main
$P1 = new ['OS']
@@ -94,15 +143,41 @@
$P1."chdir"($S1)
$S1 = $P1."cwd"()
- print $S1
- print "\n"
+ $S2 = downcase $S1
+ say $S2
$S1 = ".."
$P1."chdir"($S1)
$S1 = $P1."cwd"()
- print $S1
- print "\n"
+ $S2 = downcase $S1
+ say $S2
+
+ end
+.end
+CODE
+$xpto
+$cwd
+OUT
+}
+else {
+ pir_output_is( <<'CODE', <<"OUT", 'Test mkdir' );
+.sub main :main
+ $P1 = new ['OS']
+
+ $S1 = "xpto"
+ $I1 = 0o555
+ $P1."mkdir"($S1,$I1)
+ $P1."chdir"($S1)
+
+ $S1 = $P1."cwd"()
+ say $S1
+
+ $S1 = ".."
+ $P1."chdir"($S1)
+
+ $S1 = $P1."cwd"()
+ say $S1
end
.end
@@ -110,6 +185,7 @@
$xpto
$cwd
OUT
+}
# Test remove on a directory
mkdir "xpto" unless -d "xpto";
@@ -163,6 +239,9 @@
.end
CODE
} else {
+ TODO: {
+ local $TODO = "stat on solaris" if $solaris;
+
$stat = sprintf("0x%08x\n" x 13, @s);
pir_output_is( <<'CODE', $stat, 'Test OS.stat' );
.sub main :main
@@ -178,6 +257,7 @@
.end
CODE
}
+}
# test readdir
SKIP: {
@@ -222,7 +302,7 @@
my $lstat;
SKIP: {
- skip 'lstat not available on Win 32 yet', 1 if $MSWin32;
+ skip 'lstat not on Win32, faling on solaris', 1 if $MSWin32 or $solaris;
my @s = lstat('xpto');
if ($cygwin) {
More information about the parrot-commits
mailing list