From patchwork Tue Jun 26 10:31:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 28047 Received: (qmail 41765 invoked by alias); 26 Jun 2018 10:31:56 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 41689 invoked by uid 89); 26 Jun 2018 10:31:45 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=sk:support, termination, Hx-languages-length:1814, interfere X-HELO: mx1.redhat.com Date: Tue, 26 Jun 2018 12:31:42 +0200 To: libc-alpha@sourceware.org Subject: [PATCH COMMITTED] support: Add TEST_NO_SETVBUF User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Message-Id: <20180626103142.1A87943994575@oldenburg.str.redhat.com> From: fweimer@redhat.com (Florian Weimer) This is sometimes needed for testing stdio streams, where the setvbuf call in the test driver could interfere with the test. 2018-06-26 Florian Weimer * 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. diff --git a/support/support_test_main.c b/support/support_test_main.c index 396385729b..23429779ac 100644 --- a/support/support_test_main.c +++ b/support/support_test_main.c @@ -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) diff --git a/support/test-driver.c b/support/test-driver.c index 09c8783e4f..9798f16227 100644 --- a/support/test-driver.c +++ b/support/test-driver.c @@ -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 diff --git a/support/test-driver.h b/support/test-driver.h index 1708d68d60..549179b254 100644 --- a/support/test-driver.h +++ b/support/test-driver.h @@ -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. */ };