From e1f4445dff20a221287ad7b4c0140d03fe077866 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 21 May 2022 15:11:53 -0600 Subject: [PATCH] [benchmark-shape] Allow taking multiple tests from cmdline --- perf/benchmark-shape.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/perf/benchmark-shape.cc b/perf/benchmark-shape.cc index dd68c06b8..5e84484e2 100644 --- a/perf/benchmark-shape.cc +++ b/perf/benchmark-shape.cc @@ -105,12 +105,14 @@ int main(int argc, char** argv) if (argc > 2) { - num_tests = 1; + num_tests = (argc - 1) / 2; tests = (test_input_t *) calloc (num_tests, sizeof (test_input_t)); - - tests[0].is_variable = true; - tests[0].text_path = argv[1]; - tests[0].font_path = argv[2]; + for (unsigned i = 0; i < num_tests; i++) + { + tests[i].is_variable = true; + tests[i].text_path = argv[1 + i * 2]; + tests[i].font_path = argv[2 + i * 2]; + } } for (unsigned i = 0; i < num_tests; i++)