jmadill | 027aa7048 | 2015-03-24 22:01:26 | [diff] [blame] | 1 | // Copyright 2013 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 | |
jmadill | 027aa7048 | 2015-03-24 22:01:26 | [diff] [blame] | 5 | #include "base/bind.h" |
| 6 | #include "base/command_line.h" |
Alex Clarke | f7fb8a8 | 2019-06-06 15:41:53 | [diff] [blame^] | 7 | #include "base/task/single_thread_task_executor.h" |
jmadill | 027aa7048 | 2015-03-24 22:01:26 | [diff] [blame] | 8 | #include "base/test/launcher/unit_test_launcher.h" |
| 9 | #include "base/test/test_suite.h" |
| 10 | |
| 11 | namespace { |
| 12 | |
| 13 | int RunHelper(base::TestSuite* test_suite) { |
Alex Clarke | f7fb8a8 | 2019-06-06 15:41:53 | [diff] [blame^] | 14 | base::SingleThreadTaskExecutor io_task_executor(base::MessagePump::Type::IO); |
jmadill | 027aa7048 | 2015-03-24 22:01:26 | [diff] [blame] | 15 | return test_suite->Run(); |
| 16 | } |
| 17 | |
| 18 | } // namespace |
| 19 | |
Jamie Madill | af6fc95 | 2018-11-17 13:48:51 | [diff] [blame] | 20 | void ANGLEProcessPerfTestArgs(int *argc, char **argv); |
Jamie Madill | 9cddc99 | 2017-09-26 03:19:21 | [diff] [blame] | 21 | |
jmadill | 027aa7048 | 2015-03-24 22:01:26 | [diff] [blame] | 22 | int main(int argc, char** argv) { |
Jamie Madill | af6fc95 | 2018-11-17 13:48:51 | [diff] [blame] | 23 | // base::CommandLine::Init must be called before ANGLEProcessPerfTestArgs. |
| 24 | // See comment in angle_deqp_tests_main.cc. |
jmadill | 027aa7048 | 2015-03-24 22:01:26 | [diff] [blame] | 25 | base::CommandLine::Init(argc, argv); |
Jamie Madill | af6fc95 | 2018-11-17 13:48:51 | [diff] [blame] | 26 | ANGLEProcessPerfTestArgs(&argc, argv); |
| 27 | |
jmadill | 027aa7048 | 2015-03-24 22:01:26 | [diff] [blame] | 28 | base::TestSuite test_suite(argc, argv); |
| 29 | int rt = base::LaunchUnitTestsSerially( |
Corentin Wallez | 0b71452b | 2018-10-30 17:35:00 | [diff] [blame] | 30 | argc, argv, base::BindOnce(&RunHelper, base::Unretained(&test_suite))); |
jmadill | 027aa7048 | 2015-03-24 22:01:26 | [diff] [blame] | 31 | return rt; |
| 32 | } |