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" |
Chris Sharp | 7840c58 | 2019-08-02 15:45:32 | [diff] [blame] | 7 | #include "base/message_loop/message_pump_type.h" |
Alex Clarke | f7fb8a8 | 2019-06-06 15:41:53 | [diff] [blame] | 8 | #include "base/task/single_thread_task_executor.h" |
jmadill | 027aa7048 | 2015-03-24 22:01:26 | [diff] [blame] | 9 | #include "base/test/launcher/unit_test_launcher.h" |
| 10 | #include "base/test/test_suite.h" |
| 11 | |
| 12 | namespace { |
| 13 | |
| 14 | int RunHelper(base::TestSuite* test_suite) { |
Chris Sharp | 7840c58 | 2019-08-02 15:45:32 | [diff] [blame] | 15 | base::SingleThreadTaskExecutor io_task_executor(base::MessagePumpType::IO); |
jmadill | 027aa7048 | 2015-03-24 22:01:26 | [diff] [blame] | 16 | return test_suite->Run(); |
| 17 | } |
| 18 | |
| 19 | } // namespace |
| 20 | |
Jamie Madill | af6fc95 | 2018-11-17 13:48:51 | [diff] [blame] | 21 | void ANGLEProcessPerfTestArgs(int *argc, char **argv); |
Jamie Madill | 9cddc99 | 2017-09-26 03:19:21 | [diff] [blame] | 22 | |
jmadill | 027aa7048 | 2015-03-24 22:01:26 | [diff] [blame] | 23 | int main(int argc, char** argv) { |
Jamie Madill | af6fc95 | 2018-11-17 13:48:51 | [diff] [blame] | 24 | // base::CommandLine::Init must be called before ANGLEProcessPerfTestArgs. |
| 25 | // See comment in angle_deqp_tests_main.cc. |
jmadill | 027aa7048 | 2015-03-24 22:01:26 | [diff] [blame] | 26 | base::CommandLine::Init(argc, argv); |
Jamie Madill | af6fc95 | 2018-11-17 13:48:51 | [diff] [blame] | 27 | ANGLEProcessPerfTestArgs(&argc, argv); |
| 28 | |
jmadill | 027aa7048 | 2015-03-24 22:01:26 | [diff] [blame] | 29 | base::TestSuite test_suite(argc, argv); |
François Doray | 2b82f40 | 2019-11-04 21:16:48 | [diff] [blame] | 30 | |
| 31 | // The thread priority is modified by StabilizeCPUForBenchmarking(). |
| 32 | test_suite.DisableCheckForThreadAndProcessPriority(); |
| 33 | |
jmadill | 027aa7048 | 2015-03-24 22:01:26 | [diff] [blame] | 34 | int rt = base::LaunchUnitTestsSerially( |
Corentin Wallez | 0b71452b | 2018-10-30 17:35:00 | [diff] [blame] | 35 | argc, argv, base::BindOnce(&RunHelper, base::Unretained(&test_suite))); |
jmadill | 027aa7048 | 2015-03-24 22:01:26 | [diff] [blame] | 36 | return rt; |
| 37 | } |