Push tests to /data/nativetest in run_android_test.
This fixes them failing to link with the following error:
CANNOT LINK EXECUTABLE "/data/local/tmp/perfetto_integrationtests/perfetto_integrationtests": library "libdexfile_external.so" not found
This puts us into the correct linker namespace, as seen here:
https://android.git.corp.google.com/platform/system/core/+/master/rootdir/etc/ld.config.txt
Change-Id: I4b5450b2e326372ef28ca30e923ac28af3df4d2a
diff --git a/tools/run_android_test b/tools/run_android_test
index 83f029d..10a7bcc 100755
--- a/tools/run_android_test
+++ b/tools/run_android_test
@@ -131,7 +131,12 @@
target_dir = '/data/local/tmp/' + args.test_name
AdbCall('shell', 'rm -rf "%s"; mkdir -p "%s"' % (2 * (target_dir,)))
- AdbCall('push', test_bin, target_dir)
+ # This needs to go into /data/nativetest in order to have the system linker
+ # namespace applied, which we need in order to link libdexfile_external.so.
+ # This gets linked into our tests via libundwindstack.so.
+ #
+ # See https://android.git.corp.google.com/platform/system/core/+/master/rootdir/etc/ld.config.txt
+ AdbCall('push', test_bin, "/data/nativetest")
if not args.no_data_deps:
for dep in EnumerateDataDeps():
@@ -144,7 +149,7 @@
AdbCall('push', sanitizer_libs, target_dir)
env += 'LD_LIBRARY_PATH="%s/sanitizer_libs" ' % (target_dir)
cmd = 'cd %s;' % target_dir;
- binary = env + './%s' % args.test_name
+ binary = env + '/data/nativetest/%s' % args.test_name
cmd += binary
if args.cmd_args:
actual_args = [arg.replace(args.test_name, binary) for arg in args.cmd_args]