mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 15:06:14 +01:00
tests/performance: add "--quiet" argument to performance
The default output is annoyingly verbose. You see Running test simple-construction simple-construction: Millions of constructed objects per second: 33.498 Running test simple-construction1 simple-construction1: Millions of constructed objects per second: 142.493 Running test complex-construction complex-construction: Millions of constructed objects per second: 14.304 Running test complex-construction1 ... where the "Running test" lines just clutter the output. In fact so much so, that my terminal fills up and I don't see the output of all tests in one page. The "Running test" line is not so useful, because I mostly care about the test result, and that line already contains the test name. Add an option to silence this.
This commit is contained in:
parent
65a59bde57
commit
e5e3c37d22
@ -31,11 +31,14 @@
|
||||
#define TARGET_ROUND_TIME 0.008
|
||||
|
||||
static gboolean verbose = FALSE;
|
||||
static gboolean quiet = FALSE;
|
||||
static int test_length = DEFAULT_TEST_TIME;
|
||||
|
||||
static GOptionEntry cmd_entries[] = {
|
||||
{"verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose,
|
||||
"Print extra information", NULL},
|
||||
{"quiet", 'q', 0, G_OPTION_ARG_NONE, &quiet,
|
||||
"Print extra information", NULL},
|
||||
{"seconds", 's', 0, G_OPTION_ARG_INT, &test_length,
|
||||
"Time to run each test in seconds", NULL},
|
||||
G_OPTION_ENTRY_NULL
|
||||
@ -69,7 +72,8 @@ run_test (PerformanceTest *test)
|
||||
double elapsed, min_elapsed, max_elapsed, avg_elapsed, factor;
|
||||
GTimer *timer;
|
||||
|
||||
g_print ("Running test %s\n", test->name);
|
||||
if (verbose || !quiet)
|
||||
g_print ("Running test %s\n", test->name);
|
||||
|
||||
/* Set up test */
|
||||
timer = g_timer_new ();
|
||||
|
Loading…
Reference in New Issue
Block a user