[libc++] Consider everything inside %T to be a dependency of each test
Instead of passing file dependencies individually, assume that the
whole content of the unique test directory is a dependency. This
simplifies the test harness significantly, by making %T the directory
that contains everything required to run a test. This also removes the
need for the %{file_dependencies} substitution, which is removed by this
patch.
Furthermore, this patch also changes the harness to execute tests locally
inside %T, so as to avoid creating a separate directory for no purpose.
Cr-Mirrored-From: https://chromium.googlesource.com/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: 1fc5010d6b70bb5c2330595230ca5c5fe07bcad0
diff --git a/utils/run.py b/utils/run.py
index 0453e4a..e91836b 100644
--- a/utils/run.py
+++ b/utils/run.py
@@ -13,8 +13,6 @@
"""
import argparse
-import os
-import shutil
import subprocess
import sys
@@ -23,7 +21,6 @@
parser = argparse.ArgumentParser()
parser.add_argument('--execdir', type=str, required=True)
parser.add_argument('--codesign_identity', type=str, required=False, default=None)
- parser.add_argument('--dependencies', type=str, nargs='*', required=False, default=[])
parser.add_argument('--env', type=str, nargs='*', required=False, default=dict())
(args, remaining) = parser.parse_known_args(sys.argv[1:])
@@ -43,24 +40,8 @@
# Extract environment variables into a dictionary
env = {k : v for (k, v) in map(lambda s: s.split('=', 1), args.env)}
- # Create the execution directory, and make sure we remove it at the end.
- try:
- os.makedirs(args.execdir)
-
- # Ensure the file dependencies exist and copy them to the execution directory.
- for dep in args.dependencies:
- if not os.path.exists(dep):
- sys.stderr.write('Missing file or directory "{}" marked as a dependency of a test'.format(dep))
- exit(1)
- if os.path.isdir(dep):
- shutil.copytree(dep, os.path.join(args.execdir, os.path.basename(dep)), symlinks=True)
- else:
- shutil.copy2(dep, args.execdir)
-
- # Run the command line with the given environment in the execution directory.
- return subprocess.call(subprocess.list2cmdline(commandLine), cwd=args.execdir, env=env, shell=True)
- finally:
- shutil.rmtree(args.execdir)
+ # Run the command line with the given environment in the execution directory.
+ return subprocess.call(subprocess.list2cmdline(commandLine), cwd=args.execdir, env=env, shell=True)
if __name__ == '__main__':