John Reck | 94c40fe | 2014-10-08 09:28:43 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2014 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
sergeyv | 7dc370b | 2016-06-17 11:21:11 -0700 | [diff] [blame] | 17 | #include "tests/common/LeakChecker.h" |
Chris Craik | 27e58b4 | 2015-12-07 10:01:38 -0800 | [diff] [blame] | 18 | #include "tests/common/TestScene.h" |
John Reck | 94c40fe | 2014-10-08 09:28:43 -0700 | [diff] [blame] | 19 | |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 20 | #include "Properties.h" |
Seigo Nonaka | b6e2013 | 2016-11-14 14:07:41 +0900 | [diff] [blame] | 21 | #include "hwui/Typeface.h" |
John Reck | e248bd1 | 2015-08-05 13:53:53 -0700 | [diff] [blame] | 22 | |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 23 | #include <benchmark/benchmark.h> |
John Reck | b7dd29e | 2015-10-06 13:28:17 -0700 | [diff] [blame] | 24 | #include <getopt.h> |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 25 | #include <pthread.h> |
John Reck | e702c9c | 2015-10-07 10:26:02 -0700 | [diff] [blame] | 26 | #include <stdio.h> |
John Reck | e702c9c | 2015-10-07 10:26:02 -0700 | [diff] [blame] | 27 | #include <unistd.h> |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 28 | #include <string> |
John Reck | e702c9c | 2015-10-07 10:26:02 -0700 | [diff] [blame] | 29 | #include <unordered_map> |
John Reck | b7dd29e | 2015-10-06 13:28:17 -0700 | [diff] [blame] | 30 | #include <vector> |
John Reck | 7f2e5e3 | 2015-05-05 11:00:53 -0700 | [diff] [blame] | 31 | |
John Reck | 682573c | 2015-10-30 10:37:35 -0700 | [diff] [blame] | 32 | #include <errno.h> |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 33 | #include <fcntl.h> |
| 34 | #include <sys/stat.h> |
| 35 | #include <sys/types.h> |
John Reck | 682573c | 2015-10-30 10:37:35 -0700 | [diff] [blame] | 36 | |
John Reck | 94c40fe | 2014-10-08 09:28:43 -0700 | [diff] [blame] | 37 | using namespace android; |
| 38 | using namespace android::uirenderer; |
Chris Craik | 27e58b4 | 2015-12-07 10:01:38 -0800 | [diff] [blame] | 39 | using namespace android::uirenderer::test; |
John Reck | 94c40fe | 2014-10-08 09:28:43 -0700 | [diff] [blame] | 40 | |
John Reck | b7dd29e | 2015-10-06 13:28:17 -0700 | [diff] [blame] | 41 | static int gRepeatCount = 1; |
Chris Craik | 27e58b4 | 2015-12-07 10:01:38 -0800 | [diff] [blame] | 42 | static std::vector<TestScene::Info> gRunTests; |
John Reck | 682573c | 2015-10-30 10:37:35 -0700 | [diff] [blame] | 43 | static TestScene::Options gOpts; |
John Reck | f148076 | 2016-07-03 18:28:25 -0700 | [diff] [blame] | 44 | std::unique_ptr<benchmark::BenchmarkReporter> gBenchmarkReporter; |
John Reck | b7dd29e | 2015-10-06 13:28:17 -0700 | [diff] [blame] | 45 | |
John Reck | f148076 | 2016-07-03 18:28:25 -0700 | [diff] [blame] | 46 | void run(const TestScene::Info& info, const TestScene::Options& opts, |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 47 | benchmark::BenchmarkReporter* reporter); |
John Reck | 16c9d6a | 2015-11-17 15:51:08 -0800 | [diff] [blame] | 48 | |
John Reck | b7dd29e | 2015-10-06 13:28:17 -0700 | [diff] [blame] | 49 | static void printHelp() { |
John Reck | 682573c | 2015-10-30 10:37:35 -0700 | [diff] [blame] | 50 | printf(R"( |
sergeyv | 202c10b | 2016-07-11 17:53:45 -0700 | [diff] [blame] | 51 | USAGE: hwuimacro [OPTIONS] <TESTNAME> |
John Reck | 682573c | 2015-10-30 10:37:35 -0700 | [diff] [blame] | 52 | |
| 53 | OPTIONS: |
| 54 | -c, --count=NUM NUM loops a test should run (example, number of frames) |
| 55 | -r, --runs=NUM Repeat the test(s) NUM times |
| 56 | -h, --help Display this help |
| 57 | --list List all tests |
| 58 | --wait-for-gpu Set this to wait for the GPU before producing the |
| 59 | next frame. Note that without locked clocks this will |
| 60 | pathologically bad performance due to large idle time |
| 61 | --report-frametime[=weight] If set, the test will print to stdout the |
| 62 | moving average frametime. Weight is optional, default is 10 |
| 63 | --cpuset=name Adds the test to the specified cpuset before running |
| 64 | Not supported on all devices and needs root |
sergeyv | 202c10b | 2016-07-11 17:53:45 -0700 | [diff] [blame] | 65 | --offscreen Render tests off device screen. This option is on by default |
| 66 | --onscreen Render tests on device screen. By default tests |
| 67 | are offscreen rendered |
| 68 | --benchmark_format Set output format. Possible values are tabular, json, csv |
John Reck | 18f442e | 2018-04-09 16:56:34 -0700 | [diff] [blame] | 69 | --renderer=TYPE Sets the render pipeline to use. May be skiagl or skiavk |
John Reck | 682573c | 2015-10-30 10:37:35 -0700 | [diff] [blame] | 70 | )"); |
John Reck | b7dd29e | 2015-10-06 13:28:17 -0700 | [diff] [blame] | 71 | } |
| 72 | |
| 73 | static void listTests() { |
| 74 | printf("Tests: \n"); |
Chris Craik | 27e58b4 | 2015-12-07 10:01:38 -0800 | [diff] [blame] | 75 | for (auto&& test : TestScene::testMap()) { |
John Reck | e702c9c | 2015-10-07 10:26:02 -0700 | [diff] [blame] | 76 | auto&& info = test.second; |
| 77 | const char* col1 = info.name.c_str(); |
| 78 | int dlen = info.description.length(); |
| 79 | const char* col2 = info.description.c_str(); |
| 80 | // World's best line breaking algorithm. |
| 81 | do { |
| 82 | int toPrint = dlen; |
| 83 | if (toPrint > 50) { |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 84 | char* found = (char*)memrchr(col2, ' ', 50); |
John Reck | e702c9c | 2015-10-07 10:26:02 -0700 | [diff] [blame] | 85 | if (found) { |
| 86 | toPrint = found - col2; |
| 87 | } else { |
| 88 | toPrint = 50; |
| 89 | } |
| 90 | } |
| 91 | printf("%-20s %.*s\n", col1, toPrint, col2); |
| 92 | col1 = ""; |
| 93 | col2 += toPrint; |
| 94 | dlen -= toPrint; |
| 95 | while (*col2 == ' ') { |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 96 | col2++; |
| 97 | dlen--; |
John Reck | e702c9c | 2015-10-07 10:26:02 -0700 | [diff] [blame] | 98 | } |
| 99 | } while (dlen > 0); |
| 100 | printf("\n"); |
John Reck | b7dd29e | 2015-10-06 13:28:17 -0700 | [diff] [blame] | 101 | } |
| 102 | } |
| 103 | |
John Reck | 682573c | 2015-10-30 10:37:35 -0700 | [diff] [blame] | 104 | static void moveToCpuSet(const char* cpusetName) { |
| 105 | if (access("/dev/cpuset/tasks", F_OK)) { |
| 106 | fprintf(stderr, "don't have access to cpusets, skipping...\n"); |
| 107 | return; |
| 108 | } |
| 109 | static const int BUF_SIZE = 100; |
| 110 | char buffer[BUF_SIZE]; |
| 111 | |
| 112 | if (snprintf(buffer, BUF_SIZE, "/dev/cpuset/%s/tasks", cpusetName) >= BUF_SIZE) { |
| 113 | fprintf(stderr, "Error, cpusetName too large to fit in buffer '%s'\n", cpusetName); |
| 114 | return; |
| 115 | } |
| 116 | int fd = open(buffer, O_WRONLY | O_CLOEXEC); |
| 117 | if (fd == -1) { |
| 118 | fprintf(stderr, "Error opening file %d\n", errno); |
| 119 | return; |
| 120 | } |
| 121 | pid_t pid = getpid(); |
| 122 | |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 123 | int towrite = snprintf(buffer, BUF_SIZE, "%ld", (long)pid); |
John Reck | 682573c | 2015-10-30 10:37:35 -0700 | [diff] [blame] | 124 | if (towrite >= BUF_SIZE) { |
| 125 | fprintf(stderr, "Buffer wasn't large enough?\n"); |
| 126 | } else { |
| 127 | if (write(fd, buffer, towrite) != towrite) { |
| 128 | fprintf(stderr, "Failed to write, errno=%d", errno); |
| 129 | } |
| 130 | } |
| 131 | close(fd); |
| 132 | } |
| 133 | |
John Reck | f148076 | 2016-07-03 18:28:25 -0700 | [diff] [blame] | 134 | static bool setBenchmarkFormat(const char* format) { |
| 135 | if (!strcmp(format, "tabular")) { |
| 136 | gBenchmarkReporter.reset(new benchmark::ConsoleReporter()); |
| 137 | } else if (!strcmp(format, "json")) { |
| 138 | gBenchmarkReporter.reset(new benchmark::JSONReporter()); |
John Reck | f148076 | 2016-07-03 18:28:25 -0700 | [diff] [blame] | 139 | } else { |
| 140 | fprintf(stderr, "Unknown format '%s'", format); |
| 141 | return false; |
| 142 | } |
| 143 | return true; |
| 144 | } |
| 145 | |
John Reck | 113ddd9 | 2017-11-09 16:21:21 -0800 | [diff] [blame] | 146 | static bool setRenderer(const char* renderer) { |
John Reck | 18f442e | 2018-04-09 16:56:34 -0700 | [diff] [blame] | 147 | if (!strcmp(renderer, "skiagl")) { |
John Reck | 113ddd9 | 2017-11-09 16:21:21 -0800 | [diff] [blame] | 148 | Properties::overrideRenderPipelineType(RenderPipelineType::SkiaGL); |
| 149 | } else if (!strcmp(renderer, "skiavk")) { |
| 150 | Properties::overrideRenderPipelineType(RenderPipelineType::SkiaVulkan); |
| 151 | } else { |
| 152 | fprintf(stderr, "Unknown format '%s'", renderer); |
| 153 | return false; |
| 154 | } |
| 155 | return true; |
| 156 | } |
| 157 | |
John Reck | 682573c | 2015-10-30 10:37:35 -0700 | [diff] [blame] | 158 | // For options that only exist in long-form. Anything in the |
| 159 | // 0-255 range is reserved for short options (which just use their ASCII value) |
| 160 | namespace LongOpts { |
| 161 | enum { |
| 162 | Reserved = 255, |
| 163 | List, |
| 164 | WaitForGpu, |
| 165 | ReportFrametime, |
| 166 | CpuSet, |
John Reck | f148076 | 2016-07-03 18:28:25 -0700 | [diff] [blame] | 167 | BenchmarkFormat, |
sergeyv | 202c10b | 2016-07-11 17:53:45 -0700 | [diff] [blame] | 168 | Onscreen, |
John Reck | f148076 | 2016-07-03 18:28:25 -0700 | [diff] [blame] | 169 | Offscreen, |
John Reck | 113ddd9 | 2017-11-09 16:21:21 -0800 | [diff] [blame] | 170 | Renderer, |
John Reck | 682573c | 2015-10-30 10:37:35 -0700 | [diff] [blame] | 171 | }; |
| 172 | } |
| 173 | |
John Reck | b7dd29e | 2015-10-06 13:28:17 -0700 | [diff] [blame] | 174 | static const struct option LONG_OPTIONS[] = { |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 175 | {"frames", required_argument, nullptr, 'f'}, |
| 176 | {"repeat", required_argument, nullptr, 'r'}, |
| 177 | {"help", no_argument, nullptr, 'h'}, |
| 178 | {"list", no_argument, nullptr, LongOpts::List}, |
| 179 | {"wait-for-gpu", no_argument, nullptr, LongOpts::WaitForGpu}, |
| 180 | {"report-frametime", optional_argument, nullptr, LongOpts::ReportFrametime}, |
| 181 | {"cpuset", required_argument, nullptr, LongOpts::CpuSet}, |
| 182 | {"benchmark_format", required_argument, nullptr, LongOpts::BenchmarkFormat}, |
| 183 | {"onscreen", no_argument, nullptr, LongOpts::Onscreen}, |
| 184 | {"offscreen", no_argument, nullptr, LongOpts::Offscreen}, |
John Reck | 113ddd9 | 2017-11-09 16:21:21 -0800 | [diff] [blame] | 185 | {"renderer", required_argument, nullptr, LongOpts::Renderer}, |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 186 | {0, 0, 0, 0}}; |
John Reck | b7dd29e | 2015-10-06 13:28:17 -0700 | [diff] [blame] | 187 | |
| 188 | static const char* SHORT_OPTIONS = "c:r:h"; |
| 189 | |
| 190 | void parseOptions(int argc, char* argv[]) { |
| 191 | int c; |
John Reck | b7dd29e | 2015-10-06 13:28:17 -0700 | [diff] [blame] | 192 | bool error = false; |
| 193 | opterr = 0; |
| 194 | |
| 195 | while (true) { |
John Reck | b7dd29e | 2015-10-06 13:28:17 -0700 | [diff] [blame] | 196 | /* getopt_long stores the option index here. */ |
| 197 | int option_index = 0; |
| 198 | |
| 199 | c = getopt_long(argc, argv, SHORT_OPTIONS, LONG_OPTIONS, &option_index); |
| 200 | |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 201 | if (c == -1) break; |
John Reck | b7dd29e | 2015-10-06 13:28:17 -0700 | [diff] [blame] | 202 | |
| 203 | switch (c) { |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 204 | case 0: |
| 205 | // Option set a flag, don't need to do anything |
| 206 | // (although none of the current LONG_OPTIONS do this...) |
| 207 | break; |
John Reck | b7dd29e | 2015-10-06 13:28:17 -0700 | [diff] [blame] | 208 | |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 209 | case LongOpts::List: |
| 210 | listTests(); |
| 211 | exit(EXIT_SUCCESS); |
| 212 | break; |
John Reck | b7dd29e | 2015-10-06 13:28:17 -0700 | [diff] [blame] | 213 | |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 214 | case 'c': |
| 215 | gOpts.count = atoi(optarg); |
| 216 | if (!gOpts.count) { |
| 217 | fprintf(stderr, "Invalid frames argument '%s'\n", optarg); |
John Reck | 682573c | 2015-10-30 10:37:35 -0700 | [diff] [blame] | 218 | error = true; |
| 219 | } |
John Reck | 682573c | 2015-10-30 10:37:35 -0700 | [diff] [blame] | 220 | break; |
John Reck | 682573c | 2015-10-30 10:37:35 -0700 | [diff] [blame] | 221 | |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 222 | case 'r': |
| 223 | gRepeatCount = atoi(optarg); |
| 224 | if (!gRepeatCount) { |
| 225 | fprintf(stderr, "Invalid repeat argument '%s'\n", optarg); |
| 226 | error = true; |
| 227 | } else { |
| 228 | gRepeatCount = (gRepeatCount > 0 ? gRepeatCount : INT_MAX); |
| 229 | } |
John Reck | f148076 | 2016-07-03 18:28:25 -0700 | [diff] [blame] | 230 | break; |
John Reck | f148076 | 2016-07-03 18:28:25 -0700 | [diff] [blame] | 231 | |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 232 | case LongOpts::ReportFrametime: |
| 233 | if (optarg) { |
| 234 | gOpts.reportFrametimeWeight = atoi(optarg); |
| 235 | if (!gOpts.reportFrametimeWeight) { |
| 236 | fprintf(stderr, "Invalid report frametime weight '%s'\n", optarg); |
| 237 | error = true; |
| 238 | } |
| 239 | } else { |
| 240 | gOpts.reportFrametimeWeight = 10; |
| 241 | } |
| 242 | break; |
sergeyv | 202c10b | 2016-07-11 17:53:45 -0700 | [diff] [blame] | 243 | |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 244 | case LongOpts::WaitForGpu: |
| 245 | Properties::waitForGpuCompletion = true; |
| 246 | break; |
John Reck | f148076 | 2016-07-03 18:28:25 -0700 | [diff] [blame] | 247 | |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 248 | case LongOpts::CpuSet: |
| 249 | if (!optarg) { |
| 250 | error = true; |
| 251 | break; |
| 252 | } |
| 253 | moveToCpuSet(optarg); |
| 254 | break; |
John Reck | b7dd29e | 2015-10-06 13:28:17 -0700 | [diff] [blame] | 255 | |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 256 | case LongOpts::BenchmarkFormat: |
| 257 | if (!optarg) { |
| 258 | error = true; |
| 259 | break; |
| 260 | } |
| 261 | if (!setBenchmarkFormat(optarg)) { |
| 262 | error = true; |
| 263 | } |
| 264 | break; |
| 265 | |
John Reck | 113ddd9 | 2017-11-09 16:21:21 -0800 | [diff] [blame] | 266 | case LongOpts::Renderer: |
| 267 | if (!optarg) { |
| 268 | error = true; |
| 269 | break; |
| 270 | } |
| 271 | if (!setRenderer(optarg)) { |
| 272 | error = true; |
| 273 | } |
| 274 | break; |
| 275 | |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 276 | case LongOpts::Onscreen: |
| 277 | gOpts.renderOffscreen = false; |
| 278 | break; |
| 279 | |
| 280 | case LongOpts::Offscreen: |
| 281 | gOpts.renderOffscreen = true; |
| 282 | break; |
| 283 | |
| 284 | case 'h': |
| 285 | printHelp(); |
| 286 | exit(EXIT_SUCCESS); |
| 287 | break; |
| 288 | |
| 289 | case '?': |
| 290 | fprintf(stderr, "Unrecognized option '%s'\n", argv[optind - 1]); |
Chih-Hung Hsieh | e1afb6c | 2018-10-22 12:25:50 -0700 | [diff] [blame] | 291 | [[fallthrough]]; |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 292 | default: |
| 293 | error = true; |
| 294 | break; |
John Reck | b7dd29e | 2015-10-06 13:28:17 -0700 | [diff] [blame] | 295 | } |
| 296 | } |
| 297 | |
| 298 | if (error) { |
| 299 | fprintf(stderr, "Try 'hwuitest --help' for more information.\n"); |
| 300 | exit(EXIT_FAILURE); |
| 301 | } |
| 302 | |
| 303 | /* Print any remaining command line arguments (not options). */ |
| 304 | if (optind < argc) { |
| 305 | do { |
| 306 | const char* test = argv[optind++]; |
sergeyv | 202c10b | 2016-07-11 17:53:45 -0700 | [diff] [blame] | 307 | auto pos = TestScene::testMap().find(test); |
| 308 | if (pos == TestScene::testMap().end()) { |
| 309 | fprintf(stderr, "Unknown test '%s'\n", test); |
| 310 | exit(EXIT_FAILURE); |
John Reck | b7dd29e | 2015-10-06 13:28:17 -0700 | [diff] [blame] | 311 | } else { |
sergeyv | 202c10b | 2016-07-11 17:53:45 -0700 | [diff] [blame] | 312 | gRunTests.push_back(pos->second); |
John Reck | b7dd29e | 2015-10-06 13:28:17 -0700 | [diff] [blame] | 313 | } |
| 314 | } while (optind < argc); |
| 315 | } else { |
sergeyv | 202c10b | 2016-07-11 17:53:45 -0700 | [diff] [blame] | 316 | for (auto& iter : TestScene::testMap()) { |
| 317 | gRunTests.push_back(iter.second); |
| 318 | } |
John Reck | b7dd29e | 2015-10-06 13:28:17 -0700 | [diff] [blame] | 319 | } |
| 320 | } |
| 321 | |
Chris Craik | 0318887 | 2015-02-02 18:39:33 -0800 | [diff] [blame] | 322 | int main(int argc, char* argv[]) { |
John Reck | 682573c | 2015-10-30 10:37:35 -0700 | [diff] [blame] | 323 | // set defaults |
| 324 | gOpts.count = 150; |
| 325 | |
Seigo Nonaka | b6e2013 | 2016-11-14 14:07:41 +0900 | [diff] [blame] | 326 | Typeface::setRobotoTypefaceForTest(); |
| 327 | |
John Reck | b7dd29e | 2015-10-06 13:28:17 -0700 | [diff] [blame] | 328 | parseOptions(argc, argv); |
John Reck | f148076 | 2016-07-03 18:28:25 -0700 | [diff] [blame] | 329 | if (!gBenchmarkReporter && gOpts.renderOffscreen) { |
| 330 | gBenchmarkReporter.reset(new benchmark::ConsoleReporter()); |
| 331 | } |
| 332 | |
| 333 | if (gBenchmarkReporter) { |
| 334 | size_t name_field_width = 10; |
| 335 | for (auto&& test : gRunTests) { |
| 336 | name_field_width = std::max<size_t>(name_field_width, test.name.size()); |
| 337 | } |
| 338 | // _50th, _90th, etc... |
| 339 | name_field_width += 5; |
| 340 | |
| 341 | benchmark::BenchmarkReporter::Context context; |
John Reck | f148076 | 2016-07-03 18:28:25 -0700 | [diff] [blame] | 342 | context.name_field_width = name_field_width; |
| 343 | gBenchmarkReporter->ReportContext(context); |
| 344 | } |
John Reck | b7dd29e | 2015-10-06 13:28:17 -0700 | [diff] [blame] | 345 | |
| 346 | for (int i = 0; i < gRepeatCount; i++) { |
| 347 | for (auto&& test : gRunTests) { |
John Reck | f148076 | 2016-07-03 18:28:25 -0700 | [diff] [blame] | 348 | run(test, gOpts, gBenchmarkReporter.get()); |
Tim Murray | 1a0f1c7 | 2015-05-06 11:37:37 -0700 | [diff] [blame] | 349 | } |
| 350 | } |
John Reck | f148076 | 2016-07-03 18:28:25 -0700 | [diff] [blame] | 351 | |
| 352 | if (gBenchmarkReporter) { |
| 353 | gBenchmarkReporter->Finalize(); |
| 354 | } |
| 355 | |
sergeyv | 7dc370b | 2016-06-17 11:21:11 -0700 | [diff] [blame] | 356 | LeakChecker::checkForLeaks(); |
John Reck | 94c40fe | 2014-10-08 09:28:43 -0700 | [diff] [blame] | 357 | return 0; |
| 358 | } |