From 32d5bd9cecbec16ccfa3115a754077eadb06ac25 Mon Sep 17 00:00:00 2001 From: Ben Elliston Date: Sat, 19 May 2018 18:34:15 +1000 Subject: [PATCH] * testsuite/config-guess.sh: Set -eu for robustness. Run config.guess under `sh -e' to catch more problems. * testsuite/config-sub.sh: Run config.sub under `sh -eu'. --- ChangeLog | 6 ++++++ testsuite/config-guess.sh | 9 +++++---- testsuite/config-sub.sh | 8 +++++--- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1c6bdb9..4b8b30a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2018-05-19 Ben Elliston + + * testsuite/config-guess.sh: Set -eu for robustness. Run + config.guess under `sh -e' to catch more problems. + * testsuite/config-sub.sh: Run config.sub under `sh -eu'. + 2018-05-19 John Ericson * config.sub: Cordon off single component aliases. diff --git a/testsuite/config-guess.sh b/testsuite/config-guess.sh index a160cf6..9a6a1f4 100644 --- a/testsuite/config-guess.sh +++ b/testsuite/config-guess.sh @@ -1,12 +1,13 @@ -#!/bin/sh +#!/bin/bash # -# Copyright 2004, 2005, 2009, 2012, 2015 Free Software Foundation, -# Inc. +# Copyright 2004, 2005, 2009, 2012, 2015, 2018 Free Software +# Foundation, Inc. # Contributed by Ben Elliston . # # This test reads 5-tuples from config-guess.data: the components of # the simulated uname(1) output and the expected GNU system triplet. +set -eu verbose=false PATH=$(pwd):$PATH @@ -29,7 +30,7 @@ run_config_guess() [ \$1 = -p ] && echo "@PROCESSOR@" && exit 0 EOF chmod +x uname - output=$(../config.guess 2>/dev/null) + output=$(sh -e ../config.guess 2>/dev/null) if test $? != 0 ; then echo "FAIL: unable to guess $machine:$release:$system:$version" rc=1 diff --git a/testsuite/config-sub.sh b/testsuite/config-sub.sh index d6186ce..c5b09f6 100644 --- a/testsuite/config-sub.sh +++ b/testsuite/config-sub.sh @@ -1,19 +1,21 @@ -#!/bin/sh +#!/bin/bash # -# Copyright 2004, 2005, 2009, 2014 Free Software Foundation, Inc. +# Copyright 2004, 2005, 2009, 2014, 2018 Free Software Foundation, +# Inc. # Contributed by Ben Elliston . # # This test reads pairs from config-sub.data: an alias and its # canonical triplet. config.sub is invoked and the test checks that # the alias expands to the expected canonical triplet. +set -eu verbose=false run_config_sub() { rc=0 while read -r alias canonical ; do - output=$(../config.sub "$alias") + output=$(sh -eu ../config.sub "$alias") if test "$output" != "$canonical" ; then echo "FAIL: $alias -> $output, but expected $canonical" rc=1