| 1 | #!/bin/sh |
| 2 | # This would provoke an infloop with source from 4.2+ (cvs as of 2007-01-19). |
| 3 | |
| 4 | # Copyright (C) 2007-2020 Free Software Foundation, Inc. |
| 5 | |
| 6 | # This program is free software; you can redistribute it and/or modify |
| 7 | # it under the terms of the GNU General Public License as published by |
| 8 | # the Free Software Foundation; either version 3 of the License, or |
| 9 | # (at your option) any later version. |
| 10 | |
| 11 | # This program is distributed in the hope that it will be useful, |
| 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | # GNU General Public License for more details. |
| 15 | |
| 16 | # You should have received a copy of the GNU General Public License |
| 17 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 18 | |
| 19 | if test "$VERBOSE" = yes; then |
| 20 | set -x |
| 21 | mkid --version |
| 22 | aid --version |
| 23 | fi |
| 24 | |
| 25 | pwd=`pwd` |
| 26 | t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$ |
| 27 | trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0 |
| 28 | trap '(exit $?); exit $?' 1 2 13 15 |
| 29 | |
| 30 | framework_failure=0 |
| 31 | mkdir -p $tmp || framework_failure=1 |
| 32 | cd $tmp || framework_failure=1 |
| 33 | echo 'boo[! bar[]' > f.el || framework_failure=1 |
| 34 | |
| 35 | # FIXME: The expected output should probably be these two lines: |
| 36 | # bar |
| 37 | # boo[] |
| 38 | # but the code to handle that (now-disabled) did a double-ungetc. |
| 39 | cat <<EOF > exp || framework_failure=1 # expect no output |
| 40 | bar |
| 41 | boo |
| 42 | EOF |
| 43 | |
| 44 | if test $framework_failure = 1; then |
| 45 | echo "$0: failure in testing framework" 1>&2 |
| 46 | (exit 1); exit 1 |
| 47 | fi |
| 48 | |
| 49 | fail=0 |
| 50 | |
| 51 | lang_map="$abs_top_srcdir/libidu/id-lang.map" |
| 52 | mkid -m "$lang_map" f.el > out || fail=1 |
| 53 | aid -R none b >> out || fail=1 |
| 54 | |
| 55 | cmp out exp || fail=1 |
| 56 | test $fail = 1 && diff out exp 2> /dev/null |
| 57 | |
| 58 | (exit $fail); exit $fail |