diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-06-09 13:00:20 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-06-09 20:21:01 +0530 |
commit | 3a33a8ef49227c2fce1c0c7143e5529b4208d04e (patch) | |
tree | 6dfa901a39b608389214ba5a6a8765f9f428fbda /run_project_tests.py | |
parent | ed6a5abee853ed5e4d8c1826b17a0dc29843cd6a (diff) | |
download | meson-3a33a8ef49227c2fce1c0c7143e5529b4208d04e.zip meson-3a33a8ef49227c2fce1c0c7143e5529b4208d04e.tar.gz meson-3a33a8ef49227c2fce1c0c7143e5529b4208d04e.tar.bz2 |
unit tests: Add class to generate failing tests
It is not feasible to test all failure modes by creating projects in
`test cases/failing` that would be an explosion of files, and that
mechanism is too coarse anyway. We have no way to ensure that the
expected error is being raised.
See FailureTests.test_dependency for an example.
Diffstat (limited to 'run_project_tests.py')
-rwxr-xr-x | run_project_tests.py | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/run_project_tests.py b/run_project_tests.py index 822286b..5a88fa4 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -34,7 +34,7 @@ import time import multiprocessing import concurrent.futures as conc import re -from run_unittests import get_fake_options +from run_unittests import get_fake_options, run_configure_inprocess from run_tests import get_backend_commands, get_backend_args_for_dir, Backend from run_tests import ensure_backend_detects_changes @@ -249,18 +249,6 @@ def log_text_file(logfile, testdir, stdo, stde): executor.shutdown() raise StopException() -def run_configure_inprocess(commandlist): - old_stdout = sys.stdout - sys.stdout = mystdout = StringIO() - old_stderr = sys.stderr - sys.stderr = mystderr = StringIO() - try: - returncode = mesonmain.run(commandlist[0], commandlist[1:]) - finally: - sys.stdout = old_stdout - sys.stderr = old_stderr - return returncode, mystdout.getvalue(), mystderr.getvalue() - def run_test_inprocess(testdir): old_stdout = sys.stdout sys.stdout = mystdout = StringIO() |