Index: test/sanitizer_common/ios_commands/iossim_run.py =================================================================== --- test/sanitizer_common/ios_commands/iossim_run.py +++ test/sanitizer_common/ios_commands/iossim_run.py @@ -1,6 +1,6 @@ #!/usr/bin/python -import os, sys, subprocess +import glob, os, pipes, sys, subprocess if not "SANITIZER_IOSSIM_TEST_DEVICE_IDENTIFIER" in os.environ: @@ -12,7 +12,25 @@ if e in os.environ: os.environ["SIMCTL_CHILD_" + e] = os.environ[e] -exitcode = subprocess.call(["xcrun", "simctl", "spawn", device_id] + sys.argv[1:]) +prog = sys.argv[1] +exit_code = None +if prog == 'rm': + # The simulator and host actually share the same file system so we can just + # execute directly on the host. + rm_args = [] + for arg in sys.argv[2:]: + if '*' in arg or '?' in arg: + # Don't quote glob pattern + rm_args.append(arg) + else: + # FIXME(dliew): pipes.quote() is deprecated + rm_args.append(pipes.quote(arg)) + rm_cmd_line = ["/bin/rm"] + rm_args + rm_cmd_line_str = ' '.join(rm_cmd_line) + # We use `shell=True` so that any wildcard globs get expanded by the shell. + exitcode = subprocess.call(rm_cmd_line_str, shell=True) +else: + exitcode = subprocess.call(["xcrun", "simctl", "spawn", device_id] + sys.argv[1:]) if exitcode > 125: exitcode = 126 sys.exit(exitcode) Index: test/ubsan/TestCases/Misc/log-path_test.cc =================================================================== --- test/ubsan/TestCases/Misc/log-path_test.cc +++ test/ubsan/TestCases/Misc/log-path_test.cc @@ -12,11 +12,13 @@ // Good log_path. // RUN: rm -f %t.log.* +// RUN: %run rm -f '%t.log.*' // RUN: %env_ubsan_opts=log_path='"%t.log"' %run %t -4 2> %t.out // RUN: FileCheck %s --check-prefix=CHECK-ERROR < %t.log.* // Run w/o errors should not produce any log. // RUN: rm -f %t.log.* +// RUN: %run rm -f '%t.log.*' // RUN: %env_ubsan_opts=log_path='"%t.log"' %run %t 4 // RUN: not cat %t.log.*