summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpkotwicz <pkotwicz@chromium.org>2015-11-02 10:20:38 -0800
committerCommit bot <commit-bot@chromium.org>2015-11-02 18:21:44 +0000
commita4d233b27373293933b7a8f191b134653b9b0b01 (patch)
tree9238d73e924cc0a7f17d7537ac6d35c09b51e9e9
parent475857eebdf7b3a58e8a179acbeebc502474ab8e (diff)
downloadchromium_src-a4d233b27373293933b7a8f191b134653b9b0b01.zip
chromium_src-a4d233b27373293933b7a8f191b134653b9b0b01.tar.gz
chromium_src-a4d233b27373293933b7a8f191b134653b9b0b01.tar.bz2
Fix breakpad_unittests on Android & GN
BUG=510485 Review URL: https://codereview.chromium.org/1404383004 Cr-Commit-Position: refs/heads/master@{#357387}
-rw-r--r--BUILD.gn10
-rw-r--r--breakpad/BUILD.gn80
-rw-r--r--build/gn_migration.gypi18
3 files changed, 74 insertions, 34 deletions
diff --git a/BUILD.gn b/BUILD.gn
index 36cd8ac..623f125 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -299,9 +299,11 @@ group("both_gn_and_gyp") {
}
}
- if (is_linux) { # TODO(GYP): || is_android || is_bsd?
+ if (is_linux || is_android) { # TODO(GYP): || is_bsd?
deps += [
+ "//breakpad:breakpad_unittests",
"//breakpad:core-2-minidump",
+ "//breakpad:generate_test_dump",
"//breakpad:minidump-2-core",
]
}
@@ -324,8 +326,6 @@ group("both_gn_and_gyp") {
if (is_linux) {
# The following are definitely linux-only.
deps += [
- "//breakpad:breakpad_unittests",
- "//breakpad:generate_test_dump",
"//dbus:dbus_test_server",
"//dbus:dbus_unittests",
"//net:disk_cache_memory_test",
@@ -705,8 +705,12 @@ if (!is_ios) {
# so we need to specify the dependencies here instead.
if (is_android) {
deps += [
+ "//breakpad:breakpad_unittests_deps",
"//breakpad:dump_syms($host_toolchain)",
+ "//breakpad:microdump_stackwalk($host_toolchain)",
+ "//breakpad:minidump_dump($host_toolchain)",
"//breakpad:minidump_stackwalk($host_toolchain)",
+ "//breakpad:symupload($host_toolchain)",
"//content/shell/android:content_shell_apk",
"//tools/imagediff($host_toolchain)",
]
diff --git a/breakpad/BUILD.gn b/breakpad/BUILD.gn
index a6d28aa..808f1e9 100644
--- a/breakpad/BUILD.gn
+++ b/breakpad/BUILD.gn
@@ -4,6 +4,10 @@
import("//testing/test.gni")
+if (is_android) {
+ import("//build/config/android/rules.gni")
+}
+
config("tools_config") {
include_dirs = [
"src",
@@ -180,6 +184,7 @@ if (!is_win && current_toolchain == host_toolchain) {
}
executable("minidump_dump") {
+ set_sources_assignment_filter([])
sources = [
"src/processor/basic_code_module.h",
"src/processor/basic_code_modules.cc",
@@ -382,31 +387,29 @@ if (is_mac) {
}
}
-if (is_linux) {
- executable("symupload") {
- sources = [
- "src/common/linux/http_upload.cc",
- "src/common/linux/http_upload.h",
- "src/tools/linux/symupload/sym_upload.cc",
- ]
+if (is_linux || is_android) {
+ if (current_toolchain == host_toolchain) {
+ executable("symupload") {
+ sources = [
+ "src/common/linux/http_upload.cc",
+ "src/common/linux/http_upload.h",
+ "src/tools/linux/symupload/sym_upload.cc",
+ ]
- include_dirs = [
- "src",
- "src/third_party",
- ]
+ include_dirs = [
+ "src",
+ "src/third_party",
+ ]
- configs += [ ":tools_config" ]
+ configs += [ ":tools_config" ]
- libs = [ "dl" ]
+ libs = [ "dl" ]
- deps = [
- "//build/config/sanitizers:deps",
- ]
- }
-}
+ deps = [
+ "//build/config/sanitizers:deps",
+ ]
+ }
-if (is_linux || is_android) {
- if (current_toolchain == host_toolchain) {
# dump_syms is a host tool, so only compile it for the host system.
executable("dump_syms") {
sources = [
@@ -555,6 +558,7 @@ if (is_linux || is_android) {
}
static_library("processor_support") {
+ set_sources_assignment_filter([])
sources = [
"src/common/scoped_ptr.h",
"src/processor/basic_code_modules.cc",
@@ -580,10 +584,12 @@ if (is_linux || is_android) {
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
}
-}
-if (is_linux) {
- test("breakpad_unittests") {
+ # "breakpad_unittests" cannot use the test() template because the test is run
+ # as an executable not as an APK on Android.
+ executable("breakpad_unittests") {
+ testonly = true
+ set_sources_assignment_filter([])
sources = [
"linux/breakpad_googletest_includes.h",
"src/client/linux/handler/exception_handler_unittest.cc",
@@ -616,6 +622,7 @@ if (is_linux) {
":client",
":processor_support",
":linux_dumper_unittest_helper",
+ "//build/config/sanitizers:deps",
"//testing/gtest",
"//testing/gtest:gtest_main",
"//testing/gmock",
@@ -640,11 +647,11 @@ if (is_linux) {
sources += [ "src/common/android/breakpad_getcontext_unittest.cc" ]
libs = [ "log" ]
include_dirs += [ "src/common/android/include" ]
- isolate_file = "breakpad_unittests.isolate"
}
}
executable("linux_dumper_unittest_helper") {
+ set_sources_assignment_filter([])
testonly = true
sources = [
"src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc",
@@ -662,6 +669,7 @@ if (is_linux) {
}
executable("generate_test_dump") {
+ set_sources_assignment_filter([])
testonly = true
sources = [
"linux/generate-test-dump.cc",
@@ -685,6 +693,7 @@ if (is_linux) {
}
executable("minidump-2-core") {
+ set_sources_assignment_filter([])
sources = [
"src/tools/linux/md2core/minidump-2-core.cc",
]
@@ -698,6 +707,7 @@ if (is_linux) {
}
executable("core-2-minidump") {
+ set_sources_assignment_filter([])
sources = [
"src/tools/linux/core2md/core2md.cc",
]
@@ -818,3 +828,25 @@ if (is_win) {
public_configs = [ ":sender_config" ]
}
}
+
+if (is_android) {
+ create_native_executable_dist("breakpad_unittests_deps") {
+ testonly = true
+ dist_dir = "$root_out_dir/breakpad_unittests_deps"
+ binary = "$root_out_dir/breakpad_unittests"
+ deps = [
+ ":breakpad_unittests",
+ ]
+
+ if (is_component_build) {
+ deps += [ "//build/android:cpplib_stripped" ]
+ }
+ }
+
+ test_runner_script("breakpad_unittests__test_runner_script") {
+ test_name = "breakpad_unittests"
+ test_type = "gtest"
+ test_suite = "breakpad_unittests"
+ isolate_file = "breakpad_unittests.isolate"
+ }
+}
diff --git a/build/gn_migration.gypi b/build/gn_migration.gypi
index 520188e..718c40e 100644
--- a/build/gn_migration.gypi
+++ b/build/gn_migration.gypi
@@ -178,8 +178,9 @@
'dependencies': [
'../base/base.gyp:base_unittests_apk',
'../base/base.gyp:chromium_android_linker',
- '../breakpad/breakpad.gyp:dump_syms#host',
+ '../breakpad/breakpad.gyp:breakpad_unittests_deps',
'../breakpad/breakpad.gyp:symupload#host',
+ '../breakpad/breakpad.gyp:microdump_stackwalk#host',
'../breakpad/breakpad.gyp:minidump_dump#host',
'../breakpad/breakpad.gyp:minidump_stackwalk#host',
'../build/android/rezip.gyp:rezip_apk_jar',
@@ -391,9 +392,17 @@
'../rlz/rlz.gyp:rlz_unittests',
],
}],
- ['OS=="linux" or os_bsd==1', {
+ ['OS=="linux" or OS=="android" or os_bsd==1', {
'dependencies': [
+ '../breakpad/breakpad.gyp:breakpad_unittests',
'../breakpad/breakpad.gyp:core-2-minidump',
+ '../breakpad/breakpad.gyp:dump_syms#host',
+ '../breakpad/breakpad.gyp:generate_test_dump',
+ '../breakpad/breakpad.gyp:minidump-2-core',
+ ],
+ }],
+ ['OS=="linux" or os_bsd==1', {
+ 'dependencies': [
'../breakpad/breakpad.gyp:microdump_stackwalk',
'../breakpad/breakpad.gyp:minidump_dump',
'../breakpad/breakpad.gyp:minidump_stackwalk',
@@ -403,10 +412,6 @@
}],
['OS=="linux"', {
'dependencies': [
- '../breakpad/breakpad.gyp:breakpad_unittests',
- '../breakpad/breakpad.gyp:dump_syms#host',
- '../breakpad/breakpad.gyp:generate_test_dump',
- '../breakpad/breakpad.gyp:minidump-2-core',
'../dbus/dbus.gyp:dbus_test_server',
'../dbus/dbus.gyp:dbus_unittests',
'../media/cast/cast.gyp:tap_proxy',
@@ -737,7 +742,6 @@
'dependencies': [
'../base/base.gyp:base_perftests_apk',
'../base/base.gyp:base_junit_tests',
- '../breakpad/breakpad.gyp:breakpad_unittests_deps',
'../cc/cc_tests.gyp:cc_perftests_apk',
'../components/components.gyp:cronet_sample_apk',
'../components/components.gyp:cronet_sample_test_apk',