dawn_unittests_main.cc 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright 2018 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. #include "base/bind.h"
  5. #include "base/command_line.h"
  6. #include "base/message_loop/message_pump_type.h"
  7. #include "base/task/single_thread_task_executor.h"
  8. #include "base/test/launcher/unit_test_launcher.h"
  9. #include "base/test/test_suite.h"
  10. #include "testing/gmock/include/gmock/gmock.h"
  11. namespace {
  12. int RunHelper(base::TestSuite* test_suite) {
  13. base::SingleThreadTaskExecutor io_task_executor(base::MessagePumpType::IO);
  14. return test_suite->Run();
  15. }
  16. } // namespace
  17. // Definition located in third_party/dawn/src/tests/unittests/validation/ValidationTest.h
  18. // Forward declared here to avoid pulling in the Dawn headers.
  19. void InitDawnValidationTestEnvironment(int argc, char** argv);
  20. int main(int argc, char** argv) {
  21. base::CommandLine::Init(argc, argv);
  22. InitDawnValidationTestEnvironment(argc, argv);
  23. testing::InitGoogleMock(&argc, argv);
  24. base::TestSuite test_suite(argc, argv);
  25. int rt = base::LaunchUnitTestsSerially(
  26. argc, argv, base::BindOnce(&RunHelper, base::Unretained(&test_suite)));
  27. return rt;
  28. }