From 7c38a1132cebac8b5831f4eeb949fa6c179eb314 Mon Sep 17 00:00:00 2001 From: Gary Oberbrunner Date: Wed, 22 Aug 2012 03:36:22 +0100 Subject: Fixed some test rot in test/IDL/midl.py, so it works on Win7. --- test/IDL/midl.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/test/IDL/midl.py b/test/IDL/midl.py index 08b604e..f5c864f 100644 --- a/test/IDL/midl.py +++ b/test/IDL/midl.py @@ -61,6 +61,7 @@ local = env.Clone(WINDOWS_INSERT_DEF = 1) barsrc = [ 'BarObject.cpp', + 'BarPCH.obj', 'bar.cpp', local.RES('bar.rc', RCFLAGS= '/I${SOURCE.srcdir}'), ] @@ -71,7 +72,7 @@ local.SharedLibrary(target = 'bar.dll', source = barsrc, PCH=local.PCH('BarPCH.cpp', CXXFLAGS='/nologo')[0], PCHSTOP = 'BarPCH.h', - register=1) + register=0) # can't test registration, Win7 requires elevation for that. """) test.write('src/BarObject.cpp',''' @@ -143,12 +144,12 @@ HKCR test.write('src/BarPCH.cpp',''' #include "BarPCH.h" -#ifdef _ATL_STATIC_REGISTRY -#include -#include -#endif +// #ifdef _ATL_STATIC_REGISTRY +// #include +// #include +// #endif -#include +// #include ''') test.write('src/BarPCH.h',''' @@ -161,7 +162,7 @@ test.write('src/BarPCH.h',''' #define STRICT #ifndef _WIN32_WINNT -#define _WIN32_WINNT 0x0400 +#define _WIN32_WINNT 0x0501 #endif #define _ATL_APARTMENT_THREADED @@ -228,10 +229,10 @@ test.write('src/bar.def',''' LIBRARY "bar.DLL" EXPORTS - DllCanUnloadNow @1 PRIVATE - DllGetClassObject @2 PRIVATE - DllRegisterServer @3 PRIVATE - DllUnregisterServer @4 PRIVATE + DllCanUnloadNow PRIVATE + DllGetClassObject PRIVATE + DllRegisterServer PRIVATE + DllUnregisterServer PRIVATE ''') test.write('src/bar.idl',''' -- cgit v0.12 From bc5b27c381326f7538053c6bdf090f712ab70c93 Mon Sep 17 00:00:00 2001 From: Gary Oberbrunner Date: Wed, 22 Aug 2012 03:48:10 +0100 Subject: Fixed test rot in test/MSVS/CPPPATH-Dirs.py. Visual Studio now creates .vcxproj rather than .vcproj. Made the test allow either one's existence to succeed. --- test/MSVS/CPPPATH-Dirs.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/MSVS/CPPPATH-Dirs.py b/test/MSVS/CPPPATH-Dirs.py index d1c24e3..fad2507 100644 --- a/test/MSVS/CPPPATH-Dirs.py +++ b/test/MSVS/CPPPATH-Dirs.py @@ -71,7 +71,9 @@ int main() { test.run() -test.must_exist(test.workpath('Hello.vcproj')) +if not os.path.exists(test.workpath('Hello.vcproj')) and \ + not os.path.exists(test.workpath('Hello.vcxproj')): + test.fail_test("Failed to create Visual Studio project Hello.vcproj or Hello.vcxproj") test.must_exist(test.workpath('Hello.sln')) # vcproj = test.read('Test.vcproj', 'r') -- cgit v0.12 From e0897dcc1fbcca4fcf927cc51df431fb794e7be0 Mon Sep 17 00:00:00 2001 From: Gary Oberbrunner Date: Wed, 22 Aug 2012 04:14:59 +0100 Subject: Skip MinGW test on Windows machines without MinGW. Need to do this, otherwise it fails erroneously. --- test/MinGW/MinGWSharedLibrary.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/MinGW/MinGWSharedLibrary.py b/test/MinGW/MinGWSharedLibrary.py index 896b8b7..dcebd45 100644 --- a/test/MinGW/MinGWSharedLibrary.py +++ b/test/MinGW/MinGWSharedLibrary.py @@ -32,6 +32,9 @@ when using MinGW. import sys import TestSCons +import SCons.Tool.mingw +import SCons.Defaults + _python_ = TestSCons._python_ test = TestSCons.TestSCons() @@ -39,6 +42,9 @@ test = TestSCons.TestSCons() if sys.platform not in ('cygwin','win32',): test.skip_test("Skipping mingw test on non-Windows %s platform."%sys.platform) +if not SCons.Tool.mingw.find(SCons.Defaults.DefaultEnvironment()): + test.skip_test("Skipping mingw test, no MinGW found.\n") + test.write('foobar.cc', """ int abc(int a) { -- cgit v0.12 From e3e353343c926d288214057d29c2461fbcf4d4f8 Mon Sep 17 00:00:00 2001 From: Gary Oberbrunner Date: Wed, 22 Aug 2012 04:27:31 +0100 Subject: Another MinGW test skip fix. --- test/MinGW/WINDOWS_INSERT_DEF.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/MinGW/WINDOWS_INSERT_DEF.py b/test/MinGW/WINDOWS_INSERT_DEF.py index 78aa26e..67d3e9b 100644 --- a/test/MinGW/WINDOWS_INSERT_DEF.py +++ b/test/MinGW/WINDOWS_INSERT_DEF.py @@ -31,12 +31,18 @@ Make sure that WINDOWS_INSERT_DEF isn't ignored when using MinGW. import sys import TestSCons +import SCons.Tool.mingw +import SCons.Defaults + test = TestSCons.TestSCons() if sys.platform not in ('cygwin', 'win32'): test.skip_test( "Skipping mingw test on non-Windows platform: %s" % sys.platform) +if not SCons.Tool.mingw.find(SCons.Defaults.DefaultEnvironment()): + test.skip_test("Skipping mingw test, no MinGW found.\n") + test.write('hello.c', r""" #include int hello_world(void) { return printf("Orbis, te saluto!\n"); } -- cgit v0.12