aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-02-05 09:14:43 -0800
committerDylan Baker <dylan@pnwbakers.com>2021-02-05 16:31:33 -0800
commitd7cbde41189cb92147365b6f3eb9e21ce8151176 (patch)
tree3059eb495912768d7847597dc53be3ce9bb4a247
parent456844a4f36270e37da4da8cd61c385d4bfc745f (diff)
downloadmeson-d7cbde41189cb92147365b6f3eb9e21ce8151176.zip
meson-d7cbde41189cb92147365b6f3eb9e21ce8151176.tar.gz
meson-d7cbde41189cb92147365b6f3eb9e21ce8151176.tar.bz2
unittests: fix error message string
-rwxr-xr-xrun_unittests.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/run_unittests.py b/run_unittests.py
index da13753..94843ad 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -7660,22 +7660,32 @@ class LinuxCrossMingwTests(BaseLinuxCrossTests):
self.meson_cross_file = os.path.join(testdir, 'broken-cross.txt')
# Force tracebacks so we can detect them properly
env = {'MESON_FORCE_BACKTRACE': '1'}
- with self.assertRaisesRegex(MesonException, 'exe_wrapper.*target.*use-exe-wrapper'):
+ error_message = "An exe_wrapper is needed but was not found. Please define one in cross file and check the command and/or add it to PATH."
+ error_message2 = "The exe_wrapper 'broken' defined in the cross file is needed by run target 'run-prog', but was not found. Please check the command and/or add it to PATH."
+
+ with self.assertRaises(MesonException) as cm:
# Must run in-process or we'll get a generic CalledProcessError
self.init(testdir, extra_args='-Drun-target=false',
inprocess=True,
override_envvars=env)
- with self.assertRaisesRegex(MesonException, 'exe_wrapper.*run target.*run-prog'):
+ self.assertEqual(str(cm.exception), error_message)
+
+ with self.assertRaises(MesonException) as cm:
# Must run in-process or we'll get a generic CalledProcessError
self.init(testdir, extra_args='-Dcustom-target=false',
inprocess=True,
override_envvars=env)
+ self.assertEqual(str(cm.exception), error_message2)
+
self.init(testdir, extra_args=['-Dcustom-target=false', '-Drun-target=false'],
override_envvars=env)
self.build()
- with self.assertRaisesRegex(MesonException, 'exe_wrapper.*PATH'):
+
+ with self.assertRaises(MesonException) as cm:
# Must run in-process or we'll get a generic CalledProcessError
self.run_tests(inprocess=True, override_envvars=env)
+ self.assertEqual(str(cm.exception),
+ "The exe_wrapper defined in the cross file 'broken' was not found. Please check the command and/or add it to PATH.")
@skipIfNoPkgconfig
def test_cross_pkg_config_option(self):