diff options
author | Steven Knight <knight@baldmt.com> | 2005-10-06 17:15:02 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2005-10-06 17:15:02 (GMT) |
commit | 401ef15c42e9df4f60103dc52b806b3c8ab259fb (patch) | |
tree | 5b83b7fdbc9e3f19a418d0560efba1b3493f46bf /etc | |
parent | 94210da347b187979caa2c5c5b4542455eee8c24 (diff) | |
download | SCons-401ef15c42e9df4f60103dc52b806b3c8ab259fb.zip SCons-401ef15c42e9df4f60103dc52b806b3c8ab259fb.tar.gz SCons-401ef15c42e9df4f60103dc52b806b3c8ab259fb.tar.bz2 |
Refactor MSVS tests to separate file-generation tests (which can be executed on any Windows system) from Visual Studio execution tests (which need a specific VS version installed).
Diffstat (limited to 'etc')
-rw-r--r-- | etc/TestSCons.py | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/etc/TestSCons.py b/etc/TestSCons.py index 649cf8e..e0fd12f 100644 --- a/etc/TestSCons.py +++ b/etc/TestSCons.py @@ -274,6 +274,16 @@ class TestSCons(TestCommon): # we call test.no_result(). self.no_result(skip=1) + def diff_substr(self, expect, actual): + i = 0 + for x, y in zip(expect, actual): + if x != y: + return "Actual did not match expect at char %d:\n" \ + " Expect: %s\n" \ + " Actual: %s\n" \ + % (i, repr(expect[i-20:i+40]), repr(actual[i-20:i+40])) + i = i + 1 + return "Actual matched the expected output???" def java_ENV(self): """ @@ -463,17 +473,19 @@ print "self._msvs_versions =", str(env['MSVS']['VERSIONS']) contents = string.replace(contents, orig, replace) self.write(fname, contents) - def msvs_substitute(self, input, msvs_ver, python=sys.executable): + def msvs_substitute(self, input, msvs_ver, subdir=None, python=sys.executable): if not hasattr(self, '_msvs_versions'): self.msvs_versions() - if msvs_ver in ['7.1']: - python = '"' + python + '"' + if subdir: + workpath = self.workpath(subdir) + else: + workpath = self.workpath() exec_script_main = "from os.path import join; import sys; sys.path = [ join(sys.prefix, 'Lib', 'site-packages', 'scons-%s'), join(sys.prefix, 'scons-%s'), join(sys.prefix, 'Lib', 'site-packages', 'scons'), join(sys.prefix, 'scons') ] + sys.path; import SCons.Script; SCons.Script.main()" % (self._scons_version, self._scons_version) exec_script_main_xml = string.replace(exec_script_main, "'", "'") - result = string.replace(input, r'<WORKPATH>', self.workpath()) + result = string.replace(input, r'<WORKPATH>', workpath) result = string.replace(result, r'<PYTHON>', python) result = string.replace(result, r'<SCONS_SCRIPT_MAIN>', exec_script_main) result = string.replace(result, r'<SCONS_SCRIPT_MAIN_XML>', exec_script_main_xml) |