From 38f39568eee13223d4e132354e6da90152f9326b Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 16 May 2008 14:35:04 +1000 Subject: [PATCH] Fix test to flush stdout: sometimes goes into pipe, causing failure. --- tap/test/run.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tap/test/run.c b/tap/test/run.c index 91f22e91..97af45c8 100644 --- a/tap/test/run.c +++ b/tap/test/run.c @@ -52,6 +52,7 @@ int main(int argc, char *argv[]) int stdoutfd; printf("1..1\n"); + fflush(stdout); stderrfd = dup(STDERR_FILENO); if (stderrfd < 0) err(1, "dup of stderr failed"); @@ -74,21 +75,21 @@ int main(int argc, char *argv[]) ok(0, "msg2"); expect(p[0], "not ok 2 - msg2\n" - "# Failed test (tap/test/run.c:main() at line 75)\n"); + "# Failed test (tap/test/run.c:main() at line 76)\n"); ok1(true); expect(p[0], "ok 3 - true\n"); ok1(false); expect(p[0], "not ok 4 - false\n" - "# Failed test (tap/test/run.c:main() at line 82)\n"); + "# Failed test (tap/test/run.c:main() at line 83)\n"); pass("passed"); expect(p[0], "ok 5 - passed\n"); fail("failed"); expect(p[0], "not ok 6 - failed\n" - "# Failed test (tap/test/run.c:main() at line 89)\n"); + "# Failed test (tap/test/run.c:main() at line 90)\n"); skip(2, "skipping %s", "test"); expect(p[0], "ok 7 # skip skipping test\n" @@ -97,7 +98,7 @@ int main(int argc, char *argv[]) todo_start("todo"); ok1(false); expect(p[0], "not ok 9 - false # TODO todo\n" - "# Failed (TODO) test (tap/test/run.c:main() at line 98)\n"); + "# Failed (TODO) test (tap/test/run.c:main() at line 99)\n"); ok1(true); expect(p[0], "ok 10 - true # TODO todo\n"); todo_end(); -- 2.39.2