summaryrefslogtreecommitdiff
path: root/package/gnuconfig/testsuite
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-08-04 22:42:34 +0000
committerMike Frysinger <vapier@gentoo.org>2005-08-04 22:42:34 +0000
commit105c3483b5e01184eceb2eb9ddd59dfd4dc5054f (patch)
tree91703f9d8b526cbcf7e7611ad843177552c4b8d4 /package/gnuconfig/testsuite
parent1a48268a55175b4efa751c1a22fb4d977ea8b326 (diff)
add support for fetching latest config.{sub,guess} files from config cvs
Diffstat (limited to 'package/gnuconfig/testsuite')
-rw-r--r--package/gnuconfig/testsuite/.cvsignore1
-rw-r--r--package/gnuconfig/testsuite/CVS/Entries7
-rw-r--r--package/gnuconfig/testsuite/CVS/Repository1
-rw-r--r--package/gnuconfig/testsuite/CVS/Root1
-rw-r--r--package/gnuconfig/testsuite/config-guess.data14
-rw-r--r--package/gnuconfig/testsuite/config-guess.sh47
-rw-r--r--package/gnuconfig/testsuite/config-sub.data72
-rw-r--r--package/gnuconfig/testsuite/config-sub.sh35
-rwxr-xr-xpackage/gnuconfig/testsuite/uname.in9
9 files changed, 187 insertions, 0 deletions
diff --git a/package/gnuconfig/testsuite/.cvsignore b/package/gnuconfig/testsuite/.cvsignore
new file mode 100644
index 000000000..e4dcdcfaf
--- /dev/null
+++ b/package/gnuconfig/testsuite/.cvsignore
@@ -0,0 +1 @@
+uname
diff --git a/package/gnuconfig/testsuite/CVS/Entries b/package/gnuconfig/testsuite/CVS/Entries
new file mode 100644
index 000000000..541e14493
--- /dev/null
+++ b/package/gnuconfig/testsuite/CVS/Entries
@@ -0,0 +1,7 @@
+/config-guess.data/1.15/Thu Aug 4 14:15:16 2005//
+/config-guess.sh/1.4/Thu Aug 4 14:15:16 2005//
+/config-sub.data/1.23/Thu Aug 4 14:15:16 2005//
+/config-sub.sh/1.2/Thu Aug 4 14:15:16 2005//
+/uname.in/1.1/Thu Aug 4 14:15:16 2005//
+/.cvsignore/1.1/Thu Aug 4 22:41:55 2005//
+D
diff --git a/package/gnuconfig/testsuite/CVS/Repository b/package/gnuconfig/testsuite/CVS/Repository
new file mode 100644
index 000000000..5337292ad
--- /dev/null
+++ b/package/gnuconfig/testsuite/CVS/Repository
@@ -0,0 +1 @@
+config/testsuite
diff --git a/package/gnuconfig/testsuite/CVS/Root b/package/gnuconfig/testsuite/CVS/Root
new file mode 100644
index 000000000..e46e7dd1b
--- /dev/null
+++ b/package/gnuconfig/testsuite/CVS/Root
@@ -0,0 +1 @@
+:ext:anoncvs@savannah.gnu.org:/cvsroot/config
diff --git a/package/gnuconfig/testsuite/config-guess.data b/package/gnuconfig/testsuite/config-guess.data
new file mode 100644
index 000000000..ecf58eaf3
--- /dev/null
+++ b/package/gnuconfig/testsuite/config-guess.data
@@ -0,0 +1,14 @@
+crisv32 2.6.6 Linux ignored crisv32-axis-linux-gnu
+frv 2.4.24 Linux ignored frv-unknown-linux-gnu
+3 2.3.3 XENIX SysV i386-pc-xenix
+2064 ignored z/VM ignored s390-ibm-zvmoe
+amd64 1.5.12(0.116/4/2) CYGWIN_NT-5.2 ignored x86_64-unknown-cygwin
+crayx1 2.5.20 UNICOS/mp ignored craynv-cray-unicosmp2.5.X
+NSE-N 1.0 NONSTOP_KERNEL ignored nse-tandem-nsk1.0
+i386 ignored VOS ignored i386-stratus-vos
+arm ignored RISCOS ignored arm-unknown-riscos
+arm ignored riscos ignored arm-unknown-riscos
+i586 5.0.0 skyos ignored i586-pc-skyos5.0.0
+i786-pc ignored windows32 ignored i786-pc-mingw32
+or32 ignored Linux ignored or32-unknown-linux-gnu
+x86_64 1.5.18(0.132/4/2) CYGWIN_NT-5.2 ignored x86_64-unknown-cygwin
diff --git a/package/gnuconfig/testsuite/config-guess.sh b/package/gnuconfig/testsuite/config-guess.sh
new file mode 100644
index 000000000..3f5103080
--- /dev/null
+++ b/package/gnuconfig/testsuite/config-guess.sh
@@ -0,0 +1,47 @@
+#!/bin/sh
+#
+# Copyright 2004, 2005 Free Software Foundation, Inc.
+# Contributed by Ben Elliston <bje@gnu.org>.
+#
+# 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
+export PATH=`pwd`:$PATH
+IFS=" " # tab
+
+function run_config_guess ()
+{
+ rc=0
+ 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
+ return $rc
+}
+
+sed 's/ */ /g' < config-guess.data | run_config_guess
+rc=$?
+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/package/gnuconfig/testsuite/config-sub.data b/package/gnuconfig/testsuite/config-sub.data
new file mode 100644
index 000000000..ddc56c171
--- /dev/null
+++ b/package/gnuconfig/testsuite/config-sub.data
@@ -0,0 +1,72 @@
+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
+cris-linux cris-axis-linux-gnu
+crisv32-linux crisv32-axis-linux-gnu
+frv-linux frv-unknown-linux-gnu
+djgpp i586-pc-msdosdjgpp
+s390-ibm-zvmoe s390-ibm-zvmoe
+xscale xscale-unknown-none
+xscaleeb xscaleeb-unknown-none
+xscaleel xscaleel-unknown-none
+xbox i686-pc-mingw32
+maxq maxq-unknown-none
+maxq-elf maxq-unknown-elf
+amd64-cygwin x86_64-pc-cygwin
+x86_64-cygwin x86_64-pc-cygwin
+sparc64-linux sparc64-unknown-linux-gnu
+sparc64b-linux sparc64b-unknown-linux-gnu
+bfin-elf bfin-unknown-elf
+bfin bfin-unknown-none
+arm-riscos arm-unknown-riscos
+arm-unknown-riscos arm-unknown-riscos
+i586-skyos i586-pc-skyos
+m32c m32c-unknown-none
+m32c-elf m32c-unknown-elf
+ms1 ms1-unknown-none
+ms1-elf ms1-unknown-elf
+mips64vr5900-elf mips64vr5900-unknown-elf
+mips64vr5900el-elf mips64vr5900el-unknown-elf
+mips64vr5900 mips64vr5900-unknown-elf
+mips64vr5900el mips64vr5900el-unknown-elf
+sh64 sh64-unknown-none
+sh64-elf sh64-unknown-elf
+openrisc-linux or32-unknown-linux-gnu
+or32-linux or32-unknown-linux-gnu
+sh-elf sh-unknown-elf
+sh1-elf sh1-unknown-elf
+sh2-elf sh2-unknown-elf
+sh3-elf sh3-unknown-elf
+sh4-elf sh4-unknown-elf
+sh2a-elf sh2a-unknown-elf
+sh4a-elf sh4a-unknown-elf
+sh2e-elf sh2e-unknown-elf
+sh3e-elf sh3e-unknown-elf
+sh3eb-elf sh3eb-unknown-elf
+sh4eb-elf sh4eb-unknown-elf
+shbe-elf shbe-unknown-elf
+shle-elf shle-unknown-elf
+sh1le-elf sh1le-unknown-elf
+sh2le-elf sh2le-unknown-elf
+sh3le-elf sh3le-unknown-elf
+sh4le-elf sh4le-unknown-elf
+sh3ele-elf sh3ele-unknown-elf
+i386-haiku i386-pc-haiku
+sparc-haiku sparc-unknown-haiku
+powerpc-haiku powerpc-unknown-haiku
diff --git a/package/gnuconfig/testsuite/config-sub.sh b/package/gnuconfig/testsuite/config-sub.sh
new file mode 100644
index 000000000..03b642010
--- /dev/null
+++ b/package/gnuconfig/testsuite/config-sub.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+#
+# Copyright 2004, 2005 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
+
+function 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
+}
+
+run_config_sub
+rc=$?
+if test $rc -eq 0 ; then
+ $verbose || echo "PASS: config.sub checks"
+else
+ test $rc -eq 1 && echo "Unexpected failures."
+fi
+
+exit $rc
diff --git a/package/gnuconfig/testsuite/uname.in b/package/gnuconfig/testsuite/uname.in
new file mode 100755
index 000000000..d44d15f04
--- /dev/null
+++ b/package/gnuconfig/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"