diff options
author | Daniel Moody <dmoody256@gmail.com> | 2016-11-11 01:24:48 -0500 |
---|---|---|
committer | Daniel Moody <dmoody256@gmail.com> | 2016-11-11 01:24:48 -0500 |
commit | b262fd298cd8c6998db7c8ae5929f420bd86d1ed (patch) | |
tree | 1c22c61ffe72a950fc518aa8c656627dcc3f5936 /QMTest | |
parent | 583160df75328832def92ed56a8c9bb271ac31df (diff) | |
download | scons-b262fd298cd8c6998db7c8ae5929f420bd86d1ed.tar.gz |
Wrote tests to make sure the xml is valid for visual studio project files generated by scons
This can occur when the user puts invalid characters that don't get converted to xml ampersands escapes
Diffstat (limited to 'QMTest')
-rw-r--r-- | QMTest/TestSConsMSVS.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/QMTest/TestSConsMSVS.py b/QMTest/TestSConsMSVS.py index 39dbb5ee..fcca4701 100644 --- a/QMTest/TestSConsMSVS.py +++ b/QMTest/TestSConsMSVS.py @@ -20,6 +20,8 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os import sys import platform +import traceback +from xml.etree import ElementTree from TestSCons import * from TestSCons import __all__ @@ -1156,6 +1158,18 @@ print("self._msvs_versions =", str(SCons.Tool.MSCommon.query_versions())) 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 |