diff options
Diffstat (limited to 'test/runtest')
-rw-r--r-- | test/runtest/fallback.py | 14 | ||||
-rw-r--r-- | test/runtest/noqmtest.py | 14 | ||||
-rw-r--r-- | test/runtest/python.py | 10 |
3 files changed, 24 insertions, 14 deletions
diff --git a/test/runtest/fallback.py b/test/runtest/fallback.py index 90cd4f2..8b6ae42 100644 --- a/test/runtest/fallback.py +++ b/test/runtest/fallback.py @@ -68,12 +68,20 @@ if re.search('\s', python): else: expect_python = python +def escape(s): + return string.replace(s, '\\', '\\\\') + +expect_python = escape(expect_python) +expect_workpath_pass_py = escape(workpath_pass_py) +expect_workpath_fail_py = escape(workpath_fail_py) +expect_workpath_no_result_py = escape(workpath_no_result_py) + expect_stdout = """\ -%(expect_python)s -tt %(workpath_fail_py)s +%(expect_python)s -tt %(expect_workpath_fail_py)s FAILING TEST STDOUT -%(expect_python)s -tt %(workpath_no_result_py)s +%(expect_python)s -tt %(expect_workpath_no_result_py)s NO RESULT TEST STDOUT -%(expect_python)s -tt %(workpath_pass_py)s +%(expect_python)s -tt %(expect_workpath_pass_py)s PASSING TEST STDOUT Failed the following test: diff --git a/test/runtest/noqmtest.py b/test/runtest/noqmtest.py index c442125..f2bf6eb 100644 --- a/test/runtest/noqmtest.py +++ b/test/runtest/noqmtest.py @@ -59,12 +59,20 @@ if re.search('\s', python): else: expect_python = python +def escape(s): + return string.replace(s, '\\', '\\\\') + +expect_python = escape(expect_python) +expect_workpath_pass_py = escape(workpath_pass_py) +expect_workpath_fail_py = escape(workpath_fail_py) +expect_workpath_no_result_py = escape(workpath_no_result_py) + expect_stdout = """\ -%(expect_python)s -tt %(workpath_fail_py)s +%(expect_python)s -tt %(expect_workpath_fail_py)s FAILING TEST STDOUT -%(expect_python)s -tt %(workpath_no_result_py)s +%(expect_python)s -tt %(expect_workpath_no_result_py)s NO RESULT TEST STDOUT -%(expect_python)s -tt %(workpath_pass_py)s +%(expect_python)s -tt %(expect_workpath_pass_py)s PASSING TEST STDOUT Failed the following test: diff --git a/test/runtest/python.py b/test/runtest/python.py index 1af32dd..95b5f0f 100644 --- a/test/runtest/python.py +++ b/test/runtest/python.py @@ -46,17 +46,11 @@ head, dir = os.path.split(head) mypython = os.path.join(head, dir, os.path.pardir, dir, python) -if re.search('\s', mypython): - _mypython_ = '"' + mypython + '"' -else: - _mypython_ = mypython - test.subdir('test') test.write_passing_test(['test', 'pass.py']) -# NOTE: The "test/fail.py : FAIL" and "test/pass.py : PASS" lines both -# have spaces at the end. +# NOTE: The "test/pass.py : PASS" line has spaces at the end. expect = r"""qmtest.py run --output results.qmr --format none --result-stream="scons_tdb.AegisChangeStream" --context python="%(mypython)s" test --- TEST RESULTS ------------------------------------------------------------- @@ -75,6 +69,6 @@ expect = r"""qmtest.py run --output results.qmr --format none --result-stream="s 1 (100%%) tests PASS """ % locals() -test.run(arguments = '-P %s test' % _mypython_, stdout = expect) +test.run(arguments = ['-P', mypython, 'test'], stdout = expect) test.pass_test() |