From 830240bc527331c9b4998810b50a3cd6c57f9f60 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 24 Nov 2022 12:20:02 +0300 Subject: Fix forcing diag buffering for diff in simple test --- libbuild2/test/rule.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libbuild2/test/rule.cxx b/libbuild2/test/rule.cxx index 5992414..0ee7641 100644 --- a/libbuild2/test/rule.cxx +++ b/libbuild2/test/rule.cxx @@ -692,9 +692,11 @@ namespace build2 for (next++; *next != nullptr; next++) ; next++; + bool last (*next == nullptr); + // Redirect stdout to a pipe unless we are last. // - int out (*next != nullptr ? -1 : ofd); + int out (last ? ofd : -1); // Propagate the pointer to the left-most program. // @@ -704,7 +706,7 @@ namespace build2 // pipe_process pp (t.ctx, args, - next == nullptr && ofd == 2, + last && ofd == 2, prev, prev != nullptr ? prev->next : nullptr); @@ -1023,7 +1025,7 @@ namespace build2 } })); - if (*next != nullptr) + if (!last) run_test (t, next, ofd, deadline, &pp); // Complete the pipeline execution, if not done yet. -- cgit v1.1