|
15 | 15 | import stat
|
16 | 16 | import sys
|
17 | 17 | import subprocess
|
18 |
| -import pipes |
19 | 18 | import shlex
|
20 | 19 | import tempfile
|
21 | 20 | import shutil
|
@@ -61,7 +60,7 @@ def check_cmd(cmd_name, cmd_dir, cmd_path=None):
|
61 | 60 |
|
62 | 61 |
|
63 | 62 | def quote_cmd(cmd):
|
64 |
| - return " ".join(pipes.quote(arg) for arg in cmd) |
| 63 | + return " ".join(shlex.quote(arg) for arg in cmd) |
65 | 64 |
|
66 | 65 |
|
67 | 66 | def write_to_script(text, filename):
|
@@ -220,7 +219,7 @@ def write_interestingness_test(self):
|
220 | 219 | )
|
221 | 220 |
|
222 | 221 | for msg in self.expected_output:
|
223 |
| - output += "grep -F %s t.log || exit 1\n" % pipes.quote(msg) |
| 222 | + output += "grep -F %s t.log || exit 1\n" % shlex.quote(msg) |
224 | 223 |
|
225 | 224 | write_to_script(output, self.testfile)
|
226 | 225 | self.check_interestingness()
|
@@ -318,9 +317,17 @@ def simplify_clang_args(self):
|
318 | 317 | interestingness test takes to run.
|
319 | 318 | """
|
320 | 319 | print("\nSimplifying the clang command...")
|
| 320 | + new_args = self.clang_args |
| 321 | + |
| 322 | + # Remove the color diagnostics flag to make it easier to match error |
| 323 | + # text. |
| 324 | + new_args = self.try_remove_args( |
| 325 | + new_args, |
| 326 | + msg="Removed -fcolor-diagnostics", |
| 327 | + opts_equal=["-fcolor-diagnostics"], |
| 328 | + ) |
321 | 329 |
|
322 | 330 | # Remove some clang arguments to speed up the interestingness test
|
323 |
| - new_args = self.clang_args |
324 | 331 | new_args = self.try_remove_args(
|
325 | 332 | new_args,
|
326 | 333 | msg="Removed debug info options",
|
|
0 commit comments