mirror of
https://github.com/chromium/crashpad.git
synced 2025-03-17 08:33:54 +00:00
Starts compiling the crashpad_test_test target on iOS.
Brings up the subset of tests that pass on iOS without any modifications. Additional tests will be added later as they are updated to pass on iOS. Excludes non-compiling targets from the iOS build so that the default target compiles cleanly. Rolls mini_chromium to cdab1e6263ec7f3f61763efc1dac863f8dc07c80. 2019-11-01 rohitrao Adds GN support for XCTest on iOS. 2019-10-29 rohitrao Fixes for iOS compilation and running on iOS devices. BUG=crashpad:31 Change-Id: I918f10fc941b37fa89b08ce87828dd4299437096 Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1895905 Reviewed-by: Mark Mentovai <mark@chromium.org> Commit-Queue: Rohit Rao <rohitrao@chromium.org>
This commit is contained in:
parent
6dadd492b8
commit
bd1aa246ca
29
BUILD.gn
29
BUILD.gn
@ -23,14 +23,18 @@ config("crashpad_config") {
|
|||||||
if (crashpad_is_in_chromium || crashpad_is_in_fuchsia) {
|
if (crashpad_is_in_chromium || crashpad_is_in_fuchsia) {
|
||||||
test("crashpad_tests") {
|
test("crashpad_tests") {
|
||||||
deps = [
|
deps = [
|
||||||
"client:client_test",
|
|
||||||
"handler:handler_test",
|
|
||||||
"minidump:minidump_test",
|
|
||||||
"snapshot:snapshot_test",
|
|
||||||
"test:gmock_main",
|
"test:gmock_main",
|
||||||
"test:test_test",
|
"test:test_test",
|
||||||
"util:util_test",
|
|
||||||
]
|
]
|
||||||
|
if (!crashpad_is_ios) {
|
||||||
|
deps += [
|
||||||
|
"client:client_test",
|
||||||
|
"handler:handler_test",
|
||||||
|
"minidump:minidump_test",
|
||||||
|
"snapshot:snapshot_test",
|
||||||
|
"util:util_test",
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (crashpad_is_in_fuchsia) {
|
if (crashpad_is_in_fuchsia) {
|
||||||
@ -135,6 +139,9 @@ if (crashpad_is_in_chromium || crashpad_is_in_fuchsia) {
|
|||||||
"client:client_test",
|
"client:client_test",
|
||||||
"test:gmock_main",
|
"test:gmock_main",
|
||||||
]
|
]
|
||||||
|
if (crashpad_is_ios) {
|
||||||
|
deps -= [ "client:client_test" ]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
test("crashpad_handler_test") {
|
test("crashpad_handler_test") {
|
||||||
@ -142,6 +149,9 @@ if (crashpad_is_in_chromium || crashpad_is_in_fuchsia) {
|
|||||||
"handler:handler_test",
|
"handler:handler_test",
|
||||||
"test:gtest_main",
|
"test:gtest_main",
|
||||||
]
|
]
|
||||||
|
if (crashpad_is_ios) {
|
||||||
|
deps -= [ "handler:handler_test" ]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
test("crashpad_minidump_test") {
|
test("crashpad_minidump_test") {
|
||||||
@ -149,6 +159,9 @@ if (crashpad_is_in_chromium || crashpad_is_in_fuchsia) {
|
|||||||
"minidump:minidump_test",
|
"minidump:minidump_test",
|
||||||
"test:gtest_main",
|
"test:gtest_main",
|
||||||
]
|
]
|
||||||
|
if (crashpad_is_ios) {
|
||||||
|
deps -= [ "minidump:minidump_test" ]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
test("crashpad_snapshot_test") {
|
test("crashpad_snapshot_test") {
|
||||||
@ -156,6 +169,9 @@ if (crashpad_is_in_chromium || crashpad_is_in_fuchsia) {
|
|||||||
"snapshot:snapshot_test",
|
"snapshot:snapshot_test",
|
||||||
"test:gtest_main",
|
"test:gtest_main",
|
||||||
]
|
]
|
||||||
|
if (crashpad_is_ios) {
|
||||||
|
deps -= [ "snapshot:snapshot_test" ]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
test("crashpad_test_test") {
|
test("crashpad_test_test") {
|
||||||
@ -170,5 +186,8 @@ if (crashpad_is_in_chromium || crashpad_is_in_fuchsia) {
|
|||||||
"test:gmock_main",
|
"test:gmock_main",
|
||||||
"util:util_test",
|
"util:util_test",
|
||||||
]
|
]
|
||||||
|
if (crashpad_is_ios) {
|
||||||
|
deps -= [ "util:util_test" ]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
2
DEPS
2
DEPS
@ -33,7 +33,7 @@ deps = {
|
|||||||
'8048ece6c16c91acfe0d36d1d3cc0890ab6e945c',
|
'8048ece6c16c91acfe0d36d1d3cc0890ab6e945c',
|
||||||
'crashpad/third_party/mini_chromium/mini_chromium':
|
'crashpad/third_party/mini_chromium/mini_chromium':
|
||||||
Var('chromium_git') + '/chromium/mini_chromium@' +
|
Var('chromium_git') + '/chromium/mini_chromium@' +
|
||||||
'2298dbe9d0b3213720ac0e5418ad0013a19aeb5d',
|
'cdab1e6263ec7f3f61763efc1dac863f8dc07c80',
|
||||||
'crashpad/third_party/libfuzzer/src':
|
'crashpad/third_party/libfuzzer/src':
|
||||||
Var('chromium_git') + '/chromium/llvm-project/compiler-rt/lib/fuzzer.git@' +
|
Var('chromium_git') + '/chromium/llvm-project/compiler-rt/lib/fuzzer.git@' +
|
||||||
'fda403cf93ecb8792cb1d061564d89a6553ca020',
|
'fda403cf93ecb8792cb1d061564d89a6553ca020',
|
||||||
|
@ -45,7 +45,26 @@ config("crashpad_fuzzer_flags") {
|
|||||||
"-fsanitize=fuzzer",
|
"-fsanitize=fuzzer",
|
||||||
]
|
]
|
||||||
|
|
||||||
ldflags = [
|
ldflags = [ "-fsanitize=address" ]
|
||||||
"-fsanitize=address",
|
}
|
||||||
]
|
|
||||||
|
if (crashpad_is_ios) {
|
||||||
|
group("ios_enable_arc") {
|
||||||
|
if (crashpad_is_in_chromium) {
|
||||||
|
public_configs = [ "//build/config/compiler:enable_arc" ]
|
||||||
|
} else if (crashpad_is_standalone) {
|
||||||
|
public_configs =
|
||||||
|
[ "//third_party/mini_chromium/mini_chromium/build:ios_enable_arc" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
group("ios_xctest") {
|
||||||
|
if (crashpad_is_in_chromium) {
|
||||||
|
public_configs = [ "//build/config/ios:xctest_config" ]
|
||||||
|
} else if (crashpad_is_standalone) {
|
||||||
|
public_configs = [
|
||||||
|
"//third_party/mini_chromium/mini_chromium/build/ios:xctest_config",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,11 +23,10 @@ declare_args() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(crashpad_dependencies == "chromium" ||
|
assert(
|
||||||
crashpad_dependencies == "fuchsia" ||
|
crashpad_dependencies == "chromium" || crashpad_dependencies == "fuchsia" ||
|
||||||
crashpad_dependencies == "standalone" ||
|
crashpad_dependencies == "standalone" ||
|
||||||
crashpad_dependencies == "external" ||
|
crashpad_dependencies == "external" || crashpad_dependencies == "dart")
|
||||||
crashpad_dependencies == "dart")
|
|
||||||
|
|
||||||
crashpad_is_in_chromium = crashpad_dependencies == "chromium"
|
crashpad_is_in_chromium = crashpad_dependencies == "chromium"
|
||||||
crashpad_is_in_fuchsia = crashpad_dependencies == "fuchsia"
|
crashpad_is_in_fuchsia = crashpad_dependencies == "fuchsia"
|
||||||
@ -37,6 +36,7 @@ crashpad_is_standalone = crashpad_dependencies == "standalone"
|
|||||||
|
|
||||||
if (crashpad_is_in_chromium) {
|
if (crashpad_is_in_chromium) {
|
||||||
crashpad_is_mac = is_mac
|
crashpad_is_mac = is_mac
|
||||||
|
crashpad_is_ios = is_ios
|
||||||
crashpad_is_win = is_win
|
crashpad_is_win = is_win
|
||||||
crashpad_is_linux = is_linux
|
crashpad_is_linux = is_linux
|
||||||
crashpad_is_android = is_android
|
crashpad_is_android = is_android
|
||||||
@ -57,6 +57,7 @@ if (crashpad_is_in_chromium) {
|
|||||||
import("../third_party/mini_chromium/mini_chromium/build/platform.gni")
|
import("../third_party/mini_chromium/mini_chromium/build/platform.gni")
|
||||||
}
|
}
|
||||||
crashpad_is_mac = mini_chromium_is_mac
|
crashpad_is_mac = mini_chromium_is_mac
|
||||||
|
crashpad_is_ios = mini_chromium_is_ios
|
||||||
crashpad_is_win = mini_chromium_is_win
|
crashpad_is_win = mini_chromium_is_win
|
||||||
crashpad_is_linux = mini_chromium_is_linux
|
crashpad_is_linux = mini_chromium_is_linux
|
||||||
crashpad_is_android = mini_chromium_is_android
|
crashpad_is_android = mini_chromium_is_android
|
||||||
|
@ -43,13 +43,36 @@ static_library("test") {
|
|||||||
"test_paths.h",
|
"test_paths.h",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if (crashpad_is_ios) {
|
||||||
|
sources -= [
|
||||||
|
"errors.cc",
|
||||||
|
"errors.h",
|
||||||
|
"file.cc",
|
||||||
|
"file.h",
|
||||||
|
"filesystem.cc",
|
||||||
|
"filesystem.h",
|
||||||
|
"multiprocess.h",
|
||||||
|
"multiprocess_exec.cc",
|
||||||
|
"multiprocess_exec.h",
|
||||||
|
"process_type.cc",
|
||||||
|
"process_type.h",
|
||||||
|
"scoped_guarded_page.h",
|
||||||
|
"scoped_module_handle.cc",
|
||||||
|
"scoped_module_handle.h",
|
||||||
|
"scoped_temp_dir.cc",
|
||||||
|
"scoped_temp_dir.h",
|
||||||
|
"test_paths.cc",
|
||||||
|
"test_paths.h",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
if (crashpad_is_posix || crashpad_is_fuchsia) {
|
if (crashpad_is_posix || crashpad_is_fuchsia) {
|
||||||
sources += [
|
sources += [
|
||||||
"scoped_guarded_page_posix.cc",
|
"scoped_guarded_page_posix.cc",
|
||||||
"scoped_temp_dir_posix.cc",
|
"scoped_temp_dir_posix.cc",
|
||||||
]
|
]
|
||||||
|
|
||||||
if (!crashpad_is_fuchsia) {
|
if (!crashpad_is_fuchsia && !crashpad_is_ios) {
|
||||||
sources += [
|
sources += [
|
||||||
"multiprocess_exec_posix.cc",
|
"multiprocess_exec_posix.cc",
|
||||||
"multiprocess_posix.cc",
|
"multiprocess_posix.cc",
|
||||||
@ -118,6 +141,13 @@ static_library("test") {
|
|||||||
"../util",
|
"../util",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if (crashpad_is_ios) {
|
||||||
|
deps -= [
|
||||||
|
"../compat",
|
||||||
|
"../util",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
if (crashpad_is_mac) {
|
if (crashpad_is_mac) {
|
||||||
libs = [ "bsm" ]
|
libs = [ "bsm" ]
|
||||||
deps += [
|
deps += [
|
||||||
@ -152,9 +182,18 @@ source_set("test_test") {
|
|||||||
"test_paths_test.cc",
|
"test_paths_test.cc",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if (crashpad_is_ios) {
|
||||||
|
sources -= [
|
||||||
|
"multiprocess_exec_test.cc",
|
||||||
|
"scoped_guarded_page_test.cc",
|
||||||
|
"scoped_temp_dir_test.cc",
|
||||||
|
"test_paths_test.cc",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
# TODO(crbug.com/812974): Remove !crashpad_is_fuchsia when Fuchsia is no
|
# TODO(crbug.com/812974): Remove !crashpad_is_fuchsia when Fuchsia is no
|
||||||
# longer treated as a posix platform.
|
# longer treated as a posix platform.
|
||||||
if (crashpad_is_posix && !crashpad_is_fuchsia) {
|
if (crashpad_is_posix && !crashpad_is_fuchsia && !crashpad_is_ios) {
|
||||||
sources += [ "multiprocess_posix_test.cc" ]
|
sources += [ "multiprocess_posix_test.cc" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -181,16 +220,27 @@ source_set("test_test") {
|
|||||||
data_deps = [
|
data_deps = [
|
||||||
":crashpad_test_test_multiprocess_exec_test_child",
|
":crashpad_test_test_multiprocess_exec_test_child",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if (crashpad_is_ios) {
|
||||||
|
deps -= [
|
||||||
|
"../compat",
|
||||||
|
"../util",
|
||||||
|
]
|
||||||
|
|
||||||
|
data_deps -= [ ":crashpad_test_test_multiprocess_exec_test_child" ]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
crashpad_executable("crashpad_test_test_multiprocess_exec_test_child") {
|
if (!crashpad_is_ios) {
|
||||||
sources = [
|
crashpad_executable("crashpad_test_test_multiprocess_exec_test_child") {
|
||||||
"multiprocess_exec_test_child.cc",
|
sources = [
|
||||||
]
|
"multiprocess_exec_test_child.cc",
|
||||||
|
]
|
||||||
|
|
||||||
deps = [
|
deps = [
|
||||||
"../third_party/mini_chromium:base",
|
"../third_party/mini_chromium:base",
|
||||||
]
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static_library("gmock_main") {
|
static_library("gmock_main") {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
//! \file
|
//! \file
|
||||||
|
|
||||||
#if defined(OS_MACOSX) || DOXYGEN
|
#if (defined(OS_MACOSX) && !defined(OS_IOS)) || DOXYGEN
|
||||||
|
|
||||||
//! \brief Wraps the gtest `ASSERT_DEATH_IF_SUPPORTED()` macro to make
|
//! \brief Wraps the gtest `ASSERT_DEATH_IF_SUPPORTED()` macro to make
|
||||||
//! assertions about death caused by crashes.
|
//! assertions about death caused by crashes.
|
||||||
@ -73,14 +73,14 @@
|
|||||||
regex); \
|
regex); \
|
||||||
} while (false)
|
} while (false)
|
||||||
|
|
||||||
#else // OS_MACOSX
|
#else // OS_MACOSX && !OS_IOS
|
||||||
|
|
||||||
#define ASSERT_DEATH_CRASH(statement, regex) \
|
#define ASSERT_DEATH_CRASH(statement, regex) \
|
||||||
ASSERT_DEATH_IF_SUPPORTED(statement, regex)
|
ASSERT_DEATH_IF_SUPPORTED(statement, regex)
|
||||||
#define EXPECT_DEATH_CRASH(statement, regex) \
|
#define EXPECT_DEATH_CRASH(statement, regex) \
|
||||||
EXPECT_DEATH_IF_SUPPORTED(statement, regex)
|
EXPECT_DEATH_IF_SUPPORTED(statement, regex)
|
||||||
|
|
||||||
#endif // OS_MACOSX
|
#endif // OS_MACOSX && !OS_IOS
|
||||||
|
|
||||||
#if !(!defined(MINI_CHROMIUM_BASE_LOGGING_H_) && \
|
#if !(!defined(MINI_CHROMIUM_BASE_LOGGING_H_) && \
|
||||||
defined(OFFICIAL_BUILD) && \
|
defined(OFFICIAL_BUILD) && \
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
#if !defined(OS_IOS)
|
||||||
bool GetChildTestFunctionName(std::string* child_func_name) {
|
bool GetChildTestFunctionName(std::string* child_func_name) {
|
||||||
constexpr size_t arg_length =
|
constexpr size_t arg_length =
|
||||||
sizeof(crashpad::test::internal::kChildTestFunction) - 1;
|
sizeof(crashpad::test::internal::kChildTestFunction) - 1;
|
||||||
@ -45,17 +46,20 @@ bool GetChildTestFunctionName(std::string* child_func_name) {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#endif // !OS_IOS
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
int main(int argc, char* argv[]) {
|
int main(int argc, char* argv[]) {
|
||||||
crashpad::test::InitializeMainArguments(argc, argv);
|
crashpad::test::InitializeMainArguments(argc, argv);
|
||||||
|
|
||||||
|
#if !defined(OS_IOS)
|
||||||
std::string child_func_name;
|
std::string child_func_name;
|
||||||
if (GetChildTestFunctionName(&child_func_name)) {
|
if (GetChildTestFunctionName(&child_func_name)) {
|
||||||
return crashpad::test::internal::CheckedInvokeMultiprocessChild(
|
return crashpad::test::internal::CheckedInvokeMultiprocessChild(
|
||||||
child_func_name);
|
child_func_name);
|
||||||
}
|
}
|
||||||
|
#endif // !OS_IOS
|
||||||
|
|
||||||
#if defined(CRASHPAD_IS_IN_CHROMIUM)
|
#if defined(CRASHPAD_IS_IN_CHROMIUM)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user