Make most of the tests pass on Android.

- Link with -static-libstdc++ to avoid a runtime dependency on the NDK libc++.
- Relax the regular expression matching the path to ar. If the path is
  sufficiently long then gyp will wrap the line, causing the match to fail.
- The crashpad_handler binary needs to be pushed to the device,
  otherwise a number of tests fail or hang.

Now the only tests that fail on my device are:

[  FAILED  ] DebugRendezvous.Self
[  FAILED  ] DebugRendezvous.Child
[  FAILED  ] ProcessReaderLinux.SelfModules
[  FAILED  ] ProcessReaderLinux.ChildModules

Change-Id: I951a22cea5bce453d858da49a49b6a8defc1461c
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1536652
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Peter Collingbourne <pcc@chromium.org>
This commit is contained in:
Peter Collingbourne 2019-03-26 11:36:34 -07:00 committed by Commit Bot
parent 3cc7ceaac5
commit 75efc19dd0
2 changed files with 7 additions and 2 deletions

View File

@ -35,6 +35,11 @@
}], }],
], ],
}], }],
['OS=="android"', {
'ldflags': [
'-static-libstdc++',
],
}],
], ],
}, },
} }

View File

@ -87,7 +87,7 @@ def _BinaryDirTargetOS(binary_dir):
if os.path.exists(build_ninja_path): if os.path.exists(build_ninja_path):
with open(build_ninja_path) as build_ninja_file: with open(build_ninja_path) as build_ninja_file:
build_ninja_content = build_ninja_file.read() build_ninja_content = build_ninja_file.read()
match = re.search('^ar = .+-linux-android(eabi)?-ar$', match = re.search('-linux-android(eabi)?-ar$',
build_ninja_content, build_ninja_content,
re.MULTILINE) re.MULTILINE)
if match: if match:
@ -237,7 +237,7 @@ def _RunOnAndroidTarget(binary_dir, test, android_device, extra_command_line):
# determined automatically in a GN build, following the example used for # determined automatically in a GN build, following the example used for
# Fuchsia. Since nothing like that exists for GYP, hard-code it for # Fuchsia. Since nothing like that exists for GYP, hard-code it for
# supported tests. # supported tests.
test_build_artifacts = [test] test_build_artifacts = [test, 'crashpad_handler']
test_data = ['test/test_paths_test_data_root.txt'] test_data = ['test/test_paths_test_data_root.txt']
if test == 'crashpad_test_test': if test == 'crashpad_test_test':