summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/Delete.py1
-rw-r--r--test/Install/Install.py18
-rw-r--r--test/M4/M4.py9
-rw-r--r--test/MSVC/PCHSTOP-errors.py6
-rw-r--r--test/MSVC/msvc.py2
-rw-r--r--test/MSVC/query_vcbat.py66
6 files changed, 85 insertions, 17 deletions
diff --git a/test/Delete.py b/test/Delete.py
index a7a3062..20dc889 100644
--- a/test/Delete.py
+++ b/test/Delete.py
@@ -181,6 +181,7 @@ test.run(status=2, stderr=None)
fail_strings = [
"No such file or directory",
+ "The system cannot find the file specified",
"The system cannot find the path specified",
]
diff --git a/test/Install/Install.py b/test/Install/Install.py
index 8c461a7..ac84398 100644
--- a/test/Install/Install.py
+++ b/test/Install/Install.py
@@ -134,15 +134,15 @@ test.write(['work', 'f1.in'], "f1.in again again\n")
os.chmod(test.workpath('work', 'export'), 0555)
f = open(f1_out, 'rb')
-expect = """\
-scons: *** [%s] %s: Permission denied
-""" % (os.path.join('export', 'f1.out'),
- test.workpath('work', 'export', 'f1.out'))
-
-test.run(chdir = 'work',
- arguments = f1_out,
- stderr=expect,
- status=2)
+
+expect = [
+ "Permission denied",
+ "The process cannot access the file because it is being used by another process",
+]
+
+test.run(chdir = 'work', arguments = f1_out, stderr=None, status=2)
+
+test.must_contain_any_line(test.stderr(), expect)
f.close()
diff --git a/test/M4/M4.py b/test/M4/M4.py
index d12bb28..44cda7c 100644
--- a/test/M4/M4.py
+++ b/test/M4/M4.py
@@ -48,7 +48,8 @@ sys.exit(0)
""")
test.write('SConstruct', """
-env = Environment(M4 = r'%(_python_)s mym4.py', tools=['default', 'm4'])
+env = Environment(tools=['default', 'm4'],
+ M4 = r'%(_python_)s mym4.py')
env.M4(target = 'aaa.x', source = 'aaa.x.m4')
""" % locals())
@@ -77,9 +78,11 @@ os.system(string.join(sys.argv[1:], " "))
""" % string.replace(test.workpath('wrapper.out'), '\\', '\\\\'))
test.write('SConstruct', """
-foo = Environment(M4=r'%(m4)s', M4FLAGS='-DFFF=fff')
+foo = Environment(tools=['default', 'm4'],
+ M4=r'%(m4)s', M4FLAGS='-DFFF=fff')
m4 = foo.Dictionary('M4')
-bar = Environment(M4 = r'%(_python_)s wrapper.py ' + m4, M4FLAGS='-DBBB=bbb')
+bar = Environment(tools=['default', 'm4'],
+ M4 = r'%(_python_)s wrapper.py ' + m4, M4FLAGS='-DBBB=bbb')
foo.M4(target = 'foo.x', source = 'foo.x.m4')
bar.M4(target = 'bar', source = 'bar.m4')
""" % locals())
diff --git a/test/MSVC/PCHSTOP-errors.py b/test/MSVC/PCHSTOP-errors.py
index 6ffd11a..a460283 100644
--- a/test/MSVC/PCHSTOP-errors.py
+++ b/test/MSVC/PCHSTOP-errors.py
@@ -56,8 +56,7 @@ env.Program('test', 'test.cpp')
expect_stderr = r'''
scons: \*\*\* The PCHSTOP construction must be defined if PCH is defined.
-File "%s", line \d+, in \?
-''' % re.escape(SConstruct_path)
+''' + TestSCons.file_expr
test.run(arguments='SET_PCHSTOP=0', status=2, stderr=expect_stderr)
@@ -65,8 +64,7 @@ test.run(arguments='SET_PCHSTOP=0', status=2, stderr=expect_stderr)
expect_stderr = r'''
scons: \*\*\* The PCHSTOP construction variable must be a string: .+
-File "%s", line \d+, in \?
-''' % re.escape(SConstruct_path)
+''' + TestSCons.file_expr
test.run(arguments='SET_PCHSTOP=1', status=2, stderr=expect_stderr)
diff --git a/test/MSVC/msvc.py b/test/MSVC/msvc.py
index c8fa8dc..e28a87f 100644
--- a/test/MSVC/msvc.py
+++ b/test/MSVC/msvc.py
@@ -180,7 +180,7 @@ test.run(arguments='slow.obj', stderr=None)
slow = time.time() - start
# using precompiled headers should be faster
-limit = slow*0.85
+limit = slow*0.90
if fast >= limit:
print "Using precompiled headers was not fast enough:"
print "slow.obj: %.3fs" % slow
diff --git a/test/MSVC/query_vcbat.py b/test/MSVC/query_vcbat.py
new file mode 100644
index 0000000..a662008
--- /dev/null
+++ b/test/MSVC/query_vcbat.py
@@ -0,0 +1,66 @@
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+import sys
+
+import TestSCons
+
+test = TestSCons.TestSCons(match = TestSCons.match_re)
+
+if sys.platform != 'win32':
+ msg = "Skipping Visual C/C++ test on non-Windows platform '%s'\n" % sys.platform
+ test.skip_test(msg)
+
+#####
+# Test the basics
+
+test.write('SConstruct', """
+#from SCons.Tool.MSCommon.misc import FindMSVSBatFile, \\
+# ParseBatFile, \\
+# MergeMSVSBatFile
+from SCons.Tool.MSCommon import query_versions
+#env = Environment(tools = ['mingw'])
+DefaultEnvironment(tools = [])
+#for v in [9, 8, 7.1, 7]:
+# print " ==== Testing for version %s ==== " % str(v)
+# bat = FindMSVSBatFile(v)
+# print bat
+# if bat:
+# d = ParseBatFile(bat)
+# for k, v in d.items():
+# print k, v
+#MergeMSVSBatFile(env, 9.0)
+#print env['ENV']['PATH']
+print query_versions()
+""")
+
+test.run(stderr = None)
+test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4: