aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2020-11-30 15:32:47 -0800
committerDylan Baker <dylan@pnwbakers.com>2021-01-04 12:15:41 -0800
commit5db0d86b5c7c7f04589e67db859578793a967808 (patch)
tree4f3d461b8b72911791366127c8ced79ebc8b8f47
parent0574134bf884858632678b1d84db7e4ca483f603 (diff)
downloadmeson-5db0d86b5c7c7f04589e67db859578793a967808.zip
meson-5db0d86b5c7c7f04589e67db859578793a967808.tar.gz
meson-5db0d86b5c7c7f04589e67db859578793a967808.tar.bz2
run_unittests: make another test inprocess safe
-rwxr-xr-xrun_unittests.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/run_unittests.py b/run_unittests.py
index 2219ded..b340257 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -8455,9 +8455,13 @@ class NativeFileTests(BasePlatformTests):
testcase = os.path.join(self.common_test_dir, '224 persubproject options')
config = self.helper_create_native_file({'sub2:built-in options': {'default_library': 'shared'}})
- with self.assertRaises(subprocess.CalledProcessError) as cm:
+ with self.assertRaises((RuntimeError, subprocess.CalledProcessError)) as cm:
self.init(testcase, extra_args=['--native-file', config])
- self.assertIn(cm.exception.stdout, 'Parent should override default_library')
+ if isinstance(cm, RuntimeError):
+ check = str(cm.exception)
+ else:
+ check = cm.exception.stdout
+ self.assertIn(check, 'Parent should override default_library')
def test_builtin_options_subprojects_dont_inherits_parent_override(self):
# If the buildfile says subproject(... default_library: shared), ensure that's overwritten