cleanup inlines
[buildroot.git] / package / gnuconfig / testsuite / config-guess.sh
blob324f275e380b38d854c4f675deb61afd76484cc6
1 #!/bin/sh
3 # Copyright 2004, 2005 Free Software Foundation, Inc.
4 # Contributed by Ben Elliston <bje@gnu.org>.
6 # This test reads 5-tuples from config-guess.data: the components of
7 # the simulated uname(1) output and the expected GNU system triplet.
9 verbose=false
10 export PATH=`pwd`:$PATH
11 IFS=" " # tab
13 run_config_guess ()
15 rc=0
16 while read machine release system version triplet ; do
17 sed \
18 -e "s,@MACHINE@,$machine," \
19 -e "s,@RELEASE@,$release," \
20 -e "s,@SYSTEM@,$system," \
21 -e "s,@VERSION@,$version," < uname.in > uname
22 chmod +x uname
23 output=`sh ../config.guess 2>/dev/null`
24 if test $? != 0 ; then
25 echo "FAIL: unable to guess $machine:$release:$system:$version"
26 rc=1
27 continue
29 if test $output != $triplet ; then
30 echo "FAIL: $output (expected $triplet)"
31 rc=1
32 continue
34 $verbose && echo "PASS: $triplet"
35 done
36 return $rc
39 sed 's/ */ /g' < config-guess.data | run_config_guess
40 rc=$?
41 if test $rc -eq 0 ; then
42 $verbose || echo "PASS: config.guess checks"
43 else
44 test $rc -eq 1 && echo "Unexpected failures."
47 exit $rc