* testsuite/config-guess.sh: Re-indent with tabs.

* testsuite/config-sub.sh: Likewise.

Signed-off-by: Ben Elliston <bje@gnu.org>
This commit is contained in:
John Ericson 2018-08-02 21:19:03 +10:00 committed by Ben Elliston
parent 8de5d27282
commit f52be464ee
3 changed files with 46 additions and 41 deletions

View File

@ -1,3 +1,8 @@
2018-08-02 John Ericson <john.ericson@obsidian.systems>
* testsuite/config-guess.sh: Re-indent with tabs.
* testsuite/config-sub.sh: Likewise.
2018-08-02 Ben Elliston <bje@gnu.org> 2018-08-02 Ben Elliston <bje@gnu.org>
* config.guess: Fix SC2234 diagnostic from Shellcheck ("Remove * config.guess: Fix SC2234 diagnostic from Shellcheck ("Remove

View File

@ -13,14 +13,14 @@ PATH=$(pwd):$PATH
run_config_guess() run_config_guess()
{ {
rc=0 rc=0
while IFS='|' read -r machine release system version processor triplet ; do while IFS='|' read -r machine release system version processor triplet ; do
sed \ sed \
-e "s,@MACHINE@,$machine," \ -e "s,@MACHINE@,$machine," \
-e "s,@RELEASE@,$release," \ -e "s,@RELEASE@,$release," \
-e "s,@SYSTEM@,$system," \ -e "s,@SYSTEM@,$system," \
-e "s,@VERSION@,$version," \ -e "s,@VERSION@,$version," \
-e "s,@PROCESSOR@,$processor," > uname << EOF -e "s,@PROCESSOR@,$processor," > uname << EOF
#!/bin/sh #!/bin/sh
[ \$# -ne 1 ] && exec sh \$0 -s [ \$# -ne 1 ] && exec sh \$0 -s
[ \$1 = -m ] && echo "@MACHINE@" && exit 0 [ \$1 = -m ] && echo "@MACHINE@" && exit 0
@ -29,29 +29,29 @@ run_config_guess()
[ \$1 = -v ] && echo "@VERSION@" && exit 0 [ \$1 = -v ] && echo "@VERSION@" && exit 0
[ \$1 = -p ] && echo "@PROCESSOR@" && exit 0 [ \$1 = -p ] && echo "@PROCESSOR@" && exit 0
EOF EOF
chmod +x uname chmod +x uname
output=$(sh -eu ../config.guess 2>/dev/null) output=$(sh -eu ../config.guess 2>/dev/null)
if test $? != 0 ; then if test $? != 0 ; then
echo "FAIL: unable to guess $machine:$release:$system:$version" echo "FAIL: unable to guess $machine:$release:$system:$version"
rc=1 rc=1
continue continue
fi fi
if test "$output" != "$triplet" ; then if test "$output" != "$triplet" ; then
echo "FAIL: $output (expected $triplet)" echo "FAIL: $output (expected $triplet)"
rc=1 rc=1
continue continue
fi fi
$verbose && echo "PASS: $triplet" $verbose && echo "PASS: $triplet"
done done
return $rc return $rc
} }
if sed 's, | ,|,g' < config-guess.data | run_config_guess ; then if sed 's, | ,|,g' < config-guess.data | run_config_guess ; then
numtests=$(wc -l config-guess.data | cut -d' ' -f1) numtests=$(wc -l config-guess.data | cut -d' ' -f1)
$verbose || echo "PASS: config.guess checks ($numtests tests)" $verbose || echo "PASS: config.guess checks ($numtests tests)"
else else
echo "Unexpected failures." echo "Unexpected failures."
exit 1 exit 1
fi fi
exit 0 exit 0

View File

@ -13,24 +13,24 @@ verbose=false
run_config_sub() run_config_sub()
{ {
rc=0 rc=0
while read -r alias canonical ; do while read -r alias canonical ; do
output=$(sh -eu ../config.sub "$alias") output=$(sh -eu ../config.sub "$alias")
if test "$output" != "$canonical" ; then if test "$output" != "$canonical" ; then
echo "FAIL: $alias -> $output, but expected $canonical" echo "FAIL: $alias -> $output, but expected $canonical"
rc=1 rc=1
else else
$verbose && echo "PASS: $alias" $verbose && echo "PASS: $alias"
fi fi
done < config-sub.data done < config-sub.data
return $rc return $rc
} }
if run_config_sub ; then if run_config_sub ; then
numtests=$(wc -l config-sub.data | cut -d' ' -f1) numtests=$(wc -l config-sub.data | cut -d' ' -f1)
$verbose || echo "PASS: config.sub checks ($numtests tests)" $verbose || echo "PASS: config.sub checks ($numtests tests)"
else else
exit 1 exit 1
fi fi
exit 0 exit 0