blob: 8e62c537039ce3b109d34179486f69bc594e657e [file] [log] [blame]
license.botf003cfe2008-08-24 09:55:55 +09001// 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.commit3f4a7322008-07-27 06:49:38 +09004
5#include <windows.h>
6
cpu@google.comb90f1cd2008-08-01 12:06:25 +09007#include "base/at_exit.h"
initial.commit3f4a7322008-07-27 06:49:38 +09008#include "base/command_line.h"
9#include "base/perftimer.h"
10#include "base/string_util.h"
11#include "base/test_suite.h"
12
13int main(int argc, char** argv) {
cpu@google.comb90f1cd2008-08-01 12:06:25 +090014 // 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.commit3f4a7322008-07-27 06:49:38 +090018 // 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.botf003cfe2008-08-24 09:55:55 +090035