[PATCH] Copy data files to the remote runner.

Dan Albert danalbert at google.com
Fri Mar 6 11:37:43 PST 2015


Hi jroelofs, EricWF,

The data files for any given test will be in the same directory as the
source with a file name that matches *.dat. To make these available to
tests running remotely (such as over adb or ssh), copy them into the
test's remote working directory.

Note that we will perform more copies than we actually need. The data
files in the directory may only be used by one of the tests, but will
be copied for all tests in the same directory.

This patch also moves the remote test binary into the working
directory (previously it was only invoked from the working directory
rather than existing in it).

REPOSITORY
  rL LLVM

http://reviews.llvm.org/D8118

Files:
  test/libcxx/test/executor.py

Index: test/libcxx/test/executor.py
===================================================================
--- test/libcxx/test/executor.py
+++ test/libcxx/test/executor.py
@@ -110,21 +110,23 @@
     def run(self, exe_path, cmd=None, work_dir='.', env=None):
         target_exe_path = None
         target_cwd = None
+        data_files = [f for f in os.listdir(work_dir) if f.endswith('.dat')]
         try:
-            target_exe_path = self.remote_temp_file()
             target_cwd = self.remote_temp_dir()
+            target_exe_path = os.path.join(target_cwd, 'libcxx_test')
             if cmd:
                 # Replace exe_path with target_exe_path.
                 cmd = [c if c != exe_path else target_exe_path for c in cmd]
             else:
                 cmd = [target_exe_path]
+
             self.copy_in([exe_path], [target_exe_path])
+            for data_file in data_files:
+                df_path = os.path.join(work_dir, data_file)
+                df_dev_path = os.path.join(target_cwd, data_file)
+                self._copy_in_file(df_path, df_dev_path)
             return self._execute_command_remote(cmd, target_cwd, env)
-        except:
-            raise
         finally:
-            if target_exe_path:
-                self.delete_remote(target_exe_path)
             if target_cwd:
                 self.delete_remote(target_cwd)

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8118.21381.patch
Type: text/x-patch
Size: 1375 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150306/babf1164/attachment.bin>


More information about the cfe-commits mailing list