aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2017-06-02 10:34:19 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2017-06-02 10:41:13 +0530
commit4b428053f496720ec437eb5d455c86ada2de7977 (patch)
treec57654bda832071f60bd23dcb92f652d813af069 /run_unittests.py
parentae9b23832e3ef4064e5735265ce7008794ab0491 (diff)
downloadmeson-4b428053f496720ec437eb5d455c86ada2de7977.zip
meson-4b428053f496720ec437eb5d455c86ada2de7977.tar.gz
meson-4b428053f496720ec437eb5d455c86ada2de7977.tar.bz2
ninja: Use shlex.quote for quoting on non-Windows
This is more reliable, and more accurate. For instance, this means arguments in commands aren't surrounded by `'` on Linux unless that is actually needed by that specific argument. There is no equivalent helper for Windows, so we keep the old behaviour for that.
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/run_unittests.py b/run_unittests.py
index 71448f9..a610e6b 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -1266,15 +1266,15 @@ class LinuxlikeTests(BasePlatformTests):
self.assertIsNotNone(vala_command)
self.assertIsNotNone(c_command)
# -w suppresses all warnings, should be there in Vala but not in C
- self.assertIn("'-w'", vala_command)
- self.assertNotIn("'-w'", c_command)
+ self.assertIn(" -w ", vala_command)
+ self.assertNotIn(" -w ", c_command)
# -Wall enables all warnings, should be there in C but not in Vala
- self.assertNotIn("'-Wall'", vala_command)
- self.assertIn("'-Wall'", c_command)
+ self.assertNotIn(" -Wall ", vala_command)
+ self.assertIn(" -Wall ", c_command)
# -Werror converts warnings to errors, should always be there since it's
# injected by an unrelated piece of code and the project has werror=true
- self.assertIn("'-Werror'", vala_command)
- self.assertIn("'-Werror'", c_command)
+ self.assertIn(" -Werror ", vala_command)
+ self.assertIn(" -Werror ", c_command)
def test_qt5dependency_pkgconfig_detection(self):
'''
@@ -1405,7 +1405,7 @@ class LinuxlikeTests(BasePlatformTests):
self.init(testdir, ['-D' + std_opt])
cmd = self.get_compdb()[0]['command']
if v != 'none':
- cmd_std = "'-std={}'".format(v)
+ cmd_std = " -std={} ".format(v)
self.assertIn(cmd_std, cmd)
try:
self.build()
@@ -1420,7 +1420,7 @@ class LinuxlikeTests(BasePlatformTests):
os.environ[env_flags] = cmd_std
self.init(testdir)
cmd = self.get_compdb()[0]['command']
- qcmd_std = "'{}'".format(cmd_std)
+ qcmd_std = " {} ".format(cmd_std)
self.assertIn(qcmd_std, cmd)
with self.assertRaises(subprocess.CalledProcessError,
msg='{} should have failed'.format(qcmd_std)):