summaryrefslogtreecommitdiff
path: root/src/engine/SCons/Tool/msvsTests.py
diff options
context:
space:
mode:
authorGary Oberbrunner <garyo@oberbrunner.com>2011-02-27 21:23:28 +0000
committerGary Oberbrunner <garyo@oberbrunner.com>2011-02-27 21:23:28 +0000
commit8b591af5d3d54a8431c0912d633f80dd2ea6e292 (patch)
treeffda7f12c799eff1181ef58a97e48cb91d0a3e2b /src/engine/SCons/Tool/msvsTests.py
parentcbc6dd724e91223216b929c37be89bc0b48643f4 (diff)
downloadscons-8b591af5d3d54a8431c0912d633f80dd2ea6e292.tar.gz
Fix MSVS tests to work on a 64-bit Windows machine by creating Wow6432Node dummy reg entries.
Diffstat (limited to 'src/engine/SCons/Tool/msvsTests.py')
-rw-r--r--src/engine/SCons/Tool/msvsTests.py20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/engine/SCons/Tool/msvsTests.py b/src/engine/SCons/Tool/msvsTests.py
index c2a8fe28..495fc243 100644
--- a/src/engine/SCons/Tool/msvsTests.py
+++ b/src/engine/SCons/Tool/msvsTests.py
@@ -475,18 +475,28 @@ class DummyRegistry(object):
self.parse(data)
def parse(self, data):
- parent = self.root
+ parents = [None, None]
+ parents[0] = self.root
keymatch = re.compile('^\[(.*)\]$')
valmatch = re.compile('^(?:"(.*)"|[@])="(.*)"$')
for line in data:
m1 = keymatch.match(line)
if m1:
- # add a key, set it to current parent
- parent = self.root.addKey(m1.group(1))
+ # add a key, set it to current parent.
+ # Also create subkey for Wow6432Node of HKLM\Software;
+ # that's where it looks on a 64-bit machine (tests will fail w/o this)
+ parents[0] = self.root.addKey(m1.group(1))
+ if 'HKEY_LOCAL_MACHINE\\Software' in m1.group(1):
+ p1 = m1.group(1).replace('HKEY_LOCAL_MACHINE\\Software', 'HKEY_LOCAL_MACHINE\\Software\\Wow6432Node')
+ parents[1] = self.root.addKey(p1)
+ else:
+ parents[1] = None
else:
m2 = valmatch.match(line)
if m2:
- parent.addValue(m2.group(1),m2.group(2))
+ for p in parents:
+ if p:
+ p.addValue(m2.group(1),m2.group(2))
def OpenKeyEx(self,root,key):
if root == SCons.Util.HKEY_CLASSES_ROOT:
@@ -690,7 +700,7 @@ class msvs80TestCase(msvsTestCase):
class msvsEmptyTestCase(msvsTestCase):
"""Test Empty Registry"""
registry = DummyRegistry(regdata_none)
- default_version = '9.0'
+ default_version = '10.0'
highest_version = None
number_of_versions = 0
install_locs = {