Skip to content

Commit d3e5af6

Browse files
drodriguezjrose-apple
authored andcommitted
[android] Push test binaries w/o modifying executable name. (swiftlang#19960)
At least test_rth.swift is checking the name of the executable during the test, so renaming every executable to __executable in Android will never work. Also, during the rth tool execution, all the results from before and after are pushed for every test. Since Android copies the passed files without relative paths, the library files will overwrite each other, making the test fail. Depends on swiftlang#19949 (more or less)
1 parent 4277292 commit d3e5af6

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

utils/android/adb/commands.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,12 @@ def execute_on_device(executable_path, executable_arguments):
9090
uuid_dir = '{}/{}'.format(DEVICE_TEMP_DIR, str(uuid.uuid4())[:10])
9191
shell(['mkdir', '-p', uuid_dir])
9292

93-
# `adb` can only handle commands under a certain length. No matter what the
94-
# original executable's name, on device we call it `__executable`.
95-
executable = '{}/__executable'.format(uuid_dir)
93+
# `adb` can only handle commands under a certain length. That's why we
94+
# hide the arguments and piping/status in executable files. However, at
95+
# least one resilience test relies on checking the executable name, so we
96+
# need to use the same name as the one provided.
97+
executable_name = os.path.basename(executable_path)
98+
executable = '{}/{}'.format(uuid_dir, executable_name)
9699
push(executable_path, executable)
97100

98101
child_environment = ['{}="{}"'.format(k.replace(ENV_PREFIX, '', 1), v)

utils/rth

+2-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ class ResilienceTest(object):
165165
config2_lower = config2.lower()
166166
output_obj = os.path.join(self.tmp_dir,
167167
config1_lower + '_' + config2_lower)
168-
tmp_dir_contents = glob.glob(os.path.join(self.tmp_dir, '*', '*'))
168+
tmp_dir_contents = glob.glob(
169+
os.path.join(self.tmp_dir, self.config_dir_map[config1], '*'))
169170
command = self.target_run + [output_obj] + tmp_dir_contents
170171
verbose_print_command(command)
171172
returncode = subprocess.call(command)

0 commit comments

Comments
 (0)