diff options
author | erikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-13 22:35:10 +0000 |
---|---|---|
committer | erikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-13 22:35:10 +0000 |
commit | 302831b6e4e9d8a700ecbea7616f1879898bbfb9 (patch) | |
tree | 1325149eae7db9f1a302801d275ae9761b1aebf1 /chrome/test | |
parent | d3f6b195024afbf311e9eff816ebe17d853d9ab8 (diff) | |
download | chromium_src-302831b6e4e9d8a700ecbea7616f1879898bbfb9.zip chromium_src-302831b6e4e9d8a700ecbea7616f1879898bbfb9.tar.gz chromium_src-302831b6e4e9d8a700ecbea7616f1879898bbfb9.tar.bz2 |
Call logging::InitLogging. The lack of this was causing some hangs (and possibly crashes) in ObserverListTest.BUG=6286
This CL has expanded to include some cleanup and refactoring of test_suite and related files, so that this logging change (and other improvements) are applied to all unit tests.
Review URL: http://codereview.chromium.org/18003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7977 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r-- | chrome/test/perf/perftests.cc | 49 | ||||
-rw-r--r-- | chrome/test/reliability/run_all_unittests.cc | 3 | ||||
-rw-r--r-- | chrome/test/ui/run_all_unittests.cc | 3 | ||||
-rw-r--r-- | chrome/test/unit/run_all_unittests.cc | 2 |
4 files changed, 2 insertions, 55 deletions
diff --git a/chrome/test/perf/perftests.cc b/chrome/test/perf/perftests.cc index 18d92aa..da37ba3 100644 --- a/chrome/test/perf/perftests.cc +++ b/chrome/test/perf/perftests.cc @@ -2,59 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/at_exit.h" -#include "base/command_line.h" -#include "base/debug_util.h" #include "base/message_loop.h" -#include "base/perftimer.h" -#include "base/process_util.h" +#include "base/perf_test_suite.h" #include "chrome/common/chrome_paths.cc" -#include "testing/gtest/include/gtest/gtest.h" - -// TODO(darin): share code with base/run_all_perftests.cc int main(int argc, char **argv) { - base::AtExitManager exit_manager; - base::EnableTerminationOnHeapCorruption(); - CommandLine::SetArgcArgv(argc, argv); chrome::RegisterPathProvider(); MessageLoop main_message_loop; - testing::InitGoogleTest(&argc, argv); - - const char log_file_switch[] = "-o"; - const char* log_filename = NULL; - for (int i = 1; i < argc; i++) { - if (strcmp(argv[i], log_file_switch) == 0) { - // found the switch for the log file, use the next arg - if (i >= argc - 1) { - fprintf(stderr, "Log file not specified"); - return 1; - } - log_filename = argv[i + 1]; - } - } - if (!log_filename) { - // use the default filename - log_filename = "perf_test.log"; - } - printf("Using output file \"%s\" (change with %s <filename>)\n", - log_filename, log_file_switch); - - if (!InitPerfLog(log_filename)) { - fprintf(stderr, "Unable to open log file\n"); - return 1; - } - - // Raise to high priority to have more precise measurements. Since we don't - // aim at 1% precision, it is not necessary to run at realtime level. - if (!DebugUtil::BeingDebugged()) { - base::RaiseProcessToHighPriority(); - } - - int result = RUN_ALL_TESTS(); - - FinalizePerfLog(); - return result; + return PerfTestSuite(argc, argv).Run(); } diff --git a/chrome/test/reliability/run_all_unittests.cc b/chrome/test/reliability/run_all_unittests.cc index 1f7b2a3..2555872 100644 --- a/chrome/test/reliability/run_all_unittests.cc +++ b/chrome/test/reliability/run_all_unittests.cc @@ -2,12 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/at_exit.h" -#include "base/process_util.h" #include "chrome/test/reliability/reliability_test_suite.h" int main(int argc, char **argv) { - base::EnableTerminationOnHeapCorruption(); return ReliabilityTestSuite(argc, argv).Run(); } diff --git a/chrome/test/ui/run_all_unittests.cc b/chrome/test/ui/run_all_unittests.cc index 1670f1c..7745bcaf 100644 --- a/chrome/test/ui/run_all_unittests.cc +++ b/chrome/test/ui/run_all_unittests.cc @@ -2,13 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/at_exit.h" #include "base/platform_thread.h" -#include "base/process_util.h" #include "chrome/test/ui/ui_test_suite.h" int main(int argc, char **argv) { - base::EnableTerminationOnHeapCorruption(); PlatformThread::SetName("Tests_Main"); return UITestSuite(argc, argv).Run(); } diff --git a/chrome/test/unit/run_all_unittests.cc b/chrome/test/unit/run_all_unittests.cc index 8c162f1..5534dbe 100644 --- a/chrome/test/unit/run_all_unittests.cc +++ b/chrome/test/unit/run_all_unittests.cc @@ -2,10 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/process_util.h" #include "chrome/test/unit/chrome_test_suite.h" int main(int argc, char **argv) { - base::EnableTerminationOnHeapCorruption(); return ChromeTestSuite(argc, argv).Run(); } |