about summary refs log tree commit diff
path: root/support/support_test_main.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2016-12-31 11:01:40 +0100
committerFlorian Weimer <fweimer@redhat.com>2016-12-31 18:51:15 +0100
commitf47ae5186624e5bb3a2d2b25be742b90a1eee3cd (patch)
treeb479133044166a9bd6dfd0f225376218c1c22222 /support/support_test_main.c
parent039c5a05cc905e3d48392e7ea9f85e339b7c068b (diff)
downloadglibc-f47ae5186624e5bb3a2d2b25be742b90a1eee3cd.tar.gz
glibc-f47ae5186624e5bb3a2d2b25be742b90a1eee3cd.tar.xz
glibc-f47ae5186624e5bb3a2d2b25be742b90a1eee3cd.zip
support: Implement --verbose option for test programs
Some tests can produce rather verbose tracing information,
and the --verbose option provides a standardized way to enable
such logging output.
Diffstat (limited to 'support/support_test_main.c')
-rw-r--r--support/support_test_main.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/support/support_test_main.c b/support/support_test_main.c
index 8d31e2f138..1c90986506 100644
--- a/support/support_test_main.c
+++ b/support/support_test_main.c
@@ -37,8 +37,7 @@
 
 static const struct option default_options[] =
 {
-  { "direct", no_argument, NULL, OPT_DIRECT },
-  { "test-dir", required_argument, NULL, OPT_TESTDIR },
+  TEST_DEFAULT_OPTIONS
   { NULL, 0, NULL, 0 }
 };
 
@@ -67,6 +66,9 @@ usage (const struct option *options)
       printf ("%*s", 25 - indent, "");
       switch (options[i].val)
         {
+        case 'v':
+          printf ("Increase the output verbosity");
+          break;
         case OPT_DIRECT:
           printf ("Run the test directly (instead of forking & monitoring)");
           break;
@@ -164,7 +166,7 @@ run_test_function (int argc, char **argv, const struct test_config *config)
 static bool test_main_called;
 
 const char *test_dir = NULL;
-
+unsigned int test_verbose = 0;
 
 /* If test failure reporting has been linked in, it may contribute
    additional test failures.  */
@@ -215,6 +217,9 @@ support_test_main (int argc, char **argv, const struct test_config *config)
       case '?':
         usage (options);
         exit (1);
+      case 'v':
+        ++test_verbose;
+        break;
       case OPT_DIRECT:
         direct = 1;
         break;