config/testsuite/config-sub.sh
Ben Elliston cccd1d0ab7 * testsuite/config-sub.sh (run_config-sub): Quote some variables
to avoid spurious shell errors when a test case fails.
2014-04-03 11:08:57 +11:00

34 lines
743 B
Bash

#!/bin/sh
#
# Copyright 2004, 2005, 2009, 2014 Free Software Foundation, Inc.
# Contributed by Ben Elliston <bje@gnu.org>.
#
# This test reads pairs from config-sub.data: an alias and its
# canonical triplet. The config.sub scripts is invoked and the test
# checks that the alias expands to the expected canonical triplet.
verbose=false
run_config_sub ()
{
rc=0
while read alias canonical ; do
output=`sh ../config.sub $alias`
if test "$output" != "$canonical" ; then
echo "FAIL: $alias -> $output, but expected $canonical"
rc=1
else
$verbose && echo "PASS: $alias"
fi
done < config-sub.data
return $rc
}
if run_config_sub ; then
$verbose || echo "PASS: config.sub checks"
else
exit 1
fi
exit 0