diff options
author | Steven Knight <knight@baldmt.com> | 2010-01-26 16:26:26 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2010-01-26 16:26:26 (GMT) |
commit | f5a80d8cf4143edd7434805a568cc0e7eeaf81c0 (patch) | |
tree | 3608231e6b538a5222c7d501cbd9ce8d8ef08c76 /test/runtest/xml/output.py | |
parent | b21c0b3f84d0b064e9d2dd548e0b6d246a537afb (diff) | |
download | SCons-f5a80d8cf4143edd7434805a568cc0e7eeaf81c0.zip SCons-f5a80d8cf4143edd7434805a568cc0e7eeaf81c0.tar.gz SCons-f5a80d8cf4143edd7434805a568cc0e7eeaf81c0.tar.bz2 |
Win32 portability in runtest.py tests after disabling QMTest by default.
Diffstat (limited to 'test/runtest/xml/output.py')
-rw-r--r-- | test/runtest/xml/output.py | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/test/runtest/xml/output.py b/test/runtest/xml/output.py index 3641d22..c024f37 100644 --- a/test/runtest/xml/output.py +++ b/test/runtest/xml/output.py @@ -28,28 +28,20 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" Test writing XML output to a file. """ -import os.path +import os import re -import sys +import string import TestCmd import TestRuntest test = TestRuntest.TestRuntest(match = TestCmd.match_re) -python = TestRuntest.python +pythonstring = re.escape(TestRuntest.pythonstring) test_fail_py = re.escape(os.path.join('test', 'fail.py')) test_no_result_py = re.escape(os.path.join('test', 'no_result.py')) test_pass_py = re.escape(os.path.join('test', 'pass.py')) -# sys.stdout and sys.stderr are open non-binary ('w' instead of 'wb') -# so the lines written on Windows are terminated \r\n, not just \n. The -# expressions below use 'cr' as the optional carriage return character. -if sys.platform in ['win32']: - cr = '\r' -else: - cr = '' - test.subdir('test') test.write_fake_scons_source_tree() @@ -65,8 +57,8 @@ test.run(arguments = '-o xml.out --xml test', status=1) expect = """\ <results> <test> - <file_name>test/fail.py</file_name> - <command_line>%(python)s -tt test/fail.py</command_line> + <file_name>%(test_fail_py)s</file_name> + <command_line>%(pythonstring)s -tt %(test_fail_py)s</command_line> <exit_status>1</exit_status> <stdout>FAILING TEST STDOUT </stdout> @@ -75,8 +67,8 @@ expect = """\ <time>\\d+\.\d</time> </test> <test> - <file_name>test/no_result.py</file_name> - <command_line>%(python)s -tt test/no_result.py</command_line> + <file_name>%(test_no_result_py)s</file_name> + <command_line>%(pythonstring)s -tt %(test_no_result_py)s</command_line> <exit_status>2</exit_status> <stdout>NO RESULT TEST STDOUT </stdout> @@ -85,8 +77,8 @@ expect = """\ <time>\\d+\.\d</time> </test> <test> - <file_name>test/pass.py</file_name> - <command_line>%(python)s -tt test/pass.py</command_line> + <file_name>%(test_pass_py)s</file_name> + <command_line>%(pythonstring)s -tt %(test_pass_py)s</command_line> <exit_status>0</exit_status> <stdout>PASSING TEST STDOUT </stdout> |