[v2] devtools: fix meson build test to exit on failure

Message ID 20190312101828.18817-1-bruce.richardson@intel.com (mailing list archive)
State Accepted, archived
Headers
Series [v2] devtools: fix meson build test to exit on failure |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/intel-Performance-Testing success Performance Testing PASS
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/Intel-compilation success Compilation OK

Commit Message

Bruce Richardson March 12, 2019, 10:18 a.m. UTC
  When piping the ninja command through cat, we lose the error value from
the call to ninja in the case of failure. This prevents the script from
exiting at the first broken build. Fix this by setting the "pipefail"
shell option.

Fixes: 4bcb9b768604 ("devtools: add verbose option to meson build test")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
V2: fix typo in commit message

 devtools/test-meson-builds.sh | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Thomas Monjalon March 13, 2019, 10:03 a.m. UTC | #1
12/03/2019 11:18, Bruce Richardson:
> When piping the ninja command through cat, we lose the error value from
> the call to ninja in the case of failure. This prevents the script from
> exiting at the first broken build. Fix this by setting the "pipefail"
> shell option.
> 
> Fixes: 4bcb9b768604 ("devtools: add verbose option to meson build test")
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

Applied, thanks
  

Patch

diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index f82a0fd6c..9f5620583 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -7,6 +7,8 @@ 
 # * if a build-directory already exists we assume it was properly configured
 # Run ninja after configuration is done.
 
+set -o pipefail
+
 srcdir=$(dirname $(readlink -f $0))/..
 MESON=${MESON:-meson}
 use_shared="--default-library=shared"