Skip to content

Commit dd29d2e

Browse files
committed
Disable output buffering in tests_exhaustive.c
1 parent ee8b816 commit dd29d2e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/tests_exhaustive.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,14 @@ int main(int argc, char** argv) {
353353
unsigned char rand32[32];
354354
secp256k1_context *ctx;
355355

356+
/* Disable buffering for stdout to improve reliability of getting
357+
* diagnostic information. Happens right at the start of main because
358+
* setbuf must be used before any other operation on the stream. */
359+
setbuf(stdout, NULL);
360+
/* Also disable buffering for stderr because it's not guaranteed that it's
361+
* unbuffered on all systems. */
362+
setbuf(stderr, NULL);
363+
356364
/* find iteration count */
357365
if (argc > 1) {
358366
count = strtol(argv[1], NULL, 0);

0 commit comments

Comments
 (0)