@@ -99,6 +99,22 @@ def execute_on_device(executable_path, executable_arguments):
99
99
for (k , v ) in os .environ .items ()
100
100
if k .startswith (ENV_PREFIX )]
101
101
102
+ # The executables are sometimes passed arguments, and sometimes those
103
+ # arguments are files that have to be pushed, but also the argument values
104
+ # have to be changed to the new path in the Android device.
105
+ translated_executable_arguments = []
106
+ for executable_argument in executable_arguments :
107
+ # Currently we only support arguments that are file paths themselves.
108
+ # Things like `--foo=/path/to/file` or directories are not supported.
109
+ # Relative paths from the executable to the arguments are not kept.
110
+ if os .path .isfile (executable_argument ):
111
+ final_path = '{}/{}' .format (uuid_dir ,
112
+ os .path .basename (executable_argument ))
113
+ push (executable_argument , final_path )
114
+ translated_executable_arguments .append (final_path )
115
+ else :
116
+ translated_executable_arguments .append (executable_argument )
117
+
102
118
# When running the executable on the device, we need to pass it the same
103
119
# arguments, as well as specify the correct LD_LIBRARY_PATH. Save these
104
120
# to a file we can easily call multiple times.
@@ -111,7 +127,7 @@ def execute_on_device(executable_path, executable_arguments):
111
127
tmp_dir = DEVICE_TEMP_DIR ,
112
128
child_environment = ' ' .join (child_environment ),
113
129
executable = executable ,
114
- executable_arguments = ' ' .join (executable_arguments )))
130
+ executable_arguments = ' ' .join (translated_executable_arguments )))
115
131
116
132
# Write the output from the test executable to a file named '__stdout', and
117
133
# if the test executable succeeds, write 'SUCCEEDED' to a file
0 commit comments