From e123fce835056a1e75c6630fe146bb7d45b19970 Mon Sep 17 00:00:00 2001 From: Gary Oberbrunner Date: Sun, 27 Feb 2011 21:51:38 +0000 Subject: Misc Windows test cleanups --- QMTest/TestCmd.py | 5 ++++- src/engine/SCons/Node/FSTests.py | 2 +- test/Delete.py | 31 +++++++++++++++++-------------- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/QMTest/TestCmd.py b/QMTest/TestCmd.py index 2c90302..d64ef78 100644 --- a/QMTest/TestCmd.py +++ b/QMTest/TestCmd.py @@ -1394,7 +1394,10 @@ class TestCmd(object): under the temporary working directory. """ link = self.canonicalize(link) - os.symlink(target, link) + try: + os.symlink(target, link) + except AttributeError: + pass # Windows has no symlink def tempdir(self, path=None): """Creates a temporary directory. diff --git a/src/engine/SCons/Node/FSTests.py b/src/engine/SCons/Node/FSTests.py index e68bcd5..a60b8a4 100644 --- a/src/engine/SCons/Node/FSTests.py +++ b/src/engine/SCons/Node/FSTests.py @@ -1800,7 +1800,7 @@ class FSTestCase(_tempdirTestCase): fs = self.fs root = fs.Dir('/') - d = root._lookup_abs('/tmp/foo/nonexistent-dir', SCons.Node.FS.Dir) + d = root._lookup_abs('/tmp/foo-nonexistent/nonexistent-dir', SCons.Node.FS.Dir) assert d.__class__ == SCons.Node.FS.Dir, str(d.__class__) def test_lookup_uncpath(self): diff --git a/test/Delete.py b/test/Delete.py index 0740a7c..49b4600 100644 --- a/test/Delete.py +++ b/test/Delete.py @@ -28,6 +28,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" Verify that the Delete() Action works. """ +import sys import os.path import TestSCons @@ -149,13 +150,14 @@ test.must_exist('f9.out-Delete') test.must_exist('f14') test.must_exist('d15') test.must_not_exist('f16.out') -test.must_exist('symlinks') -test.must_exist('symlinks/dirtarget') -test.must_exist('symlinks/dirtarget/dircontent') -test.must_exist('symlinks/filetarget') -test.must_exist('symlinks/filelink') -test.must_exist('symlinks/brokenlink') -test.must_exist('symlinks/dirlink') +if sys.platform != 'win32': + test.must_exist('symlinks') + test.must_exist('symlinks/dirtarget') + test.must_exist('symlinks/dirtarget/dircontent') + test.must_exist('symlinks/filetarget') + test.must_exist('symlinks/filelink') + test.must_exist('symlinks/brokenlink') + test.must_exist('symlinks/dirlink') test.run() @@ -180,13 +182,14 @@ test.must_exist('d13-nonexistent.out') test.must_not_exist('f14') test.must_not_exist('d15') test.must_match('f16.out', "f16.in\n") -test.must_exist('symlinks') -test.must_exist('symlinks/dirtarget') -test.must_exist('symlinks/dirtarget/dircontent') -test.must_exist('symlinks/filetarget') -test.must_not_exist('symlinks/filelink') -test.must_not_exist('symlinks/brokenlink') -test.must_not_exist('symlinks/dirlink') +if sys.platform != 'win32': + test.must_exist('symlinks') + test.must_exist('symlinks/dirtarget') + test.must_exist('symlinks/dirtarget/dircontent') + test.must_exist('symlinks/filetarget') + test.must_not_exist('symlinks/filelink') + test.must_not_exist('symlinks/brokenlink') + test.must_not_exist('symlinks/dirlink') test.write("SConstruct", """\ def cat(env, source, target): -- cgit v0.12