This patch combine three patch which is related to "--gcov" flag.
[platform/framework/web/chromium-efl.git] / gpu / swiftshader_tests_main.cc
1 // Copyright 2017 The Chromium Authors
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/command_line.h"
6 #include "base/functional/bind.h"
7 #include "base/functional/callback_helpers.h"
8 #include "base/task/single_thread_task_executor.h"
9 #include "base/test/launcher/unit_test_launcher.h"
10 #include "base/test/test_suite.h"
11 #include "testing/gmock/include/gmock/gmock.h"
12 #include "testing/gtest/include/gtest/gtest.h"
13
14 namespace {
15
16 int RunHelper(base::TestSuite* test_suite) {
17   base::SingleThreadTaskExecutor task_executor;
18   return test_suite->Run();
19 }
20
21 }  // namespace
22
23 class SwiftShaderTestEnvironment : public testing::Environment {
24  public:
25   void SetUp() override {}
26   void TearDown() override {}
27 };
28
29 int main(int argc, char** argv) {
30   base::CommandLine::Init(argc, argv);
31   testing::InitGoogleMock(&argc, argv);
32   testing::AddGlobalTestEnvironment(new SwiftShaderTestEnvironment());
33   base::TestSuite test_suite(argc, argv);
34   int rt = base::LaunchUnitTestsWithOptions(
35       argc, argv,
36       1,                  // Run tests serially.
37       0,                  // Disable batching.
38       true,               // Use job objects.
39       base::DoNothing(),  // No special action on test timeout.
40       base::BindOnce(&RunHelper, base::Unretained(&test_suite)));
41   return rt;
42 }