From af7ae3e0489ca6f58a2581add0ceb7da4e7ccf0d Mon Sep 17 00:00:00 2001 From: Gary Oberbrunner Date: Thu, 21 Aug 2014 20:59:35 -0400 Subject: Fixed or skipped tests that fail on Windows. Mostly just per-test changes, but also made match_re strip out CR (\r) chars at end of lines to make Windows match properly. --- QMTest/TestCmd.py | 5 +++-- test/CC/CCVERSION.py | 3 ++- test/CXX/CXXVERSION.py | 2 ++ test/Configure/custom-tests.py | 2 +- test/Copy-Symlinks.py | 3 +++ test/FindSourceFiles.py | 3 ++- 6 files changed, 13 insertions(+), 5 deletions(-) diff --git a/QMTest/TestCmd.py b/QMTest/TestCmd.py index b51d90f..3048973 100644 --- a/QMTest/TestCmd.py +++ b/QMTest/TestCmd.py @@ -486,7 +486,8 @@ def match_re(lines = None, res = None): """ """ if not is_List(lines): - lines = lines.split("\n") + # CRs mess up matching (Windows) so split carefully + lines = re.split('\r?\n', lines) if not is_List(res): res = res.split("\n") if len(lines) != len(res): @@ -683,7 +684,7 @@ if subprocess.mswindows: assert ol is None lpBuffer = ctypes.create_string_buffer(bufSize) bytesRead = DWORD() - bErr = ctypes.windll.kernel32.ReadFile( + bErr = ctypes.windll.kernel32.ReadFile( hFile, lpBuffer, bufSize, ctypes.byref(bytesRead), ol) if not bErr: raise ctypes.WinError() return (0, ctypes.string_at(lpBuffer, bytesRead.value)) diff --git a/test/CC/CCVERSION.py b/test/CC/CCVERSION.py index ac28e38..f785ddc 100644 --- a/test/CC/CCVERSION.py +++ b/test/CC/CCVERSION.py @@ -33,7 +33,8 @@ _exe = TestSCons._exe test = TestSCons.TestSCons() - +if sys.platform == 'win32': + test.skip_test('CCVERSION not set with MSVC, skipping test.') test.write("versioned.py", """import os diff --git a/test/CXX/CXXVERSION.py b/test/CXX/CXXVERSION.py index 8433aa6..6017001 100644 --- a/test/CXX/CXXVERSION.py +++ b/test/CXX/CXXVERSION.py @@ -33,6 +33,8 @@ _exe = TestSCons._exe test = TestSCons.TestSCons() +if sys.platform == 'win32': + test.skip_test('CXXVERSION not set with MSVC, skipping test.') test.write("versioned.py", diff --git a/test/Configure/custom-tests.py b/test/Configure/custom-tests.py index f79ea0d..687ba48 100644 --- a/test/Configure/custom-tests.py +++ b/test/Configure/custom-tests.py @@ -180,7 +180,7 @@ scons: Configure: Display of random string ... scons: Configure: \(cached\) a random string scons: Configure: Display of empty string ... -scons: Configure: \(cached\). +scons: Configure: \(cached\) * scons: Configure: Display of dictionary ... scons: Configure: \(cached\) yes diff --git a/test/Copy-Symlinks.py b/test/Copy-Symlinks.py index f8f92d7..31b2a71 100644 --- a/test/Copy-Symlinks.py +++ b/test/Copy-Symlinks.py @@ -38,6 +38,9 @@ SCons.Defaults.DefaultEnvironment( tools = [] ) test = TestSCons.TestSCons() +if sys.platform == 'win32': + test.skip_test('No symlink-copying (yet) on Windows, skipping test.') + filelinkToCopy = 'filelinkToCopy' fileToLink = 'file.in' fileContents = 'stuff n things\n' diff --git a/test/FindSourceFiles.py b/test/FindSourceFiles.py index 3ba542b..88b9d7e 100644 --- a/test/FindSourceFiles.py +++ b/test/FindSourceFiles.py @@ -28,12 +28,13 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" Test Environment's FindSourceFiles method. """ +import sys import TestSCons test = TestSCons.TestSCons() package_format = "src_tarbz2" -if not test.where_is('tar'): +if not test.where_is('tar') or sys.platform == 'win32': if not test.where_is('zip'): test.skip_test("neither 'tar' nor 'zip' found; skipping test\n") package_format = "src_zip" -- cgit v0.12