* 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>
* config.guess: Fix SC2234 diagnostic from Shellcheck ("Remove

View File

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

View File

@ -13,24 +13,24 @@ verbose=false
run_config_sub()
{
rc=0
while read -r alias canonical ; do
output=$(sh -eu ../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
rc=0
while read -r alias canonical ; do
output=$(sh -eu ../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
numtests=$(wc -l config-sub.data | cut -d' ' -f1)
$verbose || echo "PASS: config.sub checks ($numtests tests)"
numtests=$(wc -l config-sub.data | cut -d' ' -f1)
$verbose || echo "PASS: config.sub checks ($numtests tests)"
else
exit 1
exit 1
fi
exit 0