summaryrefslogtreecommitdiff
path: root/QMTest/TestSConsMSVS.py
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2017-09-28 12:18:58 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2017-09-28 12:18:58 +0200
commitbaee03c569c91b745a1e025660b19a718db16e7d (patch)
tree1aaa25835bd24c5c95649cd8ab34d97bafded599 /QMTest/TestSConsMSVS.py
parent4c7fed99e5554ba71d62987c0ec5f1302011b122 (diff)
New upstream version 3.0.0upstream/3.0.0
Diffstat (limited to 'QMTest/TestSConsMSVS.py')
-rw-r--r--QMTest/TestSConsMSVS.py26
1 files changed, 20 insertions, 6 deletions
diff --git a/QMTest/TestSConsMSVS.py b/QMTest/TestSConsMSVS.py
index 537ba17..30eea76 100644
--- a/QMTest/TestSConsMSVS.py
+++ b/QMTest/TestSConsMSVS.py
@@ -13,13 +13,15 @@ as well as any overridden or additional methods or attributes defined
in this subclass.
"""
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 The SCons Foundation
-__revision__ = "QMTest/TestSConsMSVS.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "QMTest/TestSConsMSVS.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import os
import sys
import platform
+import traceback
+from xml.etree import ElementTree
from TestSCons import *
from TestSCons import __all__
@@ -1037,8 +1039,8 @@ class TestSConsMSVS(TestSCons):
input = """\
import SCons
import SCons.Tool.MSCommon
-print "self.scons_version =", repr(SCons.__%s__)
-print "self._msvs_versions =", str(SCons.Tool.MSCommon.query_versions())
+print("self.scons_version =", repr(SCons.__%s__))
+print("self._msvs_versions =", str(SCons.Tool.MSCommon.query_versions()))
""" % 'version'
self.run(arguments = '-n -q -Q -f -', stdin = input)
@@ -1054,7 +1056,7 @@ print "self._msvs_versions =", str(SCons.Tool.MSCommon.query_versions())
enginepath = repr(os.path.join(self._cwd, '..', 'engine'))
replace = 'sys.path = [ %s, join(sys' % enginepath
- contents = self.read(fname)
+ contents = self.read(fname, mode='r')
contents = contents.replace(orig, replace)
self.write(fname, contents)
@@ -1149,13 +1151,25 @@ print "self._msvs_versions =", str(SCons.Tool.MSCommon.query_versions())
try:
host = _ARCH_TO_CANONICAL[host_platform]
- except KeyError, e:
+ except KeyError as e:
# Default to x86 for all other platforms
host = 'x86'
return host
+ def validate_msvs_file(self, file):
+ try:
+ x = ElementTree.parse(file)
+ except:
+ print("--------------------------------------------------------------")
+ print("--------------------------------------------------------------")
+ print(traceback.format_exc())
+ print("Failed to validate xml in MSVS file: ")
+ print(file)
+ print("--------------------------------------------------------------")
+ print("--------------------------------------------------------------")
+ self.fail_test()
# Local Variables:
# tab-width:4
# indent-tabs-mode:nil