]> sourceware.org Git - glibc.git/commitdiff
support: Add TEST_NO_SETVBUF
authorFlorian Weimer <fweimer@redhat.com>
Tue, 26 Jun 2018 10:05:21 +0000 (12:05 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Tue, 26 Jun 2018 10:30:50 +0000 (12:30 +0200)
This is sometimes needed for testing stdio streams, where the
setvbuf call in the test driver could interfere with the test.

ChangeLog
support/support_test_main.c
support/test-driver.c
support/test-driver.h

index 664928d5fe7c49d4af05503ac767d3e15bab8808..9843e137f5dd7bc0310f00b598837d2a5143b2ce 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2018-06-26  Florian Weimer  <fweimer@redhat.com>
+
+       * support/support_test_main.c (support_test_main): Only call
+       setvbuf if not disables.
+       * support/test-driver.c (main): Check TEST_NO_SETVBUF.
+       * support/test-driver.h (struct test_config): Add no_setvbuf member.
+
 2018-06-26  Florian Weimer  <fweimer@redhat.com>
 
        [BZ #23313]
index 396385729b6809adf4d06a2e26e5a76b33508e03..23429779aca85613d30eaca0e990b95372b00ac9 100644 (file)
@@ -270,7 +270,8 @@ support_test_main (int argc, char **argv, const struct test_config *config)
     timeout =  DEFAULT_TIMEOUT;
 
   /* Make sure we see all message, even those on stdout.  */
-  setvbuf (stdout, NULL, _IONBF, 0);
+  if (!config->no_setvbuf)
+    setvbuf (stdout, NULL, _IONBF, 0);
 
   /* Make sure temporary files are deleted.  */
   if (support_delete_temp_files != NULL)
index 09c8783e4f54d8094d6827aba704a55a23c8fb7e..9798f16227b9d46708c9800ab837925b36515846 100644 (file)
@@ -140,6 +140,10 @@ main (int argc, char **argv)
   test_config.no_mallopt = 1;
 #endif
 
+#ifdef TEST_NO_SETVBUF
+  test_config.no_setvbuf = 1;
+#endif
+
 #ifdef TIMEOUT
   test_config.timeout = TIMEOUT;
 #endif
index 1708d68d608ee4a497bcfcf95ef8ca3518ec53e3..549179b254946390d3765654f0c9dd811a460754 100644 (file)
@@ -35,6 +35,7 @@ struct test_config
   int expected_status;   /* Expected exit status.  */
   int expected_signal;   /* If non-zero, expect termination by signal.  */
   char no_mallopt;       /* Boolean flag to disable mallopt.  */
+  char no_setvbuf;       /* Boolean flag to disable setvbuf.  */
   const char *optstring; /* Short command line options.  */
 };
 
This page took 0.071064 seconds and 5 git commands to generate.