dawn_perf_tests_main.cc 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. // Copyright 2019 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. namespace {
  11. int RunHelper(base::TestSuite* test_suite) {
  12. base::SingleThreadTaskExecutor io_task_executor(base::MessagePumpType::IO);
  13. return test_suite->Run();
  14. }
  15. } // namespace
  16. // Definition located in third_party/dawn/src/tests/perf_tests/DawnPerfTest.h
  17. // Forward declared here to avoid pulling in the Dawn headers.
  18. void InitDawnPerfTestEnvironment(int argc, char** argv);
  19. int main(int argc, char** argv) {
  20. base::CommandLine::Init(argc, argv);
  21. InitDawnPerfTestEnvironment(argc, argv);
  22. base::TestSuite test_suite(argc, argv);
  23. int rt = base::LaunchUnitTestsSerially(
  24. argc, argv, base::BindOnce(&RunHelper, base::Unretained(&test_suite)));
  25. return rt;
  26. }