From 5a22b156fac945ed03503b12ebfda4cc9e80772d Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 30 Jan 2020 14:49:10 +0300 Subject: Swap order of matching command stdout and stderr by testscript runner --- libbuild2/test/script/runner.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libbuild2/test/script/runner.cxx b/libbuild2/test/script/runner.cxx index 181c5ce..7ba25a6 100644 --- a/libbuild2/test/script/runner.cxx +++ b/libbuild2/test/script/runner.cxx @@ -2014,11 +2014,15 @@ namespace build2 // expectations. Note that stdout is only redirected to file for the // last command in the pipeline. // + // The thinking behind matching stderr first is that if it mismatches, + // then the program probably misbehaves (executes wrong functionality, + // etc) in which case its stdout doesn't really matter. + // if (success) success = + check_output (pr, esp, isp, err, ll, sp, diag, "stderr") && (!last || - check_output (pr, osp, isp, out, ll, sp, diag, "stdout")) && - check_output (pr, esp, isp, err, ll, sp, diag, "stderr"); + check_output (pr, osp, isp, out, ll, sp, diag, "stdout")); return success; } -- cgit v1.1