blob: 871e42d0fe44027eae11bdff4d5b3b3b95861f51 [file] [log] [blame]
jmadill027aa70482015-03-24 22:01:261// Copyright 2013 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.
4
5#include "base/at_exit.h"
6#include "base/bind.h"
7#include "base/command_line.h"
8#include "base/message_loop/message_loop.h"
9#include "base/test/launcher/unit_test_launcher.h"
10#include "base/test/test_suite.h"
11
12namespace {
13
14int RunHelper(base::TestSuite* test_suite) {
15 base::MessageLoopForIO message_loop;
16 return test_suite->Run();
17}
18
19} // namespace
20
Jamie Madill9cddc992017-09-26 03:19:2121extern bool g_OnlyOneRunFrame;
22
jmadill027aa70482015-03-24 22:01:2623int main(int argc, char** argv) {
Jamie Madill9cddc992017-09-26 03:19:2124 for (int i = 0; i < argc; ++i) {
25 if (strcmp("--one-frame-only", argv[i]) == 0) {
26 g_OnlyOneRunFrame = true;
27 }
28 }
29
jmadill027aa70482015-03-24 22:01:2630 base::CommandLine::Init(argc, argv);
31 base::TestSuite test_suite(argc, argv);
32 int rt = base::LaunchUnitTestsSerially(
33 argc,
34 argv,
35 base::Bind(&RunHelper, base::Unretained(&test_suite)));
36 return rt;
37}