This change introduces a new test to config-sub.sh which runs every

config.guess expected triplet through config.sub so that we can check
that it is properly recognised. Sometimes, new triplets have been
added to config.guess without updating config.sub accordingly (eg,
Harris NightHawk machines running PowerUnix from the mid-1990s!)

	* config.sub (case $os): Match nsk* and powerunix. Don't later
	match nsk* and set os=nsk which removes the OS version number.
	* testsuite/config-guess.data: Tweak Unleashed test case.
	* testsuite/config-sub.sh (run_config_sub_with_guess_triplets):
	New test.
This commit is contained in:
Ben Elliston 2019-06-30 16:32:41 +10:00
parent 854aa79378
commit d3bfe62ac8
4 changed files with 30 additions and 6 deletions

View File

@ -1,3 +1,11 @@
2019-06-30 Ben Elliston <bje@gnu.org>
* config.sub (case $os): Match nsk* and powerunix. Don't later
match nsk* and set os=nsk which removes the OS version number.
* testsuite/config-guess.data: Tweak Unleashed test case.
* testsuite/config-sub.sh (run_config_sub_with_guess_triplets):
New test.
2019-06-30 Ben Elliston <bje@gnu.org>
* config.sub: Recognise os108*.

6
config.sub vendored
View File

@ -1365,7 +1365,8 @@ case $os in
| powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
| skyos* | haiku* | rdos* | toppers* | drops* | es* \
| onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
| midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi*)
| midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
| nsk* | powerunix)
# Remember, each alternative MUST END IN *, to match a version number.
;;
qnx*)
@ -1449,9 +1450,6 @@ case $os in
ns2)
os=nextstep2
;;
nsk*)
os=nsk
;;
# Preserve the version number of sinix5.
sinix5.*)
os=`echo $os | sed -e 's|sinix|sysv|'`

View File

@ -2,7 +2,6 @@
3 | 2.3.3 | XENIX | SysV | ignored | i386-pc-xenix
aarch64_be | ignored | Linux | ignored | ignored | aarch64_be-unknown-linux-gnu
aarch64 | ignored | Linux | ignored | ignored | aarch64-unknown-linux-gnu
amd64 | 1.1 | Unleashed | ignored | ignored | amd64-unknown-unleashed1.1
amd64 | 1.5.12(0.116/4/2) | CYGWIN_NT-5.2 | ignored | ignored | x86_64-pc-cygwin
amd64 | 6.1.4 | NetBSD | ignored | x86_64 | x86_64-unknown-netbsd6.1
amd64 | 6.1.5_PATCH | NetBSD | ignored | x86_64 | x86_64-unknown-netbsd6.1
@ -118,4 +117,5 @@ x86_64 | 2.0.0(0.271/5/3) | MSYS_NT-6.1 | ignored | ignored | x86_64-pc-msys
x86_64 | 2.6.32 | Linux | ignored | ignored | x86_64-pc-linux-gnu
x86_64 | 2.6.32 | VMkernel | ignored | ignored | x86_64-unknown-esx
x86_64 | 8.0 | OS108 | ignored | ignored | x86_64-unknown-os108_8.0
x86_64 | 1.1 | Unleashed | ignored | ignored | x86_64-unknown-unleashed1.1
xtensa | 2.6.15 | Linux | ignored | ignored | xtensa-unknown-linux-gnu

View File

@ -88,10 +88,28 @@ run_config_sub_idempotent()
return $rc
}
run_config_sub_with_guess_triplets()
{
local -i rc=0
numtests=0
name="canonicalise each config.guess testcase"
awk -F '|' '{ print $6 }' < config-guess.data | while read -r triplet ; do
output=$(sh -eu ../config.sub "$triplet")
if test "$triplet" != "$output" ; then
echo "FAIL: $triplet -> $output, but $triplet should map to itself"
rc=1
fi
numtests+=1
done
return $rc
}
declare -i rc=0 numtests
declare name
for testsuite in run_config_sub run_config_sub_idempotent ; do
for testsuite in run_config_sub run_config_sub_idempotent run_config_sub_with_guess_triplets ; do
if $testsuite; then
$verbose || echo "PASS: config.sub $name ($numtests tests)"
else