From ddc5f38befe62a5d2334c4e8fd1a8439d39c2318 Mon Sep 17 00:00:00 2001 From: Ben Elliston Date: Sun, 22 Aug 2004 07:37:36 +0000 Subject: [PATCH] * Makefile (check): Run config-guess.sh tests as well. * testsuite/config-guess.sh: New test. * testsuite/config-guess.data: New file. * testsuite/uname.in: Likewise. * testsuite/config-sub.data (amd64-unknown-freebsd5.2): New case. --- ChangeLog | 8 ++++++++ Makefile | 2 +- testsuite/config-guess.data | 1 + testsuite/config-guess.sh | 41 +++++++++++++++++++++++++++++++++++++ testsuite/config-sub.data | 37 +++++++++++++++++---------------- testsuite/uname.in | 9 ++++++++ 6 files changed, 79 insertions(+), 19 deletions(-) create mode 100644 testsuite/config-guess.data create mode 100644 testsuite/config-guess.sh create mode 100755 testsuite/uname.in diff --git a/ChangeLog b/ChangeLog index 726234b..6eca236 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-08-22 Ben Elliston + + * Makefile (check): Run config-guess.sh tests as well. + * testsuite/config-guess.sh: New test. + * testsuite/config-guess.data: New file. + * testsuite/uname.in: Likewise. + * testsuite/config-sub.data (amd64-unknown-freebsd5.2): New case. + 2004-08-13 Brad Smith * config.guess (*:OpenBSD:*:*): Remove defunct MIPS machines. diff --git a/Makefile b/Makefile index 8020efb..b718878 100644 --- a/Makefile +++ b/Makefile @@ -13,4 +13,4 @@ upload: rm config.{guess,sub}{.sig,.directive.asc} check: - cd testsuite && sh config-sub.sh + cd testsuite && (sh config-sub.sh; sh config-guess.sh) && rm uname diff --git a/testsuite/config-guess.data b/testsuite/config-guess.data new file mode 100644 index 0000000..46de12f --- /dev/null +++ b/testsuite/config-guess.data @@ -0,0 +1 @@ +i386 1.6 NetBSD GENERIC i386-unknown-netbsdelf1.6 diff --git a/testsuite/config-guess.sh b/testsuite/config-guess.sh new file mode 100644 index 0000000..53e82ef --- /dev/null +++ b/testsuite/config-guess.sh @@ -0,0 +1,41 @@ +#!/bin/sh +# +# Copyright 2004 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. + +verbose=false +rc=0 +export PATH=`pwd`:$PATH +IFS=" " # tab + +while read machine release system version triplet ; do + sed \ + -e "s/@MACHINE@/$machine/" \ + -e "s/@RELEASE@/$release/" \ + -e "s/@SYSTEM@/$system/" \ + -e "s/@VERSION@/$version/" < uname.in > uname + chmod +x uname + output=`sh ../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 < config-guess.data + +if test $rc -eq 0 ; then + $verbose || echo "PASS: config.guess checks" +else + test $rc -eq 1 && echo "Unexpected failures." +fi + +exit $rc diff --git a/testsuite/config-sub.data b/testsuite/config-sub.data index bc5c5fa..bda6691 100644 --- a/testsuite/config-sub.data +++ b/testsuite/config-sub.data @@ -1,18 +1,19 @@ -arm-coff arm-unknown-coff -arm-elf arm-unknown-elf -sun3 m68k-sun-sunos4.1.1 -sun4 sparc-sun-sunos4.1.1 -ibm i370-ibm-aix -i386-os2 i386-pc-os2 -os400 powerpc-ibm-os400 -mmix mmix-knuth-mmixware -mmix-elf mmix-knuth-elf -i386-linux i386-pc-linux-gnu -i386-netbsd i386-pc-netbsd -i386-openbsd i386-pc-openbsd -i386-freebsd i386-pc-freebsd -i386-elf i386-pc-elf -i486-elf i486-pc-elf -i586-elf i586-pc-elf -i686-elf i686-pc-elf -i786-elf i786-pc-elf +arm-coff arm-unknown-coff +arm-elf arm-unknown-elf +sun3 m68k-sun-sunos4.1.1 +sun4 sparc-sun-sunos4.1.1 +ibm i370-ibm-aix +i386-os2 i386-pc-os2 +os400 powerpc-ibm-os400 +mmix mmix-knuth-mmixware +mmix-elf mmix-knuth-elf +i386-linux i386-pc-linux-gnu +i386-netbsd i386-pc-netbsd +i386-openbsd i386-pc-openbsd +i386-freebsd i386-pc-freebsd +i386-elf i386-pc-elf +i486-elf i486-pc-elf +i586-elf i586-pc-elf +i686-elf i686-pc-elf +i786-elf i786-pc-elf +amd64-unknown-freebsd5.2 x86_64-unknown-freebsd5.2 diff --git a/testsuite/uname.in b/testsuite/uname.in new file mode 100755 index 0000000..d44d15f --- /dev/null +++ b/testsuite/uname.in @@ -0,0 +1,9 @@ +#!/bin/sh +# uname(1) simulator, inspired by Pavel Roskin. + +[ $# -ne 1 ] && exec sh $0 -s +[ $1 = -m ] && echo "@MACHINE@" && exit 0 +[ $1 = -r ] && echo "@RELEASE@" && exit 0 +[ $1 = -s ] && echo "@SYSTEM@" && exit 0 +[ $1 = -v ] && echo "@VERSION@" && exit 0 +[ $1 = -p ] && echo "Pentium III(TM)-ISA/PCI"