2022-09-06 19:14:07 -04:00
|
|
|
|
// Copyright 2017 The Crashpad Authors
|
2017-03-18 00:18:20 -04:00
|
|
|
|
//
|
|
|
|
|
// 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.
|
|
|
|
|
|
2020-10-21 11:10:25 -07:00
|
|
|
|
#include "base/logging.h"
|
Un-disable WinMultiprocess-based tests in Chromium
As of
https://chromium.googlesource.com/chromium/src/+/00a0654929787f70b0cd81f30aa14e81c5e11b2f,
crashpad_util_test is able to run in Chromium. It uses Chromium’s own
base::TestLauncher rather than gtest’s RUN_ALL_TESTS() for proper
integration with Swarming.
Launching WinMultiprocess test children out of the same test executable
via WinChildProcess is not compatible with Chromium’s parallel, shardy,
Swarmy test launcher. When running these children, the standard gtest
RUN_ALL_TESTS() launcher will now be used, even in Chromium.
Two tests disabled in Chromium are now enabled:
ExceptionHandlerServerTest.MultipleConnections and
ScopedProcessSuspend.ScopedProcessSuspend.
As part of this work, I discovered that disabled tests chosen to run via
--gtest_also_run_disabled_tests did not actually work for
WinMultiprocess-based tests, because gtest’s test launcher would refuse
to run the child side of the test, believing it was disabled. This is
fixed by always supplying --gtest_also_run_disabled_tests to
WinChildProcess children, on the basis that if the parent is managing to
run and it’s disabled, disabled tests must actually be enabled.
Bug: crashpad:205
Change-Id: Ied22f16b9329ee13b6b07fd29de704f6fe2a058e
Reviewed-on: https://chromium-review.googlesource.com/742462
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-10-27 17:41:32 -04:00
|
|
|
|
#include "build/build_config.h"
|
2017-03-18 00:18:20 -04:00
|
|
|
|
#include "gtest/gtest.h"
|
|
|
|
|
#include "test/main_arguments.h"
|
2018-01-25 14:47:28 -08:00
|
|
|
|
#include "test/multiprocess_exec.h"
|
2017-03-18 00:18:20 -04:00
|
|
|
|
|
2020-05-06 20:39:19 -04:00
|
|
|
|
#if defined(CRASHPAD_TEST_LAUNCHER_GOOGLEMOCK)
|
Un-disable WinMultiprocess-based tests in Chromium
As of
https://chromium.googlesource.com/chromium/src/+/00a0654929787f70b0cd81f30aa14e81c5e11b2f,
crashpad_util_test is able to run in Chromium. It uses Chromium’s own
base::TestLauncher rather than gtest’s RUN_ALL_TESTS() for proper
integration with Swarming.
Launching WinMultiprocess test children out of the same test executable
via WinChildProcess is not compatible with Chromium’s parallel, shardy,
Swarmy test launcher. When running these children, the standard gtest
RUN_ALL_TESTS() launcher will now be used, even in Chromium.
Two tests disabled in Chromium are now enabled:
ExceptionHandlerServerTest.MultipleConnections and
ScopedProcessSuspend.ScopedProcessSuspend.
As part of this work, I discovered that disabled tests chosen to run via
--gtest_also_run_disabled_tests did not actually work for
WinMultiprocess-based tests, because gtest’s test launcher would refuse
to run the child side of the test, believing it was disabled. This is
fixed by always supplying --gtest_also_run_disabled_tests to
WinChildProcess children, on the basis that if the parent is managing to
run and it’s disabled, disabled tests must actually be enabled.
Bug: crashpad:205
Change-Id: Ied22f16b9329ee13b6b07fd29de704f6fe2a058e
Reviewed-on: https://chromium-review.googlesource.com/742462
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-10-27 17:41:32 -04:00
|
|
|
|
#include "gmock/gmock.h"
|
2020-05-06 20:39:19 -04:00
|
|
|
|
#endif // CRASHPAD_TEST_LAUNCHER_GOOGLEMOCK
|
Un-disable WinMultiprocess-based tests in Chromium
As of
https://chromium.googlesource.com/chromium/src/+/00a0654929787f70b0cd81f30aa14e81c5e11b2f,
crashpad_util_test is able to run in Chromium. It uses Chromium’s own
base::TestLauncher rather than gtest’s RUN_ALL_TESTS() for proper
integration with Swarming.
Launching WinMultiprocess test children out of the same test executable
via WinChildProcess is not compatible with Chromium’s parallel, shardy,
Swarmy test launcher. When running these children, the standard gtest
RUN_ALL_TESTS() launcher will now be used, even in Chromium.
Two tests disabled in Chromium are now enabled:
ExceptionHandlerServerTest.MultipleConnections and
ScopedProcessSuspend.ScopedProcessSuspend.
As part of this work, I discovered that disabled tests chosen to run via
--gtest_also_run_disabled_tests did not actually work for
WinMultiprocess-based tests, because gtest’s test launcher would refuse
to run the child side of the test, believing it was disabled. This is
fixed by always supplying --gtest_also_run_disabled_tests to
WinChildProcess children, on the basis that if the parent is managing to
run and it’s disabled, disabled tests must actually be enabled.
Bug: crashpad:205
Change-Id: Ied22f16b9329ee13b6b07fd29de704f6fe2a058e
Reviewed-on: https://chromium-review.googlesource.com/742462
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-10-27 17:41:32 -04:00
|
|
|
|
|
2022-01-19 15:00:24 -05:00
|
|
|
|
#if BUILDFLAG(IS_ANDROID)
|
2020-04-08 09:56:20 -07:00
|
|
|
|
#include "util/linux/initial_signal_dispositions.h"
|
2022-01-19 15:00:24 -05:00
|
|
|
|
#endif // BUILDFLAG(IS_ANDROID)
|
2020-04-08 09:56:20 -07:00
|
|
|
|
|
2022-01-19 15:00:24 -05:00
|
|
|
|
#if BUILDFLAG(IS_IOS)
|
2020-01-31 14:51:39 -05:00
|
|
|
|
#include "test/ios/google_test_setup.h"
|
2020-01-07 11:14:27 -05:00
|
|
|
|
#endif
|
|
|
|
|
|
2022-01-19 15:00:24 -05:00
|
|
|
|
#if BUILDFLAG(IS_WIN)
|
Un-disable WinMultiprocess-based tests in Chromium
As of
https://chromium.googlesource.com/chromium/src/+/00a0654929787f70b0cd81f30aa14e81c5e11b2f,
crashpad_util_test is able to run in Chromium. It uses Chromium’s own
base::TestLauncher rather than gtest’s RUN_ALL_TESTS() for proper
integration with Swarming.
Launching WinMultiprocess test children out of the same test executable
via WinChildProcess is not compatible with Chromium’s parallel, shardy,
Swarmy test launcher. When running these children, the standard gtest
RUN_ALL_TESTS() launcher will now be used, even in Chromium.
Two tests disabled in Chromium are now enabled:
ExceptionHandlerServerTest.MultipleConnections and
ScopedProcessSuspend.ScopedProcessSuspend.
As part of this work, I discovered that disabled tests chosen to run via
--gtest_also_run_disabled_tests did not actually work for
WinMultiprocess-based tests, because gtest’s test launcher would refuse
to run the child side of the test, believing it was disabled. This is
fixed by always supplying --gtest_also_run_disabled_tests to
WinChildProcess children, on the basis that if the parent is managing to
run and it’s disabled, disabled tests must actually be enabled.
Bug: crashpad:205
Change-Id: Ied22f16b9329ee13b6b07fd29de704f6fe2a058e
Reviewed-on: https://chromium-review.googlesource.com/742462
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-10-27 17:41:32 -04:00
|
|
|
|
#include "test/win/win_child_process.h"
|
2022-01-19 15:00:24 -05:00
|
|
|
|
#endif // BUILDFLAG(IS_WIN)
|
Un-disable WinMultiprocess-based tests in Chromium
As of
https://chromium.googlesource.com/chromium/src/+/00a0654929787f70b0cd81f30aa14e81c5e11b2f,
crashpad_util_test is able to run in Chromium. It uses Chromium’s own
base::TestLauncher rather than gtest’s RUN_ALL_TESTS() for proper
integration with Swarming.
Launching WinMultiprocess test children out of the same test executable
via WinChildProcess is not compatible with Chromium’s parallel, shardy,
Swarmy test launcher. When running these children, the standard gtest
RUN_ALL_TESTS() launcher will now be used, even in Chromium.
Two tests disabled in Chromium are now enabled:
ExceptionHandlerServerTest.MultipleConnections and
ScopedProcessSuspend.ScopedProcessSuspend.
As part of this work, I discovered that disabled tests chosen to run via
--gtest_also_run_disabled_tests did not actually work for
WinMultiprocess-based tests, because gtest’s test launcher would refuse
to run the child side of the test, believing it was disabled. This is
fixed by always supplying --gtest_also_run_disabled_tests to
WinChildProcess children, on the basis that if the parent is managing to
run and it’s disabled, disabled tests must actually be enabled.
Bug: crashpad:205
Change-Id: Ied22f16b9329ee13b6b07fd29de704f6fe2a058e
Reviewed-on: https://chromium-review.googlesource.com/742462
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-10-27 17:41:32 -04:00
|
|
|
|
|
2017-12-18 14:35:55 -08:00
|
|
|
|
#if defined(CRASHPAD_IS_IN_CHROMIUM)
|
2023-01-12 17:02:04 -05:00
|
|
|
|
#include "base/functional/bind.h"
|
2017-10-27 16:06:32 -04:00
|
|
|
|
#include "base/test/launcher/unit_test_launcher.h"
|
|
|
|
|
#include "base/test/test_suite.h"
|
2017-12-18 14:35:55 -08:00
|
|
|
|
#endif // CRASHPAD_IS_IN_CHROMIUM
|
2017-10-27 16:06:32 -04:00
|
|
|
|
|
2018-01-25 14:47:28 -08:00
|
|
|
|
namespace {
|
|
|
|
|
|
2022-01-19 15:00:24 -05:00
|
|
|
|
#if !BUILDFLAG(IS_IOS)
|
2018-01-25 14:47:28 -08:00
|
|
|
|
bool GetChildTestFunctionName(std::string* child_func_name) {
|
|
|
|
|
constexpr size_t arg_length =
|
|
|
|
|
sizeof(crashpad::test::internal::kChildTestFunction) - 1;
|
|
|
|
|
for (const auto& it : crashpad::test::GetMainArguments()) {
|
|
|
|
|
if (it.compare(
|
|
|
|
|
0, arg_length, crashpad::test::internal::kChildTestFunction) == 0) {
|
|
|
|
|
*child_func_name = it.substr(arg_length);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2022-01-19 15:00:24 -05:00
|
|
|
|
#endif // !BUILDFLAG(IS_IOS)
|
2018-01-25 14:47:28 -08:00
|
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
2017-03-18 00:18:20 -04:00
|
|
|
|
int main(int argc, char* argv[]) {
|
2022-01-19 15:00:24 -05:00
|
|
|
|
#if BUILDFLAG(IS_ANDROID)
|
2020-04-08 09:56:20 -07:00
|
|
|
|
crashpad::InitializeSignalDispositions();
|
2022-01-19 15:00:24 -05:00
|
|
|
|
#endif // BUILDFLAG(IS_ANDROID)
|
2020-04-08 09:56:20 -07:00
|
|
|
|
|
2017-03-18 00:18:20 -04:00
|
|
|
|
crashpad::test::InitializeMainArguments(argc, argv);
|
2017-10-27 16:06:32 -04:00
|
|
|
|
|
2022-01-19 15:00:24 -05:00
|
|
|
|
#if !BUILDFLAG(IS_IOS)
|
2018-01-25 14:47:28 -08:00
|
|
|
|
std::string child_func_name;
|
|
|
|
|
if (GetChildTestFunctionName(&child_func_name)) {
|
|
|
|
|
return crashpad::test::internal::CheckedInvokeMultiprocessChild(
|
|
|
|
|
child_func_name);
|
|
|
|
|
}
|
2022-01-19 15:00:24 -05:00
|
|
|
|
#endif // !BUILDFLAG(IS_IOS)
|
2018-01-25 14:47:28 -08:00
|
|
|
|
|
2017-12-18 14:35:55 -08:00
|
|
|
|
#if defined(CRASHPAD_IS_IN_CHROMIUM)
|
2017-10-27 16:06:32 -04:00
|
|
|
|
|
2022-01-19 15:00:24 -05:00
|
|
|
|
#if BUILDFLAG(IS_WIN)
|
Un-disable WinMultiprocess-based tests in Chromium
As of
https://chromium.googlesource.com/chromium/src/+/00a0654929787f70b0cd81f30aa14e81c5e11b2f,
crashpad_util_test is able to run in Chromium. It uses Chromium’s own
base::TestLauncher rather than gtest’s RUN_ALL_TESTS() for proper
integration with Swarming.
Launching WinMultiprocess test children out of the same test executable
via WinChildProcess is not compatible with Chromium’s parallel, shardy,
Swarmy test launcher. When running these children, the standard gtest
RUN_ALL_TESTS() launcher will now be used, even in Chromium.
Two tests disabled in Chromium are now enabled:
ExceptionHandlerServerTest.MultipleConnections and
ScopedProcessSuspend.ScopedProcessSuspend.
As part of this work, I discovered that disabled tests chosen to run via
--gtest_also_run_disabled_tests did not actually work for
WinMultiprocess-based tests, because gtest’s test launcher would refuse
to run the child side of the test, believing it was disabled. This is
fixed by always supplying --gtest_also_run_disabled_tests to
WinChildProcess children, on the basis that if the parent is managing to
run and it’s disabled, disabled tests must actually be enabled.
Bug: crashpad:205
Change-Id: Ied22f16b9329ee13b6b07fd29de704f6fe2a058e
Reviewed-on: https://chromium-review.googlesource.com/742462
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-10-27 17:41:32 -04:00
|
|
|
|
// Chromium’s test launcher interferes with WinMultiprocess-based tests. Allow
|
2020-05-06 20:39:19 -04:00
|
|
|
|
// their child processes to be launched by the standard Google Test-based test
|
Un-disable WinMultiprocess-based tests in Chromium
As of
https://chromium.googlesource.com/chromium/src/+/00a0654929787f70b0cd81f30aa14e81c5e11b2f,
crashpad_util_test is able to run in Chromium. It uses Chromium’s own
base::TestLauncher rather than gtest’s RUN_ALL_TESTS() for proper
integration with Swarming.
Launching WinMultiprocess test children out of the same test executable
via WinChildProcess is not compatible with Chromium’s parallel, shardy,
Swarmy test launcher. When running these children, the standard gtest
RUN_ALL_TESTS() launcher will now be used, even in Chromium.
Two tests disabled in Chromium are now enabled:
ExceptionHandlerServerTest.MultipleConnections and
ScopedProcessSuspend.ScopedProcessSuspend.
As part of this work, I discovered that disabled tests chosen to run via
--gtest_also_run_disabled_tests did not actually work for
WinMultiprocess-based tests, because gtest’s test launcher would refuse
to run the child side of the test, believing it was disabled. This is
fixed by always supplying --gtest_also_run_disabled_tests to
WinChildProcess children, on the basis that if the parent is managing to
run and it’s disabled, disabled tests must actually be enabled.
Bug: crashpad:205
Change-Id: Ied22f16b9329ee13b6b07fd29de704f6fe2a058e
Reviewed-on: https://chromium-review.googlesource.com/742462
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-10-27 17:41:32 -04:00
|
|
|
|
// runner.
|
|
|
|
|
const bool use_chromium_test_launcher =
|
|
|
|
|
!crashpad::test::WinChildProcess::IsChildProcess();
|
2022-01-19 15:00:24 -05:00
|
|
|
|
#elif BUILDFLAG(IS_ANDROID)
|
2020-03-23 13:26:03 -07:00
|
|
|
|
constexpr bool use_chromium_test_launcher = false;
|
2022-01-19 15:00:24 -05:00
|
|
|
|
#else // BUILDFLAG(IS_WIN)
|
Un-disable WinMultiprocess-based tests in Chromium
As of
https://chromium.googlesource.com/chromium/src/+/00a0654929787f70b0cd81f30aa14e81c5e11b2f,
crashpad_util_test is able to run in Chromium. It uses Chromium’s own
base::TestLauncher rather than gtest’s RUN_ALL_TESTS() for proper
integration with Swarming.
Launching WinMultiprocess test children out of the same test executable
via WinChildProcess is not compatible with Chromium’s parallel, shardy,
Swarmy test launcher. When running these children, the standard gtest
RUN_ALL_TESTS() launcher will now be used, even in Chromium.
Two tests disabled in Chromium are now enabled:
ExceptionHandlerServerTest.MultipleConnections and
ScopedProcessSuspend.ScopedProcessSuspend.
As part of this work, I discovered that disabled tests chosen to run via
--gtest_also_run_disabled_tests did not actually work for
WinMultiprocess-based tests, because gtest’s test launcher would refuse
to run the child side of the test, believing it was disabled. This is
fixed by always supplying --gtest_also_run_disabled_tests to
WinChildProcess children, on the basis that if the parent is managing to
run and it’s disabled, disabled tests must actually be enabled.
Bug: crashpad:205
Change-Id: Ied22f16b9329ee13b6b07fd29de704f6fe2a058e
Reviewed-on: https://chromium-review.googlesource.com/742462
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-10-27 17:41:32 -04:00
|
|
|
|
constexpr bool use_chromium_test_launcher = true;
|
2022-01-19 15:00:24 -05:00
|
|
|
|
#endif // BUILDFLAG(IS_WIN)
|
2017-10-27 16:06:32 -04:00
|
|
|
|
|
Un-disable WinMultiprocess-based tests in Chromium
As of
https://chromium.googlesource.com/chromium/src/+/00a0654929787f70b0cd81f30aa14e81c5e11b2f,
crashpad_util_test is able to run in Chromium. It uses Chromium’s own
base::TestLauncher rather than gtest’s RUN_ALL_TESTS() for proper
integration with Swarming.
Launching WinMultiprocess test children out of the same test executable
via WinChildProcess is not compatible with Chromium’s parallel, shardy,
Swarmy test launcher. When running these children, the standard gtest
RUN_ALL_TESTS() launcher will now be used, even in Chromium.
Two tests disabled in Chromium are now enabled:
ExceptionHandlerServerTest.MultipleConnections and
ScopedProcessSuspend.ScopedProcessSuspend.
As part of this work, I discovered that disabled tests chosen to run via
--gtest_also_run_disabled_tests did not actually work for
WinMultiprocess-based tests, because gtest’s test launcher would refuse
to run the child side of the test, believing it was disabled. This is
fixed by always supplying --gtest_also_run_disabled_tests to
WinChildProcess children, on the basis that if the parent is managing to
run and it’s disabled, disabled tests must actually be enabled.
Bug: crashpad:205
Change-Id: Ied22f16b9329ee13b6b07fd29de704f6fe2a058e
Reviewed-on: https://chromium-review.googlesource.com/742462
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-10-27 17:41:32 -04:00
|
|
|
|
if (use_chromium_test_launcher) {
|
|
|
|
|
// This supports --test-launcher-summary-output, which writes a JSON file
|
|
|
|
|
// containing test details needed by Swarming.
|
|
|
|
|
base::TestSuite test_suite(argc, argv);
|
|
|
|
|
return base::LaunchUnitTests(
|
|
|
|
|
argc,
|
|
|
|
|
argv,
|
2019-12-13 12:38:15 -05:00
|
|
|
|
base::BindOnce(&base::TestSuite::Run, base::Unretained(&test_suite)));
|
Un-disable WinMultiprocess-based tests in Chromium
As of
https://chromium.googlesource.com/chromium/src/+/00a0654929787f70b0cd81f30aa14e81c5e11b2f,
crashpad_util_test is able to run in Chromium. It uses Chromium’s own
base::TestLauncher rather than gtest’s RUN_ALL_TESTS() for proper
integration with Swarming.
Launching WinMultiprocess test children out of the same test executable
via WinChildProcess is not compatible with Chromium’s parallel, shardy,
Swarmy test launcher. When running these children, the standard gtest
RUN_ALL_TESTS() launcher will now be used, even in Chromium.
Two tests disabled in Chromium are now enabled:
ExceptionHandlerServerTest.MultipleConnections and
ScopedProcessSuspend.ScopedProcessSuspend.
As part of this work, I discovered that disabled tests chosen to run via
--gtest_also_run_disabled_tests did not actually work for
WinMultiprocess-based tests, because gtest’s test launcher would refuse
to run the child side of the test, believing it was disabled. This is
fixed by always supplying --gtest_also_run_disabled_tests to
WinChildProcess children, on the basis that if the parent is managing to
run and it’s disabled, disabled tests must actually be enabled.
Bug: crashpad:205
Change-Id: Ied22f16b9329ee13b6b07fd29de704f6fe2a058e
Reviewed-on: https://chromium-review.googlesource.com/742462
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-10-27 17:41:32 -04:00
|
|
|
|
}
|
2017-10-27 16:06:32 -04:00
|
|
|
|
|
2017-12-18 14:35:55 -08:00
|
|
|
|
#endif // CRASHPAD_IS_IN_CHROMIUM
|
Un-disable WinMultiprocess-based tests in Chromium
As of
https://chromium.googlesource.com/chromium/src/+/00a0654929787f70b0cd81f30aa14e81c5e11b2f,
crashpad_util_test is able to run in Chromium. It uses Chromium’s own
base::TestLauncher rather than gtest’s RUN_ALL_TESTS() for proper
integration with Swarming.
Launching WinMultiprocess test children out of the same test executable
via WinChildProcess is not compatible with Chromium’s parallel, shardy,
Swarmy test launcher. When running these children, the standard gtest
RUN_ALL_TESTS() launcher will now be used, even in Chromium.
Two tests disabled in Chromium are now enabled:
ExceptionHandlerServerTest.MultipleConnections and
ScopedProcessSuspend.ScopedProcessSuspend.
As part of this work, I discovered that disabled tests chosen to run via
--gtest_also_run_disabled_tests did not actually work for
WinMultiprocess-based tests, because gtest’s test launcher would refuse
to run the child side of the test, believing it was disabled. This is
fixed by always supplying --gtest_also_run_disabled_tests to
WinChildProcess children, on the basis that if the parent is managing to
run and it’s disabled, disabled tests must actually be enabled.
Bug: crashpad:205
Change-Id: Ied22f16b9329ee13b6b07fd29de704f6fe2a058e
Reviewed-on: https://chromium-review.googlesource.com/742462
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-10-27 17:41:32 -04:00
|
|
|
|
|
2020-10-21 11:10:25 -07:00
|
|
|
|
// base::TestSuite initializes logging when using Chromium's test launcher.
|
|
|
|
|
logging::LoggingSettings settings;
|
|
|
|
|
settings.logging_dest =
|
|
|
|
|
logging::LOG_TO_STDERR | logging::LOG_TO_SYSTEM_DEBUG_LOG;
|
|
|
|
|
logging::InitLogging(settings);
|
|
|
|
|
|
2020-05-06 20:39:19 -04:00
|
|
|
|
#if defined(CRASHPAD_TEST_LAUNCHER_GOOGLEMOCK)
|
2017-10-30 23:55:51 -04:00
|
|
|
|
testing::InitGoogleMock(&argc, argv);
|
2020-05-06 20:39:19 -04:00
|
|
|
|
#elif defined(CRASHPAD_TEST_LAUNCHER_GOOGLETEST)
|
2017-10-30 23:55:51 -04:00
|
|
|
|
testing::InitGoogleTest(&argc, argv);
|
2020-05-06 20:39:19 -04:00
|
|
|
|
#else // CRASHPAD_TEST_LAUNCHER_GOOGLEMOCK
|
|
|
|
|
#error #define CRASHPAD_TEST_LAUNCHER_GOOGLETEST or \
|
|
|
|
|
CRASHPAD_TEST_LAUNCHER_GOOGLEMOCK
|
|
|
|
|
#endif // CRASHPAD_TEST_LAUNCHER_GOOGLEMOCK
|
2017-10-30 23:55:51 -04:00
|
|
|
|
|
2022-01-19 15:00:24 -05:00
|
|
|
|
#if BUILDFLAG(IS_IOS)
|
2020-01-07 11:14:27 -05:00
|
|
|
|
// iOS needs to run tests within the context of an app, so call a helper that
|
|
|
|
|
// invokes UIApplicationMain(). The application delegate will call
|
|
|
|
|
// RUN_ALL_TESTS() and exit before returning control to this function.
|
|
|
|
|
crashpad::test::IOSLaunchApplicationAndRunTests(argc, argv);
|
|
|
|
|
#else
|
Un-disable WinMultiprocess-based tests in Chromium
As of
https://chromium.googlesource.com/chromium/src/+/00a0654929787f70b0cd81f30aa14e81c5e11b2f,
crashpad_util_test is able to run in Chromium. It uses Chromium’s own
base::TestLauncher rather than gtest’s RUN_ALL_TESTS() for proper
integration with Swarming.
Launching WinMultiprocess test children out of the same test executable
via WinChildProcess is not compatible with Chromium’s parallel, shardy,
Swarmy test launcher. When running these children, the standard gtest
RUN_ALL_TESTS() launcher will now be used, even in Chromium.
Two tests disabled in Chromium are now enabled:
ExceptionHandlerServerTest.MultipleConnections and
ScopedProcessSuspend.ScopedProcessSuspend.
As part of this work, I discovered that disabled tests chosen to run via
--gtest_also_run_disabled_tests did not actually work for
WinMultiprocess-based tests, because gtest’s test launcher would refuse
to run the child side of the test, believing it was disabled. This is
fixed by always supplying --gtest_also_run_disabled_tests to
WinChildProcess children, on the basis that if the parent is managing to
run and it’s disabled, disabled tests must actually be enabled.
Bug: crashpad:205
Change-Id: Ied22f16b9329ee13b6b07fd29de704f6fe2a058e
Reviewed-on: https://chromium-review.googlesource.com/742462
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-10-27 17:41:32 -04:00
|
|
|
|
return RUN_ALL_TESTS();
|
2020-01-07 11:14:27 -05:00
|
|
|
|
#endif
|
2017-03-18 00:18:20 -04:00
|
|
|
|
}
|