Commit 0b71452b authored by Corentin Wallez's avatar Corentin Wallez Committed by Commit Bot

gpu: Add "main" files for Dawn's gtest targets.

Also changes existing test targets to use base::BindOnce instead of the
deprecated base::Bind, and removes some unused includes.

R=kbr@chromium.org

BUG=chromium:870747

Change-Id: Ib94ffd228a6057a7010e8581ccb3392ae700c357
Reviewed-on: https://chromium-review.googlesource.com/c/1307510Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#603945}
parent a3665685
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "base/at_exit.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop.h"
...@@ -36,8 +35,6 @@ int main(int argc, char** argv) { ...@@ -36,8 +35,6 @@ int main(int argc, char** argv) {
angle::InitTestHarness(&argc, argv); angle::InitTestHarness(&argc, argv);
base::TestSuite test_suite(argc, argv); base::TestSuite test_suite(argc, argv);
int rt = base::LaunchUnitTestsSerially( int rt = base::LaunchUnitTestsSerially(
argc, argc, argv, base::BindOnce(&RunHelper, base::Unretained(&test_suite)));
argv,
base::Bind(&RunHelper, base::Unretained(&test_suite)));
return rt; return rt;
} }
...@@ -2,14 +2,12 @@ ...@@ -2,14 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "base/at_exit.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop.h"
#include "base/test/launcher/unit_test_launcher.h" #include "base/test/launcher/unit_test_launcher.h"
#include "base/test/test_suite.h" #include "base/test/test_suite.h"
#include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/angle/src/tests/test_utils/ANGLETest.h" #include "third_party/angle/src/tests/test_utils/ANGLETest.h"
namespace { namespace {
...@@ -27,11 +25,10 @@ int main(int argc, char** argv) { ...@@ -27,11 +25,10 @@ int main(int argc, char** argv) {
testing::AddGlobalTestEnvironment(new ANGLETestEnvironment()); testing::AddGlobalTestEnvironment(new ANGLETestEnvironment());
base::TestSuite test_suite(argc, argv); base::TestSuite test_suite(argc, argv);
int rt = base::LaunchUnitTestsWithOptions( int rt = base::LaunchUnitTestsWithOptions(
argc, argc, argv,
argv, 1, // Run tests serially.
1, // Run tests serially. 0, // Disable batching.
0, // Disable batching.
true, // Use job objects. true, // Use job objects.
base::Bind(&RunHelper, base::Unretained(&test_suite))); base::BindOnce(&RunHelper, base::Unretained(&test_suite)));
return rt; return rt;
} }
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "base/at_exit.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop.h"
...@@ -30,8 +29,6 @@ int main(int argc, char** argv) { ...@@ -30,8 +29,6 @@ int main(int argc, char** argv) {
base::CommandLine::Init(argc, argv); base::CommandLine::Init(argc, argv);
base::TestSuite test_suite(argc, argv); base::TestSuite test_suite(argc, argv);
int rt = base::LaunchUnitTestsSerially( int rt = base::LaunchUnitTestsSerially(
argc, argc, argv, base::BindOnce(&RunHelper, base::Unretained(&test_suite)));
argv,
base::Bind(&RunHelper, base::Unretained(&test_suite)));
return rt; return rt;
} }
...@@ -2,14 +2,12 @@ ...@@ -2,14 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "base/at_exit.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop.h"
#include "base/test/launcher/unit_test_launcher.h" #include "base/test/launcher/unit_test_launcher.h"
#include "base/test/test_suite.h" #include "base/test/test_suite.h"
#include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/angle/include/GLSLANG/ShaderLang.h" #include "third_party/angle/include/GLSLANG/ShaderLang.h"
namespace { namespace {
...@@ -27,9 +25,7 @@ int main(int argc, char** argv) { ...@@ -27,9 +25,7 @@ int main(int argc, char** argv) {
sh::Initialize(); sh::Initialize();
base::TestSuite test_suite(argc, argv); base::TestSuite test_suite(argc, argv);
int rt = base::LaunchUnitTestsSerially( int rt = base::LaunchUnitTestsSerially(
argc, argc, argv, base::BindOnce(&RunHelper, base::Unretained(&test_suite)));
argv,
base::Bind(&RunHelper, base::Unretained(&test_suite)));
sh::Finalize(); sh::Finalize();
return rt; return rt;
} }
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/bind.h"
#include "base/command_line.h"
#include "base/message_loop/message_loop.h"
#include "base/test/launcher/unit_test_launcher.h"
#include "base/test/test_suite.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
int RunHelper(base::TestSuite* test_suite) {
base::MessageLoop message_loop;
return test_suite->Run();
}
} // namespace
int main(int argc, char** argv) {
base::CommandLine::Init(argc, argv);
testing::InitGoogleMock(&argc, argv);
base::TestSuite test_suite(argc, argv);
int rt = base::LaunchUnitTestsWithOptions(
argc, argv,
1, // Run tests serially.
0, // Disable batching.
true, // Use job objects.
base::BindOnce(&RunHelper, base::Unretained(&test_suite)));
return rt;
}
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/bind.h"
#include "base/command_line.h"
#include "base/message_loop/message_loop.h"
#include "base/test/launcher/unit_test_launcher.h"
#include "base/test/test_suite.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace {
int RunHelper(base::TestSuite* test_suite) {
base::MessageLoopForIO message_loop;
return test_suite->Run();
}
} // namespace
int main(int argc, char** argv) {
base::CommandLine::Init(argc, argv);
testing::InitGoogleMock(&argc, argv);
base::TestSuite test_suite(argc, argv);
int rt = base::LaunchUnitTestsSerially(
argc, argv, base::BindOnce(&RunHelper, base::Unretained(&test_suite)));
return rt;
}
...@@ -2,14 +2,12 @@ ...@@ -2,14 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "base/at_exit.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop.h"
#include "base/test/launcher/unit_test_launcher.h" #include "base/test/launcher/unit_test_launcher.h"
#include "base/test/test_suite.h" #include "base/test/test_suite.h"
#include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/swiftshader/tests/unittests/SwiftShaderTest.h" #include "third_party/swiftshader/tests/unittests/SwiftShaderTest.h"
namespace { namespace {
...@@ -31,6 +29,6 @@ int main(int argc, char** argv) { ...@@ -31,6 +29,6 @@ int main(int argc, char** argv) {
1, // Run tests serially. 1, // Run tests serially.
0, // Disable batching. 0, // Disable batching.
true, // Use job objects. true, // Use job objects.
base::Bind(&RunHelper, base::Unretained(&test_suite))); base::BindOnce(&RunHelper, base::Unretained(&test_suite)));
return rt; return rt;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment