This patch combine three patch which is related to "--gcov" flag.
[platform/framework/web/chromium-efl.git] / gpu / dawn_end2end_tests_main.cc
1 // Copyright 2018 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 // Definition located in third_party/dawn/src/tests/DawnTest.h
24 // Forward declared here to avoid pulling in the Dawn headers.
25 void InitDawnEnd2EndTestEnvironment(int argc, char** argv);
26
27 int main(int argc, char** argv) {
28   base::CommandLine::Init(argc, argv);
29
30   // Environment initialization is done before test initialization
31   // so tests can be instantiated for each available GPU adapter.
32   InitDawnEnd2EndTestEnvironment(argc, argv);
33
34   testing::InitGoogleMock(&argc, argv);
35   base::TestSuite test_suite(argc, argv);
36   int rt = base::LaunchUnitTestsWithOptions(
37       argc, argv,
38       1,                  // Run tests serially.
39       0,                  // Disable batching.
40       true,               // Use job objects.
41       base::DoNothing(),  // No special action on timeout.
42       base::BindOnce(&RunHelper, base::Unretained(&test_suite)));
43   return rt;
44 }