2017-11-17 17:48:22 -08:00
|
|
|
# Copyright 2017 The Crashpad Authors. All rights reserved.
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
2017-12-19 15:31:04 -08:00
|
|
|
import("build/crashpad_buildconfig.gni")
|
|
|
|
import("build/test.gni")
|
2018-08-13 19:24:49 -04:00
|
|
|
import("util/net/tls.gni")
|
2017-11-17 17:48:22 -08:00
|
|
|
|
|
|
|
config("crashpad_config") {
|
2017-11-28 10:31:13 -08:00
|
|
|
include_dirs = [ "." ]
|
2017-11-17 17:48:22 -08:00
|
|
|
}
|
|
|
|
|
2018-01-12 17:21:48 -08:00
|
|
|
if (crashpad_is_in_chromium || crashpad_is_in_fuchsia) {
|
2017-11-29 11:04:47 -08:00
|
|
|
test("crashpad_tests") {
|
|
|
|
deps = [
|
2020-03-04 15:19:46 -05:00
|
|
|
"client:client_test",
|
2020-04-20 10:39:44 -04:00
|
|
|
"minidump:minidump_test",
|
2020-05-06 20:39:19 -04:00
|
|
|
"test:googlemock_main",
|
2017-11-29 11:04:47 -08:00
|
|
|
"test:test_test",
|
2020-07-07 21:53:21 -04:00
|
|
|
"util:util_test",
|
2017-11-29 11:04:47 -08:00
|
|
|
]
|
2019-11-04 21:19:33 -05:00
|
|
|
if (!crashpad_is_ios) {
|
2020-04-24 14:32:54 -07:00
|
|
|
deps += [ "snapshot:snapshot_test" ]
|
|
|
|
}
|
|
|
|
if (!crashpad_is_ios && !crashpad_is_fuchsia) {
|
|
|
|
deps += [ "handler:handler_test" ]
|
2019-11-04 21:19:33 -05:00
|
|
|
}
|
2020-02-20 15:47:04 -08:00
|
|
|
if (crashpad_is_in_fuchsia) {
|
|
|
|
# TODO(fuchsia:46559): Fix the leaks and remove this.
|
|
|
|
deps += [ "//build/config/sanitizers:suppress-lsan.DO-NOT-USE-THIS" ]
|
|
|
|
}
|
2020-03-23 13:26:03 -07:00
|
|
|
if (crashpad_is_android) {
|
|
|
|
use_raw_android_executable = true
|
|
|
|
|
|
|
|
copy("crashpad_test_data") {
|
|
|
|
testonly = true
|
|
|
|
sources = [
|
|
|
|
"test/test_paths_test_data_root.txt",
|
|
|
|
"util/net/testdata/ascii_http_body.txt",
|
|
|
|
"util/net/testdata/binary_http_body.dat",
|
|
|
|
]
|
|
|
|
|
2020-04-15 17:46:45 -04:00
|
|
|
outputs = [ "$root_out_dir/crashpad_test_data/{{source}}" ]
|
2020-03-23 13:26:03 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
deps += [ ":crashpad_test_data" ]
|
|
|
|
|
|
|
|
extra_dist_files = [
|
|
|
|
"$root_out_dir/crashpad_handler",
|
|
|
|
"$root_out_dir/crashpad_test_test_multiprocess_exec_test_child",
|
|
|
|
"$root_out_dir/crashpad_test_data",
|
|
|
|
]
|
|
|
|
}
|
2017-11-29 11:04:47 -08:00
|
|
|
}
|
2018-01-12 17:21:48 -08:00
|
|
|
|
|
|
|
if (crashpad_is_in_fuchsia) {
|
2021-03-12 17:24:53 -08:00
|
|
|
import("//src/sys/build/components.gni")
|
|
|
|
fuchsia_test_component("crashpad-test-component") {
|
|
|
|
manifest = "test/fuchsia_crashpad_tests.cmx"
|
2018-01-12 17:21:48 -08:00
|
|
|
deps = [
|
2021-03-12 17:24:53 -08:00
|
|
|
":crashpad-test-resources",
|
2018-01-12 17:21:48 -08:00
|
|
|
":crashpad_tests",
|
2018-05-23 17:14:05 -07:00
|
|
|
"snapshot:crashpad_snapshot_test_both_dt_hash_styles",
|
|
|
|
"snapshot:crashpad_snapshot_test_module",
|
|
|
|
"snapshot:crashpad_snapshot_test_module_large",
|
|
|
|
"snapshot:crashpad_snapshot_test_module_small",
|
fuchsia: Work around lack of packaging in Fuchsia tree build
Packaged test running seems to be a ways off, but with a bit of path
fiddling in test_paths.cc we can actually use the paths where the tests
are copied, so do that instead to get all the tests re-enabled. The
setup in BUILD.gn should be mostly-useful once packaging is working as
all helper/data files will need to specified there anyway.
Also, attempted fix to flaky behaviour in
ProcessReaderFuchsia.ChildThreads exposed because the tests are now
being run. zx_object_wait_many() waits on *any* of the objects, not
*all* of them. Derp!
And finally, for the same test, work around some unintuitive behaviour
in zx_task_suspend(), in particular that the thread will not be
suspended for the purpose of reading registers right away, but instead
only "sometime later", which appears in pratice to be after the next
context switch. Have ScopedTaskSuspend block for a while to try to
ensure the registers become readble, and if they don't, at least fail
noisily at that point.
Bug: crashpad:196
Change-Id: I01fb3590ede96301c941c2a88eba47fdbfe74ea7
Reviewed-on: https://chromium-review.googlesource.com/1053797
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
2018-05-10 10:27:58 -07:00
|
|
|
"test:crashpad_test_test_multiprocess_exec_test_child",
|
|
|
|
"util:http_transport_test_server",
|
2018-01-12 17:21:48 -08:00
|
|
|
]
|
2021-03-12 17:24:53 -08:00
|
|
|
}
|
2018-01-12 17:21:48 -08:00
|
|
|
|
2021-03-12 17:24:53 -08:00
|
|
|
fuchsia_test_package("crashpad-test") {
|
|
|
|
test_components = [ ":crashpad-test-component" ]
|
|
|
|
}
|
fuchsia: Work around lack of packaging in Fuchsia tree build
Packaged test running seems to be a ways off, but with a bit of path
fiddling in test_paths.cc we can actually use the paths where the tests
are copied, so do that instead to get all the tests re-enabled. The
setup in BUILD.gn should be mostly-useful once packaging is working as
all helper/data files will need to specified there anyway.
Also, attempted fix to flaky behaviour in
ProcessReaderFuchsia.ChildThreads exposed because the tests are now
being run. zx_object_wait_many() waits on *any* of the objects, not
*all* of them. Derp!
And finally, for the same test, work around some unintuitive behaviour
in zx_task_suspend(), in particular that the thread will not be
suspended for the purpose of reading registers right away, but instead
only "sometime later", which appears in pratice to be after the next
context switch. Have ScopedTaskSuspend block for a while to try to
ensure the registers become readble, and if they don't, at least fail
noisily at that point.
Bug: crashpad:196
Change-Id: I01fb3590ede96301c941c2a88eba47fdbfe74ea7
Reviewed-on: https://chromium-review.googlesource.com/1053797
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
2018-05-10 10:27:58 -07:00
|
|
|
|
2021-03-12 17:24:53 -08:00
|
|
|
_resource_files = [
|
|
|
|
"test/test_paths_test_data_root.txt",
|
|
|
|
"util/net/testdata/ascii_http_body.txt",
|
|
|
|
"util/net/testdata/binary_http_body.dat",
|
|
|
|
]
|
|
|
|
if (crashpad_use_boringssl_for_http_transport_socket) {
|
|
|
|
_resource_files += [
|
|
|
|
"util/net/testdata/crashpad_util_test_cert.pem",
|
|
|
|
"util/net/testdata/crashpad_util_test_key.pem",
|
2018-01-12 17:21:48 -08:00
|
|
|
]
|
2021-03-12 17:24:53 -08:00
|
|
|
}
|
2018-08-13 19:24:49 -04:00
|
|
|
|
2021-03-12 17:24:53 -08:00
|
|
|
_resources = []
|
|
|
|
foreach(resource_file, _resource_files) {
|
|
|
|
_resource_file_target = string_replace(resource_file, "/", "_")
|
|
|
|
resource("${_resource_file_target}") {
|
|
|
|
sources = [ "${resource_file}" ]
|
|
|
|
outputs = [ "data/${resource_file}" ]
|
2018-08-13 19:24:49 -04:00
|
|
|
}
|
2021-03-12 17:24:53 -08:00
|
|
|
_resources += [ ":${_resource_file_target}" ]
|
2018-01-12 17:21:48 -08:00
|
|
|
}
|
2018-04-24 13:02:29 -07:00
|
|
|
|
2021-03-12 17:24:53 -08:00
|
|
|
group("crashpad-test-resources") {
|
|
|
|
deps = _resources
|
|
|
|
}
|
2018-05-14 12:45:51 -07:00
|
|
|
|
2021-03-12 17:24:53 -08:00
|
|
|
fuchsia_shell_package("crashpad-database-util") {
|
|
|
|
package_name = "crashpad_database_util"
|
|
|
|
deps = [ "tools:crashpad_database_util" ]
|
2018-04-24 13:02:29 -07:00
|
|
|
}
|
2020-07-22 19:21:59 -04:00
|
|
|
|
|
|
|
group("tests") {
|
2020-07-22 20:58:26 -04:00
|
|
|
testonly = true
|
|
|
|
|
2020-07-22 19:23:24 -04:00
|
|
|
deps = [ ":crashpad-test" ]
|
2020-07-22 19:21:59 -04:00
|
|
|
}
|
2018-01-12 17:21:48 -08:00
|
|
|
}
|
2020-07-10 17:12:39 -04:00
|
|
|
} else if (crashpad_is_standalone || crashpad_is_external) {
|
2017-11-29 11:04:47 -08:00
|
|
|
test("crashpad_client_test") {
|
|
|
|
deps = [
|
|
|
|
"client:client_test",
|
2020-05-06 20:39:19 -04:00
|
|
|
"test:googlemock_main",
|
2017-11-29 11:04:47 -08:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
test("crashpad_handler_test") {
|
|
|
|
deps = [
|
|
|
|
"handler:handler_test",
|
2020-05-06 20:39:19 -04:00
|
|
|
"test:googletest_main",
|
2017-11-29 11:04:47 -08:00
|
|
|
]
|
2020-04-24 14:32:54 -07:00
|
|
|
if (crashpad_is_ios || crashpad_is_fuchsia) {
|
2019-11-04 21:19:33 -05:00
|
|
|
deps -= [ "handler:handler_test" ]
|
|
|
|
}
|
2017-11-29 11:04:47 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
test("crashpad_minidump_test") {
|
|
|
|
deps = [
|
|
|
|
"minidump:minidump_test",
|
2020-05-06 20:39:19 -04:00
|
|
|
"test:googletest_main",
|
2017-11-29 11:04:47 -08:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
test("crashpad_snapshot_test") {
|
|
|
|
deps = [
|
|
|
|
"snapshot:snapshot_test",
|
2020-05-06 20:39:19 -04:00
|
|
|
"test:googletest_main",
|
2017-11-29 11:04:47 -08:00
|
|
|
]
|
2019-11-04 21:19:33 -05:00
|
|
|
if (crashpad_is_ios) {
|
|
|
|
deps -= [ "snapshot:snapshot_test" ]
|
|
|
|
}
|
2017-11-29 11:04:47 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
test("crashpad_test_test") {
|
|
|
|
deps = [
|
2020-05-06 20:39:19 -04:00
|
|
|
"test:googlemock_main",
|
2017-11-29 11:04:47 -08:00
|
|
|
"test:test_test",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
test("crashpad_util_test") {
|
|
|
|
deps = [
|
2020-05-06 20:39:19 -04:00
|
|
|
"test:googlemock_main",
|
2017-11-29 11:04:47 -08:00
|
|
|
"util:util_test",
|
|
|
|
]
|
|
|
|
}
|
2017-11-17 17:48:22 -08:00
|
|
|
}
|
2020-01-30 22:11:26 -05:00
|
|
|
|
|
|
|
if (crashpad_is_ios) {
|
|
|
|
group("ios_xcuitests") {
|
|
|
|
testonly = true
|
2020-03-04 15:19:46 -05:00
|
|
|
deps = [ "test/ios:all_tests" ]
|
2020-01-30 22:11:26 -05:00
|
|
|
}
|
|
|
|
}
|