license.bot | f003cfe | 2008-08-24 09:55:55 +0900 | [diff] [blame^] | 1 | // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 4 | |
| 5 | #include <windows.h> |
| 6 | |
cpu@google.com | b90f1cd | 2008-08-01 12:06:25 +0900 | [diff] [blame] | 7 | #include "base/at_exit.h" |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 8 | #include "base/command_line.h" |
| 9 | #include "base/perftimer.h" |
| 10 | #include "base/string_util.h" |
| 11 | #include "base/test_suite.h" |
| 12 | |
| 13 | int main(int argc, char** argv) { |
cpu@google.com | b90f1cd | 2008-08-01 12:06:25 +0900 | [diff] [blame] | 14 | // Some tests may use base::Singleton<>, thus we need to instanciate |
| 15 | // the AtExitManager or else we will leak objects. |
| 16 | base::AtExitManager at_exit_manager; |
| 17 | |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 18 | // Initialize the perf timer log |
| 19 | std::string log_file = |
| 20 | WideToUTF8(CommandLine().GetSwitchValue(L"log-file")); |
| 21 | if (log_file.empty()) |
| 22 | log_file = "perf_test.log"; |
| 23 | ASSERT_TRUE(InitPerfLog(log_file.c_str())); |
| 24 | |
| 25 | // Raise to high priority to have more precise measurements. Since we don't |
| 26 | // aim at 1% precision, it is not necessary to run at realtime level. |
| 27 | if (!IsDebuggerPresent()) |
| 28 | SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS); |
| 29 | |
| 30 | int rv = TestSuite(argc, argv).Run(); |
| 31 | |
| 32 | FinalizePerfLog(); |
| 33 | return rv; |
| 34 | } |
license.bot | f003cfe | 2008-08-24 09:55:55 +0900 | [diff] [blame^] | 35 | |