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
|
|
|
}
|
|
|
|
|
2020-02-21 11:33:02 -08:00
|
|
|
# TODO(fuchsia:46805): Remove this once instances of UB have been cleaned up.
|
|
|
|
config("disable_ubsan") {
|
|
|
|
if (crashpad_is_in_fuchsia) {
|
|
|
|
cflags = [ "-fno-sanitize=undefined" ]
|
|
|
|
}
|
|
|
|
visibility = [
|
|
|
|
"snapshot:snapshot",
|
|
|
|
"minidump:minidump_test",
|
2020-05-06 20:39:19 -04:00
|
|
|
"third_party/googletest:googletest",
|
2020-02-21 20:40:08 -08:00
|
|
|
"util:util",
|
2020-02-21 11:33:02 -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) {
|
|
|
|
import("//build/package.gni")
|
2020-07-22 19:23:24 -04:00
|
|
|
package("crashpad-test") {
|
2018-01-12 17:21:48 -08:00
|
|
|
testonly = true
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
":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
|
|
|
]
|
|
|
|
|
|
|
|
tests = [
|
|
|
|
{
|
|
|
|
name = "crashpad_tests"
|
|
|
|
},
|
2018-10-03 14:44:57 -07:00
|
|
|
]
|
|
|
|
|
2019-02-21 12:06:55 -08:00
|
|
|
meta = [
|
|
|
|
{
|
|
|
|
path = "test/fuchsia_crashpad_tests.cmx"
|
|
|
|
dest = "crashpad_tests.cmx"
|
2019-02-26 16:59:46 -05:00
|
|
|
},
|
2019-02-21 12:06:55 -08:00
|
|
|
]
|
|
|
|
|
2018-10-03 14:44:57 -07:00
|
|
|
binaries = [
|
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
|
|
|
{
|
|
|
|
name = "crashpad_test_test_multiprocess_exec_test_child"
|
2019-02-21 12:06:55 -08:00
|
|
|
dest = "crashpad_test_test_multiprocess_exec_test_child"
|
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
|
|
|
},
|
|
|
|
{
|
|
|
|
name = "http_transport_test_server"
|
2019-02-21 12:06:55 -08:00
|
|
|
dest = "http_transport_test_server"
|
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
|
|
|
},
|
|
|
|
]
|
|
|
|
|
2018-05-23 17:14:05 -07:00
|
|
|
loadable_modules = [
|
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
|
|
|
{
|
|
|
|
name = "crashpad_snapshot_test_both_dt_hash_styles.so"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name = "crashpad_snapshot_test_module.so"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name = "crashpad_snapshot_test_module_large.so"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name = "crashpad_snapshot_test_module_small.so"
|
|
|
|
},
|
|
|
|
]
|
|
|
|
|
|
|
|
resources = [
|
|
|
|
{
|
2018-05-23 17:14:05 -07:00
|
|
|
path = "util/net/testdata/ascii_http_body.txt"
|
2019-02-21 12:06:55 -08:00
|
|
|
dest = "util/net/testdata/ascii_http_body.txt"
|
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
|
|
|
},
|
|
|
|
{
|
2018-05-23 17:14:05 -07:00
|
|
|
path = "util/net/testdata/binary_http_body.dat"
|
2019-02-21 12:06:55 -08:00
|
|
|
dest = "util/net/testdata/binary_http_body.dat"
|
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
|
|
|
},
|
|
|
|
{
|
2018-05-23 17:14:05 -07:00
|
|
|
path = "test/test_paths_test_data_root.txt"
|
2019-02-21 12:06:55 -08:00
|
|
|
dest = "test/test_paths_test_data_root.txt"
|
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
|
|
|
},
|
2018-01-12 17:21:48 -08:00
|
|
|
]
|
2018-08-13 19:24:49 -04:00
|
|
|
|
|
|
|
if (crashpad_use_boringssl_for_http_transport_socket) {
|
2018-10-03 14:44:57 -07:00
|
|
|
resources += [
|
2018-08-13 19:24:49 -04:00
|
|
|
{
|
2019-10-30 15:27:03 -07:00
|
|
|
path = "util/net/testdata/crashpad_util_test_cert.pem"
|
|
|
|
dest = "util/net/testdata/crashpad_util_test_cert.pem"
|
2018-08-13 19:24:49 -04:00
|
|
|
},
|
|
|
|
{
|
2019-10-30 15:27:03 -07:00
|
|
|
path = "util/net/testdata/crashpad_util_test_key.pem"
|
|
|
|
dest = "util/net/testdata/crashpad_util_test_key.pem"
|
2018-08-13 19:24:49 -04:00
|
|
|
},
|
|
|
|
]
|
|
|
|
}
|
2018-01-12 17:21:48 -08:00
|
|
|
}
|
2018-04-24 13:02:29 -07:00
|
|
|
|
2020-07-22 19:23:24 -04:00
|
|
|
package("crashpad-database-util") {
|
2020-03-04 15:19:46 -05:00
|
|
|
deps = [ "tools:crashpad_database_util" ]
|
2018-05-14 12:45:51 -07:00
|
|
|
|
|
|
|
binaries = [
|
2018-05-08 12:20:43 -07:00
|
|
|
{
|
|
|
|
name = "crashpad_database_util"
|
2019-02-21 12:06:55 -08:00
|
|
|
shell = true
|
2018-05-08 12:20:43 -07:00
|
|
|
},
|
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
|
|
|
}
|
|
|
|
}
|