From b585beda76b1819e81cf5cb739dc832ca3256c3e Mon Sep 17 00:00:00 2001 From: Ben Elliston Date: Fri, 25 Jun 2004 12:13:44 +0000 Subject: [PATCH] * Makefile (check): New target. * testsuite/config-sub.sh: New test. * testsuite/config-sub.data: New file. --- ChangeLog | 6 ++++++ Makefile | 3 +++ testsuite/config-sub.data | 1 + testsuite/config-sub.sh | 28 ++++++++++++++++++++++++++++ 4 files changed, 38 insertions(+) create mode 100644 testsuite/config-sub.data create mode 100644 testsuite/config-sub.sh diff --git a/ChangeLog b/ChangeLog index eeb3308..66eda95 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-06-25 Ben Elliston + + * Makefile (check): New target. + * testsuite/config-sub.sh: New test. + * testsuite/config-sub.data: New file. + 2004-06-24 Ben Elliston * config.guess: Update copyright years. diff --git a/Makefile b/Makefile index 466cc8a..8020efb 100644 --- a/Makefile +++ b/Makefile @@ -11,3 +11,6 @@ upload: cp config.guess.directive.asc config.sub.directive.asc ftp -a -u $(UPLOAD) config.{guess,sub}{,.sig,.directive.asc} rm config.{guess,sub}{.sig,.directive.asc} + +check: + cd testsuite && sh config-sub.sh diff --git a/testsuite/config-sub.data b/testsuite/config-sub.data new file mode 100644 index 0000000..16b077d --- /dev/null +++ b/testsuite/config-sub.data @@ -0,0 +1 @@ +sun4 sparc-sun-sunos4.1.1 diff --git a/testsuite/config-sub.sh b/testsuite/config-sub.sh new file mode 100644 index 0000000..7b3b666 --- /dev/null +++ b/testsuite/config-sub.sh @@ -0,0 +1,28 @@ +#!/bin/sh +# +# Copyright 2004 Free Software Foundation, Inc. +# Contributed by Ben Elliston . +# +# 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 +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 + +if test $rc -eq 0 ; then + $verbose || echo "PASS: config.sub checks" +else + test $rc -eq 1 && echo "Unexpected failures." +fi + +exit $rc