diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2009-09-24 16:30:57 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2009-09-29 03:03:51 +0100 |
commit | f23ae97e307f00a79cbf2e01f9ca20da29ea87c3 (patch) | |
tree | f035f5ff252abd05dc1251e9f0e25228a5805100 /perf/cairo-perf-compare-backends.c | |
parent | 50163a9fafa77dd1135ca5b6b03c7ec5619687c1 (diff) | |
download | cairo-f23ae97e307f00a79cbf2e01f9ca20da29ea87c3.tar.gz |
[perf] Support parsing reports from stdin
Diffstat (limited to 'perf/cairo-perf-compare-backends.c')
-rw-r--r-- | perf/cairo-perf-compare-backends.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/perf/cairo-perf-compare-backends.c b/perf/cairo-perf-compare-backends.c index 1448169b0..277536e5e 100644 --- a/perf/cairo-perf-compare-backends.c +++ b/perf/cairo-perf-compare-backends.c @@ -363,16 +363,18 @@ main (int argc, const char *argv[]) parse_args (argc, argv, &args); - if (args.num_filenames < 1) - usage (argv[0]); - - reports = xcalloc (args.num_filenames, sizeof (cairo_perf_report_t)); - - for (i = 0; i < args.num_filenames; i++) { - cairo_perf_report_load (&reports[i], args.filenames[i], - test_report_cmp_name); - printf ("loaded: %s, %d tests\n", - args.filenames[i], reports[i].tests_count); + if (args.num_filenames) { + reports = xcalloc (args.num_filenames, sizeof (cairo_perf_report_t)); + for (i = 0; i < args.num_filenames; i++) { + cairo_perf_report_load (&reports[i], args.filenames[i], + test_report_cmp_name); + printf ("loaded: %s, %d tests\n", + args.filenames[i], reports[i].tests_count); + } + } else { + args.num_filenames = 1; + reports = xcalloc (args.num_filenames, sizeof (cairo_perf_report_t)); + cairo_perf_report_load (&reports[0], NULL, test_report_cmp_name); } cairo_perf_reports_compare (reports, args.num_filenames, &args.options); |