1#! /bin/sh
2# Generated from testsuite.at by GNU Autoconf 2.69.
3#
4# Copyright (C) 2009-2012 Free Software Foundation, Inc.
5#
6# This test suite is free software; the Free Software Foundation gives
7# unlimited permission to copy, distribute and modify it.
8## -------------------- ##
9## M4sh Initialization. ##
10## -------------------- ##
11
12# Be more Bourne compatible
13DUALCASE=1; export DUALCASE # for MKS sh
14if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
15  emulate sh
16  NULLCMD=:
17  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
18  # is contrary to our usage.  Disable this feature.
19  alias -g '${1+"$@"}'='"$@"'
20  setopt NO_GLOB_SUBST
21else
22  case `(set -o) 2>/dev/null` in #(
23  *posix*) :
24    set -o posix ;; #(
25  *) :
26     ;;
27esac
28fi
29
30
31as_nl='
32'
33export as_nl
34# Printing a long string crashes Solaris 7 /usr/bin/printf.
35as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
36as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
37as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
38# Prefer a ksh shell builtin over an external printf program on Solaris,
39# but without wasting forks for bash or zsh.
40if test -z "$BASH_VERSION$ZSH_VERSION" \
41    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
42  as_echo='print -r --'
43  as_echo_n='print -rn --'
44elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
45  as_echo='printf %s\n'
46  as_echo_n='printf %s'
47else
48  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
49    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
50    as_echo_n='/usr/ucb/echo -n'
51  else
52    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
53    as_echo_n_body='eval
54      arg=$1;
55      case $arg in #(
56      *"$as_nl"*)
57	expr "X$arg" : "X\\(.*\\)$as_nl";
58	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
59      esac;
60      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
61    '
62    export as_echo_n_body
63    as_echo_n='sh -c $as_echo_n_body as_echo'
64  fi
65  export as_echo_body
66  as_echo='sh -c $as_echo_body as_echo'
67fi
68
69# The user is always right.
70if test "${PATH_SEPARATOR+set}" != set; then
71  PATH_SEPARATOR=:
72  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
73    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
74      PATH_SEPARATOR=';'
75  }
76fi
77
78
79# IFS
80# We need space, tab and new line, in precisely that order.  Quoting is
81# there to prevent editors from complaining about space-tab.
82# (If _AS_PATH_WALK were called with IFS unset, it would disable word
83# splitting by setting IFS to empty value.)
84IFS=" ""	$as_nl"
85
86# Find who we are.  Look in the path if we contain no directory separator.
87as_myself=
88case $0 in #((
89  *[\\/]* ) as_myself=$0 ;;
90  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
91for as_dir in $PATH
92do
93  IFS=$as_save_IFS
94  test -z "$as_dir" && as_dir=.
95    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
96  done
97IFS=$as_save_IFS
98
99     ;;
100esac
101# We did not find ourselves, most probably we were run as `sh COMMAND'
102# in which case we are not to be found in the path.
103if test "x$as_myself" = x; then
104  as_myself=$0
105fi
106if test ! -f "$as_myself"; then
107  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
108  exit 1
109fi
110
111# Unset variables that we do not need and which cause bugs (e.g. in
112# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
113# suppresses any "Segmentation fault" message there.  '((' could
114# trigger a bug in pdksh 5.2.14.
115for as_var in BASH_ENV ENV MAIL MAILPATH
116do eval test x\${$as_var+set} = xset \
117  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
118done
119PS1='$ '
120PS2='> '
121PS4='+ '
122
123# NLS nuisances.
124LC_ALL=C
125export LC_ALL
126LANGUAGE=C
127export LANGUAGE
128
129# CDPATH.
130(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
131
132if test "x$CONFIG_SHELL" = x; then
133  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
134  emulate sh
135  NULLCMD=:
136  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
137  # is contrary to our usage.  Disable this feature.
138  alias -g '\${1+\"\$@\"}'='\"\$@\"'
139  setopt NO_GLOB_SUBST
140else
141  case \`(set -o) 2>/dev/null\` in #(
142  *posix*) :
143    set -o posix ;; #(
144  *) :
145     ;;
146esac
147fi
148"
149  as_required="as_fn_return () { (exit \$1); }
150as_fn_success () { as_fn_return 0; }
151as_fn_failure () { as_fn_return 1; }
152as_fn_ret_success () { return 0; }
153as_fn_ret_failure () { return 1; }
154
155exitcode=0
156as_fn_success || { exitcode=1; echo as_fn_success failed.; }
157as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
158as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
159as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
160if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
161
162else
163  exitcode=1; echo positional parameters were not saved.
164fi
165test x\$exitcode = x0 || exit 1
166test -x / || exit 1"
167  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
168  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
169  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
170  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
171test \$(( 1 + 1 )) = 2 || exit 1"
172  if (eval "$as_required") 2>/dev/null; then :
173  as_have_required=yes
174else
175  as_have_required=no
176fi
177  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
178
179else
180  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
181as_found=false
182for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
183do
184  IFS=$as_save_IFS
185  test -z "$as_dir" && as_dir=.
186  as_found=:
187  case $as_dir in #(
188	 /*)
189	   for as_base in sh bash ksh sh5; do
190	     # Try only shells that exist, to save several forks.
191	     as_shell=$as_dir/$as_base
192	     if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
193		    { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
194  CONFIG_SHELL=$as_shell as_have_required=yes
195		   if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
196  break 2
197fi
198fi
199	   done;;
200       esac
201  as_found=false
202done
203$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
204	      { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
205  CONFIG_SHELL=$SHELL as_have_required=yes
206fi; }
207IFS=$as_save_IFS
208
209
210      if test "x$CONFIG_SHELL" != x; then :
211  export CONFIG_SHELL
212             # We cannot yet assume a decent shell, so we have to provide a
213# neutralization value for shells without unset; and this also
214# works around shells that cannot unset nonexistent variables.
215# Preserve -v and -x to the replacement shell.
216BASH_ENV=/dev/null
217ENV=/dev/null
218(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
219case $- in # ((((
220  *v*x* | *x*v* ) as_opts=-vx ;;
221  *v* ) as_opts=-v ;;
222  *x* ) as_opts=-x ;;
223  * ) as_opts= ;;
224esac
225exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
226# Admittedly, this is quite paranoid, since all the known shells bail
227# out after a failed `exec'.
228$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
229exit 255
230fi
231
232    if test x$as_have_required = xno; then :
233  $as_echo "$0: This script requires a shell more modern than all"
234  $as_echo "$0: the shells that I found on your system."
235  if test x${ZSH_VERSION+set} = xset ; then
236    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
237    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
238  else
239    $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
240$0: including any error possibly output before this
241$0: message. Then install a modern shell, or manually run
242$0: the script under such a shell if you do have one."
243  fi
244  exit 1
245fi
246fi
247fi
248SHELL=${CONFIG_SHELL-/bin/sh}
249export SHELL
250# Unset more variables known to interfere with behavior of common tools.
251CLICOLOR_FORCE= GREP_OPTIONS=
252unset CLICOLOR_FORCE GREP_OPTIONS
253
254## --------------------- ##
255## M4sh Shell Functions. ##
256## --------------------- ##
257# as_fn_unset VAR
258# ---------------
259# Portably unset VAR.
260as_fn_unset ()
261{
262  { eval $1=; unset $1;}
263}
264as_unset=as_fn_unset
265
266# as_fn_set_status STATUS
267# -----------------------
268# Set $? to STATUS, without forking.
269as_fn_set_status ()
270{
271  return $1
272} # as_fn_set_status
273
274# as_fn_exit STATUS
275# -----------------
276# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
277as_fn_exit ()
278{
279  set +e
280  as_fn_set_status $1
281  exit $1
282} # as_fn_exit
283
284# as_fn_mkdir_p
285# -------------
286# Create "$as_dir" as a directory, including parents if necessary.
287as_fn_mkdir_p ()
288{
289
290  case $as_dir in #(
291  -*) as_dir=./$as_dir;;
292  esac
293  test -d "$as_dir" || eval $as_mkdir_p || {
294    as_dirs=
295    while :; do
296      case $as_dir in #(
297      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
298      *) as_qdir=$as_dir;;
299      esac
300      as_dirs="'$as_qdir' $as_dirs"
301      as_dir=`$as_dirname -- "$as_dir" ||
302$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
303	 X"$as_dir" : 'X\(//\)[^/]' \| \
304	 X"$as_dir" : 'X\(//\)$' \| \
305	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
306$as_echo X"$as_dir" |
307    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
308	    s//\1/
309	    q
310	  }
311	  /^X\(\/\/\)[^/].*/{
312	    s//\1/
313	    q
314	  }
315	  /^X\(\/\/\)$/{
316	    s//\1/
317	    q
318	  }
319	  /^X\(\/\).*/{
320	    s//\1/
321	    q
322	  }
323	  s/.*/./; q'`
324      test -d "$as_dir" && break
325    done
326    test -z "$as_dirs" || eval "mkdir $as_dirs"
327  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
328
329
330} # as_fn_mkdir_p
331
332# as_fn_executable_p FILE
333# -----------------------
334# Test if FILE is an executable regular file.
335as_fn_executable_p ()
336{
337  test -f "$1" && test -x "$1"
338} # as_fn_executable_p
339# as_fn_append VAR VALUE
340# ----------------------
341# Append the text in VALUE to the end of the definition contained in VAR. Take
342# advantage of any shell optimizations that allow amortized linear growth over
343# repeated appends, instead of the typical quadratic growth present in naive
344# implementations.
345if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
346  eval 'as_fn_append ()
347  {
348    eval $1+=\$2
349  }'
350else
351  as_fn_append ()
352  {
353    eval $1=\$$1\$2
354  }
355fi # as_fn_append
356
357# as_fn_arith ARG...
358# ------------------
359# Perform arithmetic evaluation on the ARGs, and store the result in the
360# global $as_val. Take advantage of shells that can avoid forks. The arguments
361# must be portable across $(()) and expr.
362if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
363  eval 'as_fn_arith ()
364  {
365    as_val=$(( $* ))
366  }'
367else
368  as_fn_arith ()
369  {
370    as_val=`expr "$@" || test $? -eq 1`
371  }
372fi # as_fn_arith
373
374
375# as_fn_error STATUS ERROR [LINENO LOG_FD]
376# ----------------------------------------
377# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
378# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
379# script with STATUS, using 1 if that was 0.
380as_fn_error ()
381{
382  as_status=$1; test $as_status -eq 0 && as_status=1
383  if test "$4"; then
384    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
385    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
386  fi
387  $as_echo "$as_me: error: $2" >&2
388  as_fn_exit $as_status
389} # as_fn_error
390
391if expr a : '\(a\)' >/dev/null 2>&1 &&
392   test "X`expr 00001 : '.*\(...\)'`" = X001; then
393  as_expr=expr
394else
395  as_expr=false
396fi
397
398if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
399  as_basename=basename
400else
401  as_basename=false
402fi
403
404as_me=`$as_basename -- "$0" ||
405$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
406	 X"$0" : 'X\(//\)$' \| \
407	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
408$as_echo X/"$0" |
409    sed '/^.*\/\([^/][^/]*\)\/*$/{
410	    s//\1/
411	    q
412	  }
413	  /^X\/\(\/\/\)$/{
414	    s//\1/
415	    q
416	  }
417	  /^X\/\(\/\).*/{
418	    s//\1/
419	    q
420	  }
421	  s/.*/./; q'`
422
423if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
424  as_dirname=dirname
425else
426  as_dirname=false
427fi
428
429# Avoid depending upon Character Ranges.
430as_cr_letters='abcdefghijklmnopqrstuvwxyz'
431as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
432as_cr_Letters=$as_cr_letters$as_cr_LETTERS
433as_cr_digits='0123456789'
434as_cr_alnum=$as_cr_Letters$as_cr_digits
435
436
437  as_lineno_1=$LINENO as_lineno_1a=$LINENO
438  as_lineno_2=$LINENO as_lineno_2a=$LINENO
439  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
440  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
441  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
442  sed -n '
443    p
444    /[$]LINENO/=
445  ' <$as_myself |
446    sed '
447      s/[$]LINENO.*/&-/
448      t lineno
449      b
450      :lineno
451      N
452      :loop
453      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
454      t loop
455      s/-\n.*//
456    ' >$as_me.lineno &&
457  chmod +x "$as_me.lineno" ||
458    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
459
460  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
461  # already done that, so ensure we don't try to do so again and fall
462  # in an infinite loop.  This has already happened in practice.
463  _as_can_reexec=no; export _as_can_reexec
464  # Don't try to exec as it changes $[0], causing all sort of problems
465  # (the dirname of $[0] is not the place where we might find the
466  # original and so on.  Autoconf is especially sensitive to this).
467  . "./$as_me.lineno"
468  # Exit status is that of the last command.
469  exit
470}
471
472ECHO_C= ECHO_N= ECHO_T=
473case `echo -n x` in #(((((
474-n*)
475  case `echo 'xy\c'` in
476  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
477  xy)  ECHO_C='\c';;
478  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
479       ECHO_T='	';;
480  esac;;
481*)
482  ECHO_N='-n';;
483esac
484
485rm -f conf$$ conf$$.exe conf$$.file
486if test -d conf$$.dir; then
487  rm -f conf$$.dir/conf$$.file
488else
489  rm -f conf$$.dir
490  mkdir conf$$.dir 2>/dev/null
491fi
492if (echo >conf$$.file) 2>/dev/null; then
493  if ln -s conf$$.file conf$$ 2>/dev/null; then
494    as_ln_s='ln -s'
495    # ... but there are two gotchas:
496    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
497    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
498    # In both cases, we have to default to `cp -pR'.
499    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
500      as_ln_s='cp -pR'
501  elif ln conf$$.file conf$$ 2>/dev/null; then
502    as_ln_s=ln
503  else
504    as_ln_s='cp -pR'
505  fi
506else
507  as_ln_s='cp -pR'
508fi
509rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
510rmdir conf$$.dir 2>/dev/null
511
512if mkdir -p . 2>/dev/null; then
513  as_mkdir_p='mkdir -p "$as_dir"'
514else
515  test -d ./-p && rmdir ./-p
516  as_mkdir_p=false
517fi
518
519as_test_x='test -x'
520as_executable_p=as_fn_executable_p
521
522# Sed expression to map a string onto a valid CPP name.
523as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
524
525# Sed expression to map a string onto a valid variable name.
526as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
527
528
529
530
531
532SHELL=${CONFIG_SHELL-/bin/sh}
533
534# How were we run?
535at_cli_args="$@"
536
537
538# Not all shells have the 'times' builtin; the subshell is needed to make
539# sure we discard the 'times: not found' message from the shell.
540at_times_p=false
541(times) >/dev/null 2>&1 && at_times_p=:
542
543# CLI Arguments to pass to the debugging scripts.
544at_debug_args=
545# -e sets to true
546at_errexit_p=false
547# Shall we be verbose?  ':' means no, empty means yes.
548at_verbose=:
549at_quiet=
550# Running several jobs in parallel, 0 means as many as test groups.
551at_jobs=1
552at_traceon=:
553at_trace_echo=:
554at_check_filter_trace=:
555
556# Shall we keep the debug scripts?  Must be `:' when the suite is
557# run by a debug script, so that the script doesn't remove itself.
558at_debug_p=false
559# Display help message?
560at_help_p=false
561# Display the version message?
562at_version_p=false
563# List test groups?
564at_list_p=false
565# --clean
566at_clean=false
567# Test groups to run
568at_groups=
569# Whether to rerun failed tests.
570at_recheck=
571# Whether a write failure occurred
572at_write_fail=0
573
574# The directory we run the suite in.  Default to . if no -C option.
575at_dir=`pwd`
576# An absolute reference to this testsuite script.
577case $as_myself in
578  [\\/]* | ?:[\\/]* ) at_myself=$as_myself ;;
579  * ) at_myself=$at_dir/$as_myself ;;
580esac
581# Whether -C is in effect.
582at_change_dir=false
583
584# Whether to enable colored test results.
585at_color=no
586# List of the tested programs.
587at_tested=''
588# As many question marks as there are digits in the last test group number.
589# Used to normalize the test group numbers so that `ls' lists them in
590# numerical order.
591at_format='??'
592# Description of all the test groups.
593at_help_all="1;exact.at:17;exact;match exact;
5942;prefix.at:17;prefix;match prefix;
5953;suffix.at:17;suffix;match suffix;
5964;lev.at:17;Levenshtein;match lev;
5975;define.at:17;define;define;
5986;mime.at:17;db-mime-header;option mime db-mime-header;
5997;mime2.at:17;result-headers;option mime result-headers;
6008;showdb.at:17;show db;show showdb;
6019;showinfo.at:17;show info;show showinfo;
60210;showlang.at:17;show lang info;show lang showlang;
603"
604# List of the all the test groups.
605at_groups_all=`$as_echo "$at_help_all" | sed 's/;.*//'`
606
607# at_fn_validate_ranges NAME...
608# -----------------------------
609# Validate and normalize the test group number contained in each variable
610# NAME. Leading zeroes are treated as decimal.
611at_fn_validate_ranges ()
612{
613  for at_grp
614  do
615    eval at_value=\$$at_grp
616    if test $at_value -lt 1 || test $at_value -gt 10; then
617      $as_echo "invalid test group: $at_value" >&2
618      exit 1
619    fi
620    case $at_value in
621      0*) # We want to treat leading 0 as decimal, like expr and test, but
622	  # AS_VAR_ARITH treats it as octal if it uses $(( )).
623	  # With XSI shells, ${at_value#${at_value%%[1-9]*}} avoids the
624	  # expr fork, but it is not worth the effort to determine if the
625	  # shell supports XSI when the user can just avoid leading 0.
626	  eval $at_grp='`expr $at_value + 0`' ;;
627    esac
628  done
629}
630
631at_prev=
632for at_option
633do
634  # If the previous option needs an argument, assign it.
635  if test -n "$at_prev"; then
636    at_option=$at_prev=$at_option
637    at_prev=
638  fi
639
640  case $at_option in
641  *=?*) at_optarg=`expr "X$at_option" : '[^=]*=\(.*\)'` ;;
642  *)    at_optarg= ;;
643  esac
644
645  # Accept the important Cygnus configure options, so we can diagnose typos.
646
647  case $at_option in
648    --help | -h )
649	at_help_p=:
650	;;
651
652    --list | -l )
653	at_list_p=:
654	;;
655
656    --version | -V )
657	at_version_p=:
658	;;
659
660    --clean | -c )
661	at_clean=:
662	;;
663
664    --color )
665	at_color=always
666	;;
667    --color=* )
668	case $at_optarg in
669	no | never | none) at_color=never ;;
670	auto | tty | if-tty) at_color=auto ;;
671	always | yes | force) at_color=always ;;
672	*) at_optname=`echo " $at_option" | sed 's/^ //; s/=.*//'`
673	   as_fn_error $? "unrecognized argument to $at_optname: $at_optarg" ;;
674	esac
675	;;
676
677    --debug | -d )
678	at_debug_p=:
679	;;
680
681    --errexit | -e )
682	at_debug_p=:
683	at_errexit_p=:
684	;;
685
686    --verbose | -v )
687	at_verbose=; at_quiet=:
688	;;
689
690    --trace | -x )
691	at_traceon='set -x'
692	at_trace_echo=echo
693	at_check_filter_trace=at_fn_filter_trace
694	;;
695
696    [0-9] | [0-9][0-9] | [0-9][0-9][0-9] | [0-9][0-9][0-9][0-9])
697	at_fn_validate_ranges at_option
698	as_fn_append at_groups "$at_option$as_nl"
699	;;
700
701    # Ranges
702    [0-9]- | [0-9][0-9]- | [0-9][0-9][0-9]- | [0-9][0-9][0-9][0-9]-)
703	at_range_start=`echo $at_option |tr -d X-`
704	at_fn_validate_ranges at_range_start
705	at_range=`$as_echo "$at_groups_all" | \
706	  sed -ne '/^'$at_range_start'$/,$p'`
707	as_fn_append at_groups "$at_range$as_nl"
708	;;
709
710    -[0-9] | -[0-9][0-9] | -[0-9][0-9][0-9] | -[0-9][0-9][0-9][0-9])
711	at_range_end=`echo $at_option |tr -d X-`
712	at_fn_validate_ranges at_range_end
713	at_range=`$as_echo "$at_groups_all" | \
714	  sed -ne '1,/^'$at_range_end'$/p'`
715	as_fn_append at_groups "$at_range$as_nl"
716	;;
717
718    [0-9]-[0-9] | [0-9]-[0-9][0-9] | [0-9]-[0-9][0-9][0-9] | \
719    [0-9]-[0-9][0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9] | \
720    [0-9][0-9]-[0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9][0-9][0-9] | \
721    [0-9][0-9][0-9]-[0-9][0-9][0-9] | \
722    [0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] | \
723    [0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] )
724	at_range_start=`expr $at_option : '\(.*\)-'`
725	at_range_end=`expr $at_option : '.*-\(.*\)'`
726	if test $at_range_start -gt $at_range_end; then
727	  at_tmp=$at_range_end
728	  at_range_end=$at_range_start
729	  at_range_start=$at_tmp
730	fi
731	at_fn_validate_ranges at_range_start at_range_end
732	at_range=`$as_echo "$at_groups_all" | \
733	  sed -ne '/^'$at_range_start'$/,/^'$at_range_end'$/p'`
734	as_fn_append at_groups "$at_range$as_nl"
735	;;
736
737    # Directory selection.
738    --directory | -C )
739	at_prev=--directory
740	;;
741    --directory=* )
742	at_change_dir=:
743	at_dir=$at_optarg
744	if test x- = "x$at_dir" ; then
745	  at_dir=./-
746	fi
747	;;
748
749    # Parallel execution.
750    --jobs | -j )
751	at_jobs=0
752	;;
753    --jobs=* | -j[0-9]* )
754	if test -n "$at_optarg"; then
755	  at_jobs=$at_optarg
756	else
757	  at_jobs=`expr X$at_option : 'X-j\(.*\)'`
758	fi
759	case $at_jobs in *[!0-9]*)
760	  at_optname=`echo " $at_option" | sed 's/^ //; s/[0-9=].*//'`
761	  as_fn_error $? "non-numeric argument to $at_optname: $at_jobs" ;;
762	esac
763	;;
764
765    # Keywords.
766    --keywords | -k )
767	at_prev=--keywords
768	;;
769    --keywords=* )
770	at_groups_selected=$at_help_all
771	at_save_IFS=$IFS
772	IFS=,
773	set X $at_optarg
774	shift
775	IFS=$at_save_IFS
776	for at_keyword
777	do
778	  at_invert=
779	  case $at_keyword in
780	  '!'*)
781	    at_invert="-v"
782	    at_keyword=`expr "X$at_keyword" : 'X!\(.*\)'`
783	    ;;
784	  esac
785	  # It is on purpose that we match the test group titles too.
786	  at_groups_selected=`$as_echo "$at_groups_selected" |
787	      grep -i $at_invert "^[1-9][^;]*;.*[; ]$at_keyword[ ;]"`
788	done
789	# Smash the keywords.
790	at_groups_selected=`$as_echo "$at_groups_selected" | sed 's/;.*//'`
791	as_fn_append at_groups "$at_groups_selected$as_nl"
792	;;
793    --recheck)
794	at_recheck=:
795	;;
796
797    *=*)
798	at_envvar=`expr "x$at_option" : 'x\([^=]*\)='`
799	# Reject names that are not valid shell variable names.
800	case $at_envvar in
801	  '' | [0-9]* | *[!_$as_cr_alnum]* )
802	    as_fn_error $? "invalid variable name: \`$at_envvar'" ;;
803	esac
804	at_value=`$as_echo "$at_optarg" | sed "s/'/'\\\\\\\\''/g"`
805	# Export now, but save eval for later and for debug scripts.
806	export $at_envvar
807	as_fn_append at_debug_args " $at_envvar='$at_value'"
808	;;
809
810     *) $as_echo "$as_me: invalid option: $at_option" >&2
811	$as_echo "Try \`$0 --help' for more information." >&2
812	exit 1
813	;;
814  esac
815done
816
817# Verify our last option didn't require an argument
818if test -n "$at_prev"; then :
819  as_fn_error $? "\`$at_prev' requires an argument"
820fi
821
822# The file containing the suite.
823at_suite_log=$at_dir/$as_me.log
824
825# Selected test groups.
826if test -z "$at_groups$at_recheck"; then
827  at_groups=$at_groups_all
828else
829  if test -n "$at_recheck" && test -r "$at_suite_log"; then
830    at_oldfails=`sed -n '
831      /^Failed tests:$/,/^Skipped tests:$/{
832	s/^[ ]*\([1-9][0-9]*\):.*/\1/p
833      }
834      /^Unexpected passes:$/,/^## Detailed failed tests/{
835	s/^[ ]*\([1-9][0-9]*\):.*/\1/p
836      }
837      /^## Detailed failed tests/q
838      ' "$at_suite_log"`
839    as_fn_append at_groups "$at_oldfails$as_nl"
840  fi
841  # Sort the tests, removing duplicates.
842  at_groups=`$as_echo "$at_groups" | sort -nu | sed '/^$/d'`
843fi
844
845if test x"$at_color" = xalways \
846   || { test x"$at_color" = xauto && test -t 1; }; then
847  at_red=`printf '\033[0;31m'`
848  at_grn=`printf '\033[0;32m'`
849  at_lgn=`printf '\033[1;32m'`
850  at_blu=`printf '\033[1;34m'`
851  at_std=`printf '\033[m'`
852else
853  at_red= at_grn= at_lgn= at_blu= at_std=
854fi
855
856# Help message.
857if $at_help_p; then
858  cat <<_ATEOF || at_write_fail=1
859Usage: $0 [OPTION]... [VARIABLE=VALUE]... [TESTS]
860
861Run all the tests, or the selected TESTS, given by numeric ranges, and
862save a detailed log file.  Upon failure, create debugging scripts.
863
864Do not change environment variables directly.  Instead, set them via
865command line arguments.  Set \`AUTOTEST_PATH' to select the executables
866to exercise.  Each relative directory is expanded as build and source
867directories relative to the top level of this distribution.
868E.g., from within the build directory /tmp/foo-1.0, invoking this:
869
870  $ $0 AUTOTEST_PATH=bin
871
872is equivalent to the following, assuming the source directory is /src/foo-1.0:
873
874  PATH=/tmp/foo-1.0/bin:/src/foo-1.0/bin:\$PATH $0
875_ATEOF
876cat <<_ATEOF || at_write_fail=1
877
878Operation modes:
879  -h, --help     print the help message, then exit
880  -V, --version  print version number, then exit
881  -c, --clean    remove all the files this test suite might create and exit
882  -l, --list     describes all the tests, or the selected TESTS
883_ATEOF
884cat <<_ATEOF || at_write_fail=1
885
886Execution tuning:
887  -C, --directory=DIR
888                 change to directory DIR before starting
889      --color[=never|auto|always]
890                 enable colored test results on terminal, or always
891  -j, --jobs[=N]
892                 Allow N jobs at once; infinite jobs with no arg (default 1)
893  -k, --keywords=KEYWORDS
894                 select the tests matching all the comma-separated KEYWORDS
895                 multiple \`-k' accumulate; prefixed \`!' negates a KEYWORD
896      --recheck  select all tests that failed or passed unexpectedly last time
897  -e, --errexit  abort as soon as a test fails; implies --debug
898  -v, --verbose  force more detailed output
899                 default for debugging scripts
900  -d, --debug    inhibit clean up and top-level logging
901                 default for debugging scripts
902  -x, --trace    enable tests shell tracing
903_ATEOF
904cat <<_ATEOF || at_write_fail=1
905
906Report bugs to <bug-dico@gnu.org>.
907General help using GNU software: <http://www.gnu.org/gethelp/>.
908_ATEOF
909  exit $at_write_fail
910fi
911
912# List of tests.
913if $at_list_p; then
914  cat <<_ATEOF || at_write_fail=1
915GNU dico 2.10 test suite test groups:
916
917 NUM: FILE-NAME:LINE     TEST-GROUP-NAME
918      KEYWORDS
919
920_ATEOF
921  # Pass an empty line as separator between selected groups and help.
922  $as_echo "$at_groups$as_nl$as_nl$at_help_all" |
923    awk 'NF == 1 && FS != ";" {
924	   selected[$ 1] = 1
925	   next
926	 }
927	 /^$/ { FS = ";" }
928	 NF > 0 {
929	   if (selected[$ 1]) {
930	     printf " %3d: %-18s %s\n", $ 1, $ 2, $ 3
931	     if ($ 4) {
932	       lmax = 79
933	       indent = "     "
934	       line = indent
935	       len = length (line)
936	       n = split ($ 4, a, " ")
937	       for (i = 1; i <= n; i++) {
938		 l = length (a[i]) + 1
939		 if (i > 1 && len + l > lmax) {
940		   print line
941		   line = indent " " a[i]
942		   len = length (line)
943		 } else {
944		   line = line " " a[i]
945		   len += l
946		 }
947	       }
948	       if (n)
949		 print line
950	     }
951	   }
952	 }' || at_write_fail=1
953  exit $at_write_fail
954fi
955if $at_version_p; then
956  $as_echo "$as_me (GNU dico 2.10)" &&
957  cat <<\_ATEOF || at_write_fail=1
958
959Copyright (C) 2012 Free Software Foundation, Inc.
960This test suite is free software; the Free Software Foundation gives
961unlimited permission to copy, distribute and modify it.
962_ATEOF
963  exit $at_write_fail
964fi
965
966# Should we print banners?  Yes if more than one test is run.
967case $at_groups in #(
968  *$as_nl* )
969      at_print_banners=: ;; #(
970  * ) at_print_banners=false ;;
971esac
972# Text for banner N, set to a single space once printed.
973# Banner 1. testsuite.at:23
974# Category starts at test group 1.
975at_banner_text_1="Match"
976# Banner 2. testsuite.at:29
977# Category starts at test group 5.
978at_banner_text_2="Define"
979# Banner 3. testsuite.at:34
980# Category starts at test group 8.
981at_banner_text_3="Show"
982
983# Take any -C into account.
984if $at_change_dir ; then
985  test x != "x$at_dir" && cd "$at_dir" \
986    || as_fn_error $? "unable to change directory"
987  at_dir=`pwd`
988fi
989
990# Load the config files for any default variable assignments.
991for at_file in atconfig atlocal
992do
993  test -r $at_file || continue
994  . ./$at_file || as_fn_error $? "invalid content: $at_file"
995done
996
997# Autoconf <=2.59b set at_top_builddir instead of at_top_build_prefix:
998: "${at_top_build_prefix=$at_top_builddir}"
999
1000# Perform any assignments requested during argument parsing.
1001eval "$at_debug_args"
1002
1003# atconfig delivers names relative to the directory the test suite is
1004# in, but the groups themselves are run in testsuite-dir/group-dir.
1005if test -n "$at_top_srcdir"; then
1006  builddir=../..
1007  for at_dir_var in srcdir top_srcdir top_build_prefix
1008  do
1009    eval at_val=\$at_$at_dir_var
1010    case $at_val in
1011      [\\/$]* | ?:[\\/]* ) at_prefix= ;;
1012      *) at_prefix=../../ ;;
1013    esac
1014    eval "$at_dir_var=\$at_prefix\$at_val"
1015  done
1016fi
1017
1018## -------------------- ##
1019## Directory structure. ##
1020## -------------------- ##
1021
1022# This is the set of directories and files used by this script
1023# (non-literals are capitalized):
1024#
1025# TESTSUITE         - the testsuite
1026# TESTSUITE.log     - summarizes the complete testsuite run
1027# TESTSUITE.dir/    - created during a run, remains after -d or failed test
1028# + at-groups/      - during a run: status of all groups in run
1029# | + NNN/          - during a run: meta-data about test group NNN
1030# | | + check-line  - location (source file and line) of current AT_CHECK
1031# | | + status      - exit status of current AT_CHECK
1032# | | + stdout      - stdout of current AT_CHECK
1033# | | + stder1      - stderr, including trace
1034# | | + stderr      - stderr, with trace filtered out
1035# | | + test-source - portion of testsuite that defines group
1036# | | + times       - timestamps for computing duration
1037# | | + pass        - created if group passed
1038# | | + xpass       - created if group xpassed
1039# | | + fail        - created if group failed
1040# | | + xfail       - created if group xfailed
1041# | | + skip        - created if group skipped
1042# + at-stop         - during a run: end the run if this file exists
1043# + at-source-lines - during a run: cache of TESTSUITE line numbers for extraction
1044# + 0..NNN/         - created for each group NNN, remains after -d or failed test
1045# | + TESTSUITE.log - summarizes the group results
1046# | + ...           - files created during the group
1047
1048# The directory the whole suite works in.
1049# Should be absolute to let the user `cd' at will.
1050at_suite_dir=$at_dir/$as_me.dir
1051# The file containing the suite ($at_dir might have changed since earlier).
1052at_suite_log=$at_dir/$as_me.log
1053# The directory containing helper files per test group.
1054at_helper_dir=$at_suite_dir/at-groups
1055# Stop file: if it exists, do not start new jobs.
1056at_stop_file=$at_suite_dir/at-stop
1057# The fifo used for the job dispatcher.
1058at_job_fifo=$at_suite_dir/at-job-fifo
1059
1060if $at_clean; then
1061  test -d "$at_suite_dir" &&
1062    find "$at_suite_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \;
1063  rm -f -r "$at_suite_dir" "$at_suite_log"
1064  exit $?
1065fi
1066
1067# Don't take risks: use only absolute directories in PATH.
1068#
1069# For stand-alone test suites (ie. atconfig was not found),
1070# AUTOTEST_PATH is relative to `.'.
1071#
1072# For embedded test suites, AUTOTEST_PATH is relative to the top level
1073# of the package.  Then expand it into build/src parts, since users
1074# may create executables in both places.
1075AUTOTEST_PATH=`$as_echo "$AUTOTEST_PATH" | sed "s|:|$PATH_SEPARATOR|g"`
1076at_path=
1077as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1078for as_dir in $AUTOTEST_PATH $PATH
1079do
1080  IFS=$as_save_IFS
1081  test -z "$as_dir" && as_dir=.
1082    test -n "$at_path" && as_fn_append at_path $PATH_SEPARATOR
1083case $as_dir in
1084  [\\/]* | ?:[\\/]* )
1085    as_fn_append at_path "$as_dir"
1086    ;;
1087  * )
1088    if test -z "$at_top_build_prefix"; then
1089      # Stand-alone test suite.
1090      as_fn_append at_path "$as_dir"
1091    else
1092      # Embedded test suite.
1093      as_fn_append at_path "$at_top_build_prefix$as_dir$PATH_SEPARATOR"
1094      as_fn_append at_path "$at_top_srcdir/$as_dir"
1095    fi
1096    ;;
1097esac
1098  done
1099IFS=$as_save_IFS
1100
1101
1102# Now build and simplify PATH.
1103#
1104# There might be directories that don't exist, but don't redirect
1105# builtins' (eg., cd) stderr directly: Ultrix's sh hates that.
1106at_new_path=
1107as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1108for as_dir in $at_path
1109do
1110  IFS=$as_save_IFS
1111  test -z "$as_dir" && as_dir=.
1112    test -d "$as_dir" || continue
1113case $as_dir in
1114  [\\/]* | ?:[\\/]* ) ;;
1115  * ) as_dir=`(cd "$as_dir" && pwd) 2>/dev/null` ;;
1116esac
1117case $PATH_SEPARATOR$at_new_path$PATH_SEPARATOR in
1118  *$PATH_SEPARATOR$as_dir$PATH_SEPARATOR*) ;;
1119  $PATH_SEPARATOR$PATH_SEPARATOR) at_new_path=$as_dir ;;
1120  *) as_fn_append at_new_path "$PATH_SEPARATOR$as_dir" ;;
1121esac
1122  done
1123IFS=$as_save_IFS
1124
1125PATH=$at_new_path
1126export PATH
1127
1128# Setting up the FDs.
1129
1130
1131
1132# 5 is the log file.  Not to be overwritten if `-d'.
1133if $at_debug_p; then
1134  at_suite_log=/dev/null
1135else
1136  : >"$at_suite_log"
1137fi
1138exec 5>>"$at_suite_log"
1139
1140# Banners and logs.
1141$as_echo "## ------------------------- ##
1142## GNU dico 2.10 test suite. ##
1143## ------------------------- ##"
1144{
1145  $as_echo "## ------------------------- ##
1146## GNU dico 2.10 test suite. ##
1147## ------------------------- ##"
1148  echo
1149
1150  $as_echo "$as_me: command line was:"
1151  $as_echo "  \$ $0 $at_cli_args"
1152  echo
1153
1154  # If ChangeLog exists, list a few lines in case it might help determining
1155  # the exact version.
1156  if test -n "$at_top_srcdir" && test -f "$at_top_srcdir/ChangeLog"; then
1157    $as_echo "## ---------- ##
1158## ChangeLog. ##
1159## ---------- ##"
1160    echo
1161    sed 's/^/| /;10q' "$at_top_srcdir/ChangeLog"
1162    echo
1163  fi
1164
1165  {
1166cat <<_ASUNAME
1167## --------- ##
1168## Platform. ##
1169## --------- ##
1170
1171hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
1172uname -m = `(uname -m) 2>/dev/null || echo unknown`
1173uname -r = `(uname -r) 2>/dev/null || echo unknown`
1174uname -s = `(uname -s) 2>/dev/null || echo unknown`
1175uname -v = `(uname -v) 2>/dev/null || echo unknown`
1176
1177/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
1178/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
1179
1180/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
1181/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
1182/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
1183/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
1184/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
1185/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
1186/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
1187
1188_ASUNAME
1189
1190as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1191for as_dir in $PATH
1192do
1193  IFS=$as_save_IFS
1194  test -z "$as_dir" && as_dir=.
1195    $as_echo "PATH: $as_dir"
1196  done
1197IFS=$as_save_IFS
1198
1199}
1200  echo
1201
1202  # Contents of the config files.
1203  for at_file in atconfig atlocal
1204  do
1205    test -r $at_file || continue
1206    $as_echo "$as_me: $at_file:"
1207    sed 's/^/| /' $at_file
1208    echo
1209  done
1210} >&5
1211
1212
1213## ------------------------- ##
1214## Autotest shell functions. ##
1215## ------------------------- ##
1216
1217# at_fn_banner NUMBER
1218# -------------------
1219# Output banner NUMBER, provided the testsuite is running multiple groups and
1220# this particular banner has not yet been printed.
1221at_fn_banner ()
1222{
1223  $at_print_banners || return 0
1224  eval at_banner_text=\$at_banner_text_$1
1225  test "x$at_banner_text" = "x " && return 0
1226  eval "at_banner_text_$1=\" \""
1227  if test -z "$at_banner_text"; then
1228    $at_first || echo
1229  else
1230    $as_echo "$as_nl$at_banner_text$as_nl"
1231  fi
1232} # at_fn_banner
1233
1234# at_fn_check_prepare_notrace REASON LINE
1235# ---------------------------------------
1236# Perform AT_CHECK preparations for the command at LINE for an untraceable
1237# command; REASON is the reason for disabling tracing.
1238at_fn_check_prepare_notrace ()
1239{
1240  $at_trace_echo "Not enabling shell tracing (command contains $1)"
1241  $as_echo "$2" >"$at_check_line_file"
1242  at_check_trace=: at_check_filter=:
1243  : >"$at_stdout"; : >"$at_stderr"
1244}
1245
1246# at_fn_check_prepare_trace LINE
1247# ------------------------------
1248# Perform AT_CHECK preparations for the command at LINE for a traceable
1249# command.
1250at_fn_check_prepare_trace ()
1251{
1252  $as_echo "$1" >"$at_check_line_file"
1253  at_check_trace=$at_traceon at_check_filter=$at_check_filter_trace
1254  : >"$at_stdout"; : >"$at_stderr"
1255}
1256
1257# at_fn_check_prepare_dynamic COMMAND LINE
1258# ----------------------------------------
1259# Decide if COMMAND at LINE is traceable at runtime, and call the appropriate
1260# preparation function.
1261at_fn_check_prepare_dynamic ()
1262{
1263  case $1 in
1264    *$as_nl*)
1265      at_fn_check_prepare_notrace 'an embedded newline' "$2" ;;
1266    *)
1267      at_fn_check_prepare_trace "$2" ;;
1268  esac
1269}
1270
1271# at_fn_filter_trace
1272# ------------------
1273# Remove the lines in the file "$at_stderr" generated by "set -x" and print
1274# them to stderr.
1275at_fn_filter_trace ()
1276{
1277  mv "$at_stderr" "$at_stder1"
1278  grep '^ *+' "$at_stder1" >&2
1279  grep -v '^ *+' "$at_stder1" >"$at_stderr"
1280}
1281
1282# at_fn_log_failure FILE-LIST
1283# ---------------------------
1284# Copy the files in the list on stdout with a "> " prefix, and exit the shell
1285# with a failure exit code.
1286at_fn_log_failure ()
1287{
1288  for file
1289    do $as_echo "$file:"; sed 's/^/> /' "$file"; done
1290  echo 1 > "$at_status_file"
1291  exit 1
1292}
1293
1294# at_fn_check_skip EXIT-CODE LINE
1295# -------------------------------
1296# Check whether EXIT-CODE is a special exit code (77 or 99), and if so exit
1297# the test group subshell with that same exit code. Use LINE in any report
1298# about test failure.
1299at_fn_check_skip ()
1300{
1301  case $1 in
1302    99) echo 99 > "$at_status_file"; at_failed=:
1303	$as_echo "$2: hard failure"; exit 99;;
1304    77) echo 77 > "$at_status_file"; exit 77;;
1305  esac
1306}
1307
1308# at_fn_check_status EXPECTED EXIT-CODE LINE
1309# ------------------------------------------
1310# Check whether EXIT-CODE is the EXPECTED exit code, and if so do nothing.
1311# Otherwise, if it is 77 or 99, exit the test group subshell with that same
1312# exit code; if it is anything else print an error message referring to LINE,
1313# and fail the test.
1314at_fn_check_status ()
1315{
1316  case $2 in
1317    $1 ) ;;
1318    77) echo 77 > "$at_status_file"; exit 77;;
1319    99) echo 99 > "$at_status_file"; at_failed=:
1320	$as_echo "$3: hard failure"; exit 99;;
1321    *) $as_echo "$3: exit code was $2, expected $1"
1322      at_failed=:;;
1323  esac
1324}
1325
1326# at_fn_diff_devnull FILE
1327# -----------------------
1328# Emit a diff between /dev/null and FILE. Uses "test -s" to avoid useless diff
1329# invocations.
1330at_fn_diff_devnull ()
1331{
1332  test -s "$1" || return 0
1333  $at_diff "$at_devnull" "$1"
1334}
1335
1336# at_fn_test NUMBER
1337# -----------------
1338# Parse out test NUMBER from the tail of this file.
1339at_fn_test ()
1340{
1341  eval at_sed=\$at_sed$1
1342  sed "$at_sed" "$at_myself" > "$at_test_source"
1343}
1344
1345# at_fn_create_debugging_script
1346# -----------------------------
1347# Create the debugging script $at_group_dir/run which will reproduce the
1348# current test group.
1349at_fn_create_debugging_script ()
1350{
1351  {
1352    echo "#! /bin/sh" &&
1353    echo 'test "${ZSH_VERSION+set}" = set && alias -g '\''${1+"$@"}'\''='\''"$@"'\''' &&
1354    $as_echo "cd '$at_dir'" &&
1355    $as_echo "exec \${CONFIG_SHELL-$SHELL} \"$at_myself\" -v -d $at_debug_args $at_group \${1+\"\$@\"}" &&
1356    echo 'exit 1'
1357  } >"$at_group_dir/run" &&
1358  chmod +x "$at_group_dir/run"
1359}
1360
1361## -------------------------------- ##
1362## End of autotest shell functions. ##
1363## -------------------------------- ##
1364{
1365  $as_echo "## ---------------- ##
1366## Tested programs. ##
1367## ---------------- ##"
1368  echo
1369} >&5
1370
1371# Report what programs are being tested.
1372for at_program in : $at_tested
1373do
1374  test "$at_program" = : && continue
1375  case $at_program in
1376    [\\/]* | ?:[\\/]* ) $at_program_=$at_program ;;
1377    * )
1378    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1379for as_dir in $PATH
1380do
1381  IFS=$as_save_IFS
1382  test -z "$as_dir" && as_dir=.
1383    test -f "$as_dir/$at_program" && break
1384  done
1385IFS=$as_save_IFS
1386
1387    at_program_=$as_dir/$at_program ;;
1388  esac
1389  if test -f "$at_program_"; then
1390    {
1391      $as_echo "$at_srcdir/testsuite.at:19: $at_program_ --version"
1392      "$at_program_" --version </dev/null
1393      echo
1394    } >&5 2>&1
1395  else
1396    as_fn_error $? "cannot find $at_program" "$LINENO" 5
1397  fi
1398done
1399
1400{
1401  $as_echo "## ------------------ ##
1402## Running the tests. ##
1403## ------------------ ##"
1404} >&5
1405
1406at_start_date=`date`
1407at_start_time=`date +%s 2>/dev/null`
1408$as_echo "$as_me: starting at: $at_start_date" >&5
1409
1410# Create the master directory if it doesn't already exist.
1411as_dir="$at_suite_dir"; as_fn_mkdir_p ||
1412  as_fn_error $? "cannot create \`$at_suite_dir'" "$LINENO" 5
1413
1414# Can we diff with `/dev/null'?  DU 5.0 refuses.
1415if diff /dev/null /dev/null >/dev/null 2>&1; then
1416  at_devnull=/dev/null
1417else
1418  at_devnull=$at_suite_dir/devnull
1419  >"$at_devnull"
1420fi
1421
1422# Use `diff -u' when possible.
1423if at_diff=`diff -u "$at_devnull" "$at_devnull" 2>&1` && test -z "$at_diff"
1424then
1425  at_diff='diff -u'
1426else
1427  at_diff=diff
1428fi
1429
1430# Get the last needed group.
1431for at_group in : $at_groups; do :; done
1432
1433# Extract the start and end lines of each test group at the tail
1434# of this file
1435awk '
1436BEGIN { FS="" }
1437/^#AT_START_/ {
1438  start = NR
1439}
1440/^#AT_STOP_/ {
1441  test = substr ($ 0, 10)
1442  print "at_sed" test "=\"1," start "d;" (NR-1) "q\""
1443  if (test == "'"$at_group"'") exit
1444}' "$at_myself" > "$at_suite_dir/at-source-lines" &&
1445. "$at_suite_dir/at-source-lines" ||
1446  as_fn_error $? "cannot create test line number cache" "$LINENO" 5
1447rm -f "$at_suite_dir/at-source-lines"
1448
1449# Set number of jobs for `-j'; avoid more jobs than test groups.
1450set X $at_groups; shift; at_max_jobs=$#
1451if test $at_max_jobs -eq 0; then
1452  at_jobs=1
1453fi
1454if test $at_jobs -ne 1 &&
1455   { test $at_jobs -eq 0 || test $at_jobs -gt $at_max_jobs; }; then
1456  at_jobs=$at_max_jobs
1457fi
1458
1459# If parallel mode, don't output banners, don't split summary lines.
1460if test $at_jobs -ne 1; then
1461  at_print_banners=false
1462  at_quiet=:
1463fi
1464
1465# Set up helper dirs.
1466rm -rf "$at_helper_dir" &&
1467mkdir "$at_helper_dir" &&
1468cd "$at_helper_dir" &&
1469{ test -z "$at_groups" || mkdir $at_groups; } ||
1470as_fn_error $? "testsuite directory setup failed" "$LINENO" 5
1471
1472# Functions for running a test group.  We leave the actual
1473# test group execution outside of a shell function in order
1474# to avoid hitting zsh 4.x exit status bugs.
1475
1476# at_fn_group_prepare
1477# -------------------
1478# Prepare for running a test group.
1479at_fn_group_prepare ()
1480{
1481  # The directory for additional per-group helper files.
1482  at_job_dir=$at_helper_dir/$at_group
1483  # The file containing the location of the last AT_CHECK.
1484  at_check_line_file=$at_job_dir/check-line
1485  # The file containing the exit status of the last command.
1486  at_status_file=$at_job_dir/status
1487  # The files containing the output of the tested commands.
1488  at_stdout=$at_job_dir/stdout
1489  at_stder1=$at_job_dir/stder1
1490  at_stderr=$at_job_dir/stderr
1491  # The file containing the code for a test group.
1492  at_test_source=$at_job_dir/test-source
1493  # The file containing dates.
1494  at_times_file=$at_job_dir/times
1495
1496  # Be sure to come back to the top test directory.
1497  cd "$at_suite_dir"
1498
1499  # Clearly separate the test groups when verbose.
1500  $at_first || $at_verbose echo
1501
1502  at_group_normalized=$at_group
1503
1504  eval 'while :; do
1505    case $at_group_normalized in #(
1506    '"$at_format"'*) break;;
1507    esac
1508    at_group_normalized=0$at_group_normalized
1509  done'
1510
1511
1512  # Create a fresh directory for the next test group, and enter.
1513  # If one already exists, the user may have invoked ./run from
1514  # within that directory; we remove the contents, but not the
1515  # directory itself, so that we aren't pulling the rug out from
1516  # under the shell's notion of the current directory.
1517  at_group_dir=$at_suite_dir/$at_group_normalized
1518  at_group_log=$at_group_dir/$as_me.log
1519  if test -d "$at_group_dir"; then
1520  find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx {} \;
1521  rm -fr "$at_group_dir"/* "$at_group_dir"/.[!.] "$at_group_dir"/.??*
1522fi ||
1523    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: test directory for $at_group_normalized could not be cleaned" >&5
1524$as_echo "$as_me: WARNING: test directory for $at_group_normalized could not be cleaned" >&2;}
1525  # Be tolerant if the above `rm' was not able to remove the directory.
1526  as_dir="$at_group_dir"; as_fn_mkdir_p
1527
1528  echo 0 > "$at_status_file"
1529
1530  # In verbose mode, append to the log file *and* show on
1531  # the standard output; in quiet mode only write to the log.
1532  if test -z "$at_verbose"; then
1533    at_tee_pipe='tee -a "$at_group_log"'
1534  else
1535    at_tee_pipe='cat >> "$at_group_log"'
1536  fi
1537}
1538
1539# at_fn_group_banner ORDINAL LINE DESC PAD [BANNER]
1540# -------------------------------------------------
1541# Declare the test group ORDINAL, located at LINE with group description DESC,
1542# and residing under BANNER. Use PAD to align the status column.
1543at_fn_group_banner ()
1544{
1545  at_setup_line="$2"
1546  test -n "$5" && at_fn_banner $5
1547  at_desc="$3"
1548  case $1 in
1549    [0-9])      at_desc_line="  $1: ";;
1550    [0-9][0-9]) at_desc_line=" $1: " ;;
1551    *)          at_desc_line="$1: "  ;;
1552  esac
1553  as_fn_append at_desc_line "$3$4"
1554  $at_quiet $as_echo_n "$at_desc_line"
1555  echo "#                             -*- compilation -*-" >> "$at_group_log"
1556}
1557
1558# at_fn_group_postprocess
1559# -----------------------
1560# Perform cleanup after running a test group.
1561at_fn_group_postprocess ()
1562{
1563  # Be sure to come back to the suite directory, in particular
1564  # since below we might `rm' the group directory we are in currently.
1565  cd "$at_suite_dir"
1566
1567  if test ! -f "$at_check_line_file"; then
1568    sed "s/^ */$as_me: WARNING: /" <<_ATEOF
1569      A failure happened in a test group before any test could be
1570      run. This means that test suite is improperly designed.  Please
1571      report this failure to <bug-dico@gnu.org>.
1572_ATEOF
1573    $as_echo "$at_setup_line" >"$at_check_line_file"
1574    at_status=99
1575  fi
1576  $at_verbose $as_echo_n "$at_group. $at_setup_line: "
1577  $as_echo_n "$at_group. $at_setup_line: " >> "$at_group_log"
1578  case $at_xfail:$at_status in
1579    yes:0)
1580	at_msg="UNEXPECTED PASS"
1581	at_res=xpass
1582	at_errexit=$at_errexit_p
1583	at_color=$at_red
1584	;;
1585    no:0)
1586	at_msg="ok"
1587	at_res=pass
1588	at_errexit=false
1589	at_color=$at_grn
1590	;;
1591    *:77)
1592	at_msg='skipped ('`cat "$at_check_line_file"`')'
1593	at_res=skip
1594	at_errexit=false
1595	at_color=$at_blu
1596	;;
1597    no:* | *:99)
1598	at_msg='FAILED ('`cat "$at_check_line_file"`')'
1599	at_res=fail
1600	at_errexit=$at_errexit_p
1601	at_color=$at_red
1602	;;
1603    yes:*)
1604	at_msg='expected failure ('`cat "$at_check_line_file"`')'
1605	at_res=xfail
1606	at_errexit=false
1607	at_color=$at_lgn
1608	;;
1609  esac
1610  echo "$at_res" > "$at_job_dir/$at_res"
1611  # In parallel mode, output the summary line only afterwards.
1612  if test $at_jobs -ne 1 && test -n "$at_verbose"; then
1613    $as_echo "$at_desc_line $at_color$at_msg$at_std"
1614  else
1615    # Make sure there is a separator even with long titles.
1616    $as_echo " $at_color$at_msg$at_std"
1617  fi
1618  at_log_msg="$at_group. $at_desc ($at_setup_line): $at_msg"
1619  case $at_status in
1620    0|77)
1621      # $at_times_file is only available if the group succeeded.
1622      # We're not including the group log, so the success message
1623      # is written in the global log separately.  But we also
1624      # write to the group log in case they're using -d.
1625      if test -f "$at_times_file"; then
1626	at_log_msg="$at_log_msg     ("`sed 1d "$at_times_file"`')'
1627	rm -f "$at_times_file"
1628      fi
1629      $as_echo "$at_log_msg" >> "$at_group_log"
1630      $as_echo "$at_log_msg" >&5
1631
1632      # Cleanup the group directory, unless the user wants the files
1633      # or the success was unexpected.
1634      if $at_debug_p || test $at_res = xpass; then
1635	at_fn_create_debugging_script
1636	if test $at_res = xpass && $at_errexit; then
1637	  echo stop > "$at_stop_file"
1638	fi
1639      else
1640	if test -d "$at_group_dir"; then
1641	  find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \;
1642	  rm -fr "$at_group_dir"
1643	fi
1644	rm -f "$at_test_source"
1645      fi
1646      ;;
1647    *)
1648      # Upon failure, include the log into the testsuite's global
1649      # log.  The failure message is written in the group log.  It
1650      # is later included in the global log.
1651      $as_echo "$at_log_msg" >> "$at_group_log"
1652
1653      # Upon failure, keep the group directory for autopsy, and create
1654      # the debugging script.  With -e, do not start any further tests.
1655      at_fn_create_debugging_script
1656      if $at_errexit; then
1657	echo stop > "$at_stop_file"
1658      fi
1659      ;;
1660  esac
1661}
1662
1663
1664## ------------ ##
1665## Driver loop. ##
1666## ------------ ##
1667
1668
1669if (set -m && set +m && set +b) >/dev/null 2>&1; then
1670  set +b
1671  at_job_control_on='set -m' at_job_control_off='set +m' at_job_group=-
1672else
1673  at_job_control_on=: at_job_control_off=: at_job_group=
1674fi
1675
1676for at_signal in 1 2 15; do
1677  trap 'set +x; set +e
1678	$at_job_control_off
1679	at_signal='"$at_signal"'
1680	echo stop > "$at_stop_file"
1681	trap "" $at_signal
1682	at_pgids=
1683	for at_pgid in `jobs -p 2>/dev/null`; do
1684	  at_pgids="$at_pgids $at_job_group$at_pgid"
1685	done
1686	test -z "$at_pgids" || kill -$at_signal $at_pgids 2>/dev/null
1687	wait
1688	if test "$at_jobs" -eq 1 || test -z "$at_verbose"; then
1689	  echo >&2
1690	fi
1691	at_signame=`kill -l $at_signal 2>&1 || echo $at_signal`
1692	set x $at_signame
1693	test 0 -gt 2 && at_signame=$at_signal
1694	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: caught signal $at_signame, bailing out" >&5
1695$as_echo "$as_me: WARNING: caught signal $at_signame, bailing out" >&2;}
1696	as_fn_arith 128 + $at_signal && exit_status=$as_val
1697	as_fn_exit $exit_status' $at_signal
1698done
1699
1700rm -f "$at_stop_file"
1701at_first=:
1702
1703if test $at_jobs -ne 1 &&
1704     rm -f "$at_job_fifo" &&
1705     test -n "$at_job_group" &&
1706     ( mkfifo "$at_job_fifo" && trap 'exit 1' PIPE STOP TSTP ) 2>/dev/null
1707then
1708  # FIFO job dispatcher.
1709
1710  trap 'at_pids=
1711	for at_pid in `jobs -p`; do
1712	  at_pids="$at_pids $at_job_group$at_pid"
1713	done
1714	if test -n "$at_pids"; then
1715	  at_sig=TSTP
1716	  test "${TMOUT+set}" = set && at_sig=STOP
1717	  kill -$at_sig $at_pids 2>/dev/null
1718	fi
1719	kill -STOP $$
1720	test -z "$at_pids" || kill -CONT $at_pids 2>/dev/null' TSTP
1721
1722  echo
1723  # Turn jobs into a list of numbers, starting from 1.
1724  at_joblist=`$as_echo "$at_groups" | sed -n 1,${at_jobs}p`
1725
1726  set X $at_joblist
1727  shift
1728  for at_group in $at_groups; do
1729    $at_job_control_on 2>/dev/null
1730    (
1731      # Start one test group.
1732      $at_job_control_off
1733      if $at_first; then
1734	exec 7>"$at_job_fifo"
1735      else
1736	exec 6<&-
1737      fi
1738      trap 'set +x; set +e
1739	    trap "" PIPE
1740	    echo stop > "$at_stop_file"
1741	    echo >&7
1742	    as_fn_exit 141' PIPE
1743      at_fn_group_prepare
1744      if cd "$at_group_dir" &&
1745	 at_fn_test $at_group &&
1746	 . "$at_test_source"
1747      then :; else
1748	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5
1749$as_echo "$as_me: WARNING: unable to parse test group: $at_group" >&2;}
1750	at_failed=:
1751      fi
1752      at_fn_group_postprocess
1753      echo >&7
1754    ) &
1755    $at_job_control_off
1756    if $at_first; then
1757      at_first=false
1758      exec 6<"$at_job_fifo" 7>"$at_job_fifo"
1759    fi
1760    shift # Consume one token.
1761    if test $# -gt 0; then :; else
1762      read at_token <&6 || break
1763      set x $*
1764    fi
1765    test -f "$at_stop_file" && break
1766  done
1767  exec 7>&-
1768  # Read back the remaining ($at_jobs - 1) tokens.
1769  set X $at_joblist
1770  shift
1771  if test $# -gt 0; then
1772    shift
1773    for at_job
1774    do
1775      read at_token
1776    done <&6
1777  fi
1778  exec 6<&-
1779  wait
1780else
1781  # Run serially, avoid forks and other potential surprises.
1782  for at_group in $at_groups; do
1783    at_fn_group_prepare
1784    if cd "$at_group_dir" &&
1785       at_fn_test $at_group &&
1786       . "$at_test_source"; then :; else
1787      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5
1788$as_echo "$as_me: WARNING: unable to parse test group: $at_group" >&2;}
1789      at_failed=:
1790    fi
1791    at_fn_group_postprocess
1792    test -f "$at_stop_file" && break
1793    at_first=false
1794  done
1795fi
1796
1797# Wrap up the test suite with summary statistics.
1798cd "$at_helper_dir"
1799
1800# Use ?..???? when the list must remain sorted, the faster * otherwise.
1801at_pass_list=`for f in */pass; do echo $f; done | sed '/\*/d; s,/pass,,'`
1802at_skip_list=`for f in */skip; do echo $f; done | sed '/\*/d; s,/skip,,'`
1803at_xfail_list=`for f in */xfail; do echo $f; done | sed '/\*/d; s,/xfail,,'`
1804at_xpass_list=`for f in ?/xpass ??/xpass ???/xpass ????/xpass; do
1805		 echo $f; done | sed '/?/d; s,/xpass,,'`
1806at_fail_list=`for f in ?/fail ??/fail ???/fail ????/fail; do
1807		echo $f; done | sed '/?/d; s,/fail,,'`
1808
1809set X $at_pass_list $at_xpass_list $at_xfail_list $at_fail_list $at_skip_list
1810shift; at_group_count=$#
1811set X $at_xpass_list; shift; at_xpass_count=$#; at_xpass_list=$*
1812set X $at_xfail_list; shift; at_xfail_count=$#
1813set X $at_fail_list; shift; at_fail_count=$#; at_fail_list=$*
1814set X $at_skip_list; shift; at_skip_count=$#
1815
1816as_fn_arith $at_group_count - $at_skip_count && at_run_count=$as_val
1817as_fn_arith $at_xpass_count + $at_fail_count && at_unexpected_count=$as_val
1818as_fn_arith $at_xfail_count + $at_fail_count && at_total_fail_count=$as_val
1819
1820# Back to the top directory.
1821cd "$at_dir"
1822rm -rf "$at_helper_dir"
1823
1824# Compute the duration of the suite.
1825at_stop_date=`date`
1826at_stop_time=`date +%s 2>/dev/null`
1827$as_echo "$as_me: ending at: $at_stop_date" >&5
1828case $at_start_time,$at_stop_time in
1829  [0-9]*,[0-9]*)
1830    as_fn_arith $at_stop_time - $at_start_time && at_duration_s=$as_val
1831    as_fn_arith $at_duration_s / 60 && at_duration_m=$as_val
1832    as_fn_arith $at_duration_m / 60 && at_duration_h=$as_val
1833    as_fn_arith $at_duration_s % 60 && at_duration_s=$as_val
1834    as_fn_arith $at_duration_m % 60 && at_duration_m=$as_val
1835    at_duration="${at_duration_h}h ${at_duration_m}m ${at_duration_s}s"
1836    $as_echo "$as_me: test suite duration: $at_duration" >&5
1837    ;;
1838esac
1839
1840echo
1841$as_echo "## ------------- ##
1842## Test results. ##
1843## ------------- ##"
1844echo
1845{
1846  echo
1847  $as_echo "## ------------- ##
1848## Test results. ##
1849## ------------- ##"
1850  echo
1851} >&5
1852
1853if test $at_run_count = 1; then
1854  at_result="1 test"
1855  at_were=was
1856else
1857  at_result="$at_run_count tests"
1858  at_were=were
1859fi
1860if $at_errexit_p && test $at_unexpected_count != 0; then
1861  if test $at_xpass_count = 1; then
1862    at_result="$at_result $at_were run, one passed"
1863  else
1864    at_result="$at_result $at_were run, one failed"
1865  fi
1866  at_result="$at_result unexpectedly and inhibited subsequent tests."
1867  at_color=$at_red
1868else
1869  # Don't you just love exponential explosion of the number of cases?
1870  at_color=$at_red
1871  case $at_xpass_count:$at_fail_count:$at_xfail_count in
1872    # So far, so good.
1873    0:0:0) at_result="$at_result $at_were successful." at_color=$at_grn ;;
1874    0:0:*) at_result="$at_result behaved as expected." at_color=$at_lgn ;;
1875
1876    # Some unexpected failures
1877    0:*:0) at_result="$at_result $at_were run,
1878$at_fail_count failed unexpectedly." ;;
1879
1880    # Some failures, both expected and unexpected
1881    0:*:1) at_result="$at_result $at_were run,
1882$at_total_fail_count failed ($at_xfail_count expected failure)." ;;
1883    0:*:*) at_result="$at_result $at_were run,
1884$at_total_fail_count failed ($at_xfail_count expected failures)." ;;
1885
1886    # No unexpected failures, but some xpasses
1887    *:0:*) at_result="$at_result $at_were run,
1888$at_xpass_count passed unexpectedly." ;;
1889
1890    # No expected failures, but failures and xpasses
1891    *:1:0) at_result="$at_result $at_were run,
1892$at_unexpected_count did not behave as expected ($at_fail_count unexpected failure)." ;;
1893    *:*:0) at_result="$at_result $at_were run,
1894$at_unexpected_count did not behave as expected ($at_fail_count unexpected failures)." ;;
1895
1896    # All of them.
1897    *:*:1) at_result="$at_result $at_were run,
1898$at_xpass_count passed unexpectedly,
1899$at_total_fail_count failed ($at_xfail_count expected failure)." ;;
1900    *:*:*) at_result="$at_result $at_were run,
1901$at_xpass_count passed unexpectedly,
1902$at_total_fail_count failed ($at_xfail_count expected failures)." ;;
1903  esac
1904
1905  if test $at_skip_count = 0 && test $at_run_count -gt 1; then
1906    at_result="All $at_result"
1907  fi
1908fi
1909
1910# Now put skips in the mix.
1911case $at_skip_count in
1912  0) ;;
1913  1) at_result="$at_result
19141 test was skipped." ;;
1915  *) at_result="$at_result
1916$at_skip_count tests were skipped." ;;
1917esac
1918
1919if test $at_unexpected_count = 0; then
1920  echo "$at_color$at_result$at_std"
1921  echo "$at_result" >&5
1922else
1923  echo "${at_color}ERROR: $at_result$at_std" >&2
1924  echo "ERROR: $at_result" >&5
1925  {
1926    echo
1927    $as_echo "## ------------------------ ##
1928## Summary of the failures. ##
1929## ------------------------ ##"
1930
1931    # Summary of failed and skipped tests.
1932    if test $at_fail_count != 0; then
1933      echo "Failed tests:"
1934      $SHELL "$at_myself" $at_fail_list --list
1935      echo
1936    fi
1937    if test $at_skip_count != 0; then
1938      echo "Skipped tests:"
1939      $SHELL "$at_myself" $at_skip_list --list
1940      echo
1941    fi
1942    if test $at_xpass_count != 0; then
1943      echo "Unexpected passes:"
1944      $SHELL "$at_myself" $at_xpass_list --list
1945      echo
1946    fi
1947    if test $at_fail_count != 0; then
1948      $as_echo "## ---------------------- ##
1949## Detailed failed tests. ##
1950## ---------------------- ##"
1951      echo
1952      for at_group in $at_fail_list
1953      do
1954	at_group_normalized=$at_group
1955
1956  eval 'while :; do
1957    case $at_group_normalized in #(
1958    '"$at_format"'*) break;;
1959    esac
1960    at_group_normalized=0$at_group_normalized
1961  done'
1962
1963	cat "$at_suite_dir/$at_group_normalized/$as_me.log"
1964	echo
1965      done
1966      echo
1967    fi
1968    if test -n "$at_top_srcdir"; then
1969      sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
1970## ${at_top_build_prefix}config.log ##
1971_ASBOX
1972      sed 's/^/| /' ${at_top_build_prefix}config.log
1973      echo
1974    fi
1975  } >&5
1976
1977  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
1978## $as_me.log was created. ##
1979_ASBOX
1980
1981  echo
1982  if $at_debug_p; then
1983    at_msg='per-test log files'
1984  else
1985    at_msg="\`${at_testdir+${at_testdir}/}$as_me.log'"
1986  fi
1987  $as_echo "Please send $at_msg and all information you think might help:
1988
1989   To: <bug-dico@gnu.org>
1990   Subject: [GNU dico 2.10] $as_me: $at_fail_list${at_fail_list:+ failed${at_xpass_list:+, }}$at_xpass_list${at_xpass_list:+ passed unexpectedly}
1991
1992You may investigate any problem if you feel able to do so, in which
1993case the test suite provides a good starting point.  Its output may
1994be found below \`${at_testdir+${at_testdir}/}$as_me.dir'.
1995"
1996  exit 1
1997fi
1998
1999exit 0
2000
2001## ------------- ##
2002## Actual tests. ##
2003## ------------- ##
2004#AT_START_1
2005at_fn_group_banner 1 'exact.at:17' \
2006  "exact" "                                          " 1
2007at_xfail=no
2008(
2009  $as_echo "1. $at_setup_line: testing $at_desc ..."
2010  $at_traceon
2011
2012
2013
2014cat >input <<'_ATEOF'
2015match plnum exact seven
2016quit
2017_ATEOF
2018
2019{ set +x
2020$as_echo "$at_srcdir/exact.at:19: (dicod --config \$abs_builddir/dicod.conf --stderr -i < input  2>dicod.err| tr -d '\\r' | sed 's/^\\(2[25][0-9]\\) .*/\\1/;s/ *\$//' ; cat dicod.err|sed  's/^dicod: Error: //;/^;;;/d' >&2)"
2021at_fn_check_prepare_notrace 'a shell pipeline' "exact.at:19"
2022( $at_check_trace; (dicod --config $abs_builddir/dicod.conf --stderr -i < input  2>dicod.err| tr -d '\r' | sed 's/^\(2[25][0-9]\) .*/\1/;s/ *$//' ; cat dicod.err|sed  's/^dicod: Error: //;/^;;;/d' >&2)
2023) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2024at_status=$? at_failed=false
2025$at_check_filter
2026at_fn_diff_devnull "$at_stderr" || at_failed=:
2027echo >>"$at_stdout"; $as_echo "220
2028152 1 matches found: list follows
2029plnum \"seven\"
2030.
2031250
2032221
2033" | \
2034  $at_diff - "$at_stdout" || at_failed=:
2035at_fn_check_status 0 $at_status "$at_srcdir/exact.at:19"
2036$at_failed && at_fn_log_failure
2037$at_traceon; }
2038
2039  set +x
2040  $at_times_p && times >"$at_times_file"
2041) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2042read at_status <"$at_status_file"
2043#AT_STOP_1
2044#AT_START_2
2045at_fn_group_banner 2 'prefix.at:17' \
2046  "prefix" "                                         " 1
2047at_xfail=no
2048(
2049  $as_echo "2. $at_setup_line: testing $at_desc ..."
2050  $at_traceon
2051
2052
2053
2054cat >input <<'_ATEOF'
2055match plnum prefix f
2056quit
2057_ATEOF
2058
2059{ set +x
2060$as_echo "$at_srcdir/prefix.at:19: (dicod --config \$abs_builddir/dicod.conf --stderr -i < input  2>dicod.err| tr -d '\\r' | sed 's/^\\(2[25][0-9]\\) .*/\\1/;s/ *\$//' ; cat dicod.err|sed  's/^dicod: Error: //;/^;;;/d' >&2)"
2061at_fn_check_prepare_notrace 'a shell pipeline' "prefix.at:19"
2062( $at_check_trace; (dicod --config $abs_builddir/dicod.conf --stderr -i < input  2>dicod.err| tr -d '\r' | sed 's/^\(2[25][0-9]\) .*/\1/;s/ *$//' ; cat dicod.err|sed  's/^dicod: Error: //;/^;;;/d' >&2)
2063) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2064at_status=$? at_failed=false
2065$at_check_filter
2066at_fn_diff_devnull "$at_stderr" || at_failed=:
2067echo >>"$at_stdout"; $as_echo "220
2068152 2 matches found: list follows
2069plnum \"four\"
2070plnum \"five\"
2071.
2072250
2073221
2074" | \
2075  $at_diff - "$at_stdout" || at_failed=:
2076at_fn_check_status 0 $at_status "$at_srcdir/prefix.at:19"
2077$at_failed && at_fn_log_failure
2078$at_traceon; }
2079
2080  set +x
2081  $at_times_p && times >"$at_times_file"
2082) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2083read at_status <"$at_status_file"
2084#AT_STOP_2
2085#AT_START_3
2086at_fn_group_banner 3 'suffix.at:17' \
2087  "suffix" "                                         " 1
2088at_xfail=no
2089(
2090  $as_echo "3. $at_setup_line: testing $at_desc ..."
2091  $at_traceon
2092
2093
2094
2095cat >input <<'_ATEOF'
2096match plnum suffix ne
2097quit
2098_ATEOF
2099
2100{ set +x
2101$as_echo "$at_srcdir/suffix.at:19: (dicod --config \$abs_builddir/dicod.conf --stderr -i < input  2>dicod.err| tr -d '\\r' | sed 's/^\\(2[25][0-9]\\) .*/\\1/;s/ *\$//' ; cat dicod.err|sed  's/^dicod: Error: //;/^;;;/d' >&2)"
2102at_fn_check_prepare_notrace 'a shell pipeline' "suffix.at:19"
2103( $at_check_trace; (dicod --config $abs_builddir/dicod.conf --stderr -i < input  2>dicod.err| tr -d '\r' | sed 's/^\(2[25][0-9]\) .*/\1/;s/ *$//' ; cat dicod.err|sed  's/^dicod: Error: //;/^;;;/d' >&2)
2104) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2105at_status=$? at_failed=false
2106$at_check_filter
2107at_fn_diff_devnull "$at_stderr" || at_failed=:
2108echo >>"$at_stdout"; $as_echo "220
2109152 2 matches found: list follows
2110plnum \"one\"
2111plnum \"nine\"
2112.
2113250
2114221
2115" | \
2116  $at_diff - "$at_stdout" || at_failed=:
2117at_fn_check_status 0 $at_status "$at_srcdir/suffix.at:19"
2118$at_failed && at_fn_log_failure
2119$at_traceon; }
2120
2121  set +x
2122  $at_times_p && times >"$at_times_file"
2123) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2124read at_status <"$at_status_file"
2125#AT_STOP_3
2126#AT_START_4
2127at_fn_group_banner 4 'lev.at:17' \
2128  "Levenshtein" "                                    " 1
2129at_xfail=no
2130(
2131  $as_echo "4. $at_setup_line: testing $at_desc ..."
2132  $at_traceon
2133
2134
2135
2136cat >input <<'_ATEOF'
2137match plnum lev sven
2138quit
2139_ATEOF
2140
2141{ set +x
2142$as_echo "$at_srcdir/lev.at:19: dicod --config \$abs_builddir/dicod.conf --stderr -i < input  | tr -d '\\r' | sed 's/^\\(2[25][0-9]\\) .*/\\1/;s/ *\$//' "
2143at_fn_check_prepare_notrace 'a shell pipeline' "lev.at:19"
2144( $at_check_trace; dicod --config $abs_builddir/dicod.conf --stderr -i < input  | tr -d '\r' | sed 's/^\(2[25][0-9]\) .*/\1/;s/ *$//'
2145) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2146at_status=$? at_failed=false
2147$at_check_filter
2148at_fn_diff_devnull "$at_stderr" || at_failed=:
2149echo >>"$at_stdout"; $as_echo "220
2150152 1 matches found: list follows
2151plnum \"seven\"
2152.
2153250
2154221
2155" | \
2156  $at_diff - "$at_stdout" || at_failed=:
2157at_fn_check_status 0 $at_status "$at_srcdir/lev.at:19"
2158$at_failed && at_fn_log_failure
2159$at_traceon; }
2160
2161  set +x
2162  $at_times_p && times >"$at_times_file"
2163) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2164read at_status <"$at_status_file"
2165#AT_STOP_4
2166#AT_START_5
2167at_fn_group_banner 5 'define.at:17' \
2168  "define" "                                         " 2
2169at_xfail=no
2170(
2171  $as_echo "5. $at_setup_line: testing $at_desc ..."
2172  $at_traceon
2173
2174
2175
2176cat >input <<'_ATEOF'
2177define plnum seven
2178quit
2179_ATEOF
2180
2181{ set +x
2182$as_echo "$at_srcdir/define.at:19: (dicod --config \$abs_builddir/dicod.conf --stderr -i < input  2>dicod.err| tr -d '\\r' | sed 's/^\\(2[25][0-9]\\) .*/\\1/;s/ *\$//' ; cat dicod.err|sed  's/^dicod: Error: //;/^;;;/d' >&2)"
2183at_fn_check_prepare_notrace 'a shell pipeline' "define.at:19"
2184( $at_check_trace; (dicod --config $abs_builddir/dicod.conf --stderr -i < input  2>dicod.err| tr -d '\r' | sed 's/^\(2[25][0-9]\) .*/\1/;s/ *$//' ; cat dicod.err|sed  's/^dicod: Error: //;/^;;;/d' >&2)
2185) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2186at_status=$? at_failed=false
2187$at_check_filter
2188at_fn_diff_devnull "$at_stderr" || at_failed=:
2189echo >>"$at_stdout"; $as_echo "220
2190150 1 definitions found: list follows
2191151 \"seven\" plnum \"Short English-Polish numerals dictionary\"
2192seven
2193siedem
2194.
2195250
2196221
2197" | \
2198  $at_diff - "$at_stdout" || at_failed=:
2199at_fn_check_status 0 $at_status "$at_srcdir/define.at:19"
2200$at_failed && at_fn_log_failure
2201$at_traceon; }
2202
2203  set +x
2204  $at_times_p && times >"$at_times_file"
2205) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2206read at_status <"$at_status_file"
2207#AT_STOP_5
2208#AT_START_6
2209at_fn_group_banner 6 'mime.at:17' \
2210  "db-mime-header" "                                 " 2
2211at_xfail=no
2212(
2213  $as_echo "6. $at_setup_line: testing $at_desc ..."
2214  $at_traceon
2215
2216
2217
2218cat >input <<'_ATEOF'
2219option mime
2220define plnum seven
2221quit
2222_ATEOF
2223
2224{ set +x
2225$as_echo "$at_srcdir/mime.at:19: (dicod --config \$abs_builddir/dicod.conf --stderr -i < input  2>dicod.err| tr -d '\\r' | sed 's/^\\(2[25][0-9]\\) .*/\\1/;s/ *\$//' ; cat dicod.err|sed  's/^dicod: Error: //;/^;;;/d' >&2)"
2226at_fn_check_prepare_notrace 'a shell pipeline' "mime.at:19"
2227( $at_check_trace; (dicod --config $abs_builddir/dicod.conf --stderr -i < input  2>dicod.err| tr -d '\r' | sed 's/^\(2[25][0-9]\) .*/\1/;s/ *$//' ; cat dicod.err|sed  's/^dicod: Error: //;/^;;;/d' >&2)
2228) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2229at_status=$? at_failed=false
2230$at_check_filter
2231at_fn_diff_devnull "$at_stderr" || at_failed=:
2232echo >>"$at_stdout"; $as_echo "220
2233250
2234150 1 definitions found: list follows
2235151 \"seven\" plnum \"Short English-Polish numerals dictionary\"
2236Content-Type: text/plain; charset=UTF-8
2237Content-Transfer-Encoding: 8bit
2238
2239seven
2240siedem
2241.
2242250
2243221
2244" | \
2245  $at_diff - "$at_stdout" || at_failed=:
2246at_fn_check_status 0 $at_status "$at_srcdir/mime.at:19"
2247$at_failed && at_fn_log_failure
2248$at_traceon; }
2249
2250  set +x
2251  $at_times_p && times >"$at_times_file"
2252) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2253read at_status <"$at_status_file"
2254#AT_STOP_6
2255#AT_START_7
2256at_fn_group_banner 7 'mime2.at:17' \
2257  "result-headers" "                                 " 2
2258at_xfail=no
2259(
2260  $as_echo "7. $at_setup_line: testing $at_desc ..."
2261  $at_traceon
2262
2263
2264
2265cat >input <<'_ATEOF'
2266option mime
2267define plnum six
2268quit
2269_ATEOF
2270
2271{ set +x
2272$as_echo "$at_srcdir/mime2.at:19: (dicod --config \$abs_builddir/dicod.conf --stderr -i < input  2>dicod.err| tr -d '\\r' | sed 's/^\\(2[25][0-9]\\) .*/\\1/;s/ *\$//' ; cat dicod.err|sed  's/^dicod: Error: //;/^;;;/d' >&2)"
2273at_fn_check_prepare_notrace 'a shell pipeline' "mime2.at:19"
2274( $at_check_trace; (dicod --config $abs_builddir/dicod.conf --stderr -i < input  2>dicod.err| tr -d '\r' | sed 's/^\(2[25][0-9]\) .*/\1/;s/ *$//' ; cat dicod.err|sed  's/^dicod: Error: //;/^;;;/d' >&2)
2275) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2276at_status=$? at_failed=false
2277$at_check_filter
2278at_fn_diff_devnull "$at_stderr" || at_failed=:
2279echo >>"$at_stdout"; $as_echo "220
2280250
2281150 1 definitions found: list follows
2282151 \"six\" plnum \"Short English-Polish numerals dictionary\"
2283Content-Type: text/plain; charset=UTF-8
2284Content-Transfer-Encoding: quoted-printable
2285
2286six
2287sze=C5=9B=C4=87
2288
2289.
2290250
2291221
2292" | \
2293  $at_diff - "$at_stdout" || at_failed=:
2294at_fn_check_status 0 $at_status "$at_srcdir/mime2.at:19"
2295$at_failed && at_fn_log_failure
2296$at_traceon; }
2297
2298  set +x
2299  $at_times_p && times >"$at_times_file"
2300) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2301read at_status <"$at_status_file"
2302#AT_STOP_7
2303#AT_START_8
2304at_fn_group_banner 8 'showdb.at:17' \
2305  "show db" "                                        " 3
2306at_xfail=no
2307(
2308  $as_echo "8. $at_setup_line: testing $at_desc ..."
2309  $at_traceon
2310
2311
2312
2313cat >input <<'_ATEOF'
2314show db
2315quit
2316_ATEOF
2317
2318{ set +x
2319$as_echo "$at_srcdir/showdb.at:19: dicod --config \$abs_builddir/dicod.conf --stderr -i < input  | tr -d '\\r' | sed 's/^\\(2[25][0-9]\\) .*/\\1/;s/ *\$//' "
2320at_fn_check_prepare_notrace 'a shell pipeline' "showdb.at:19"
2321( $at_check_trace; dicod --config $abs_builddir/dicod.conf --stderr -i < input  | tr -d '\r' | sed 's/^\(2[25][0-9]\) .*/\1/;s/ *$//'
2322) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2323at_status=$? at_failed=false
2324$at_check_filter
2325at_fn_diff_devnull "$at_stderr" || at_failed=:
2326echo >>"$at_stdout"; $as_echo "220
2327110 1 databases present
2328plnum \"Short English-Polish numerals dictionary\"
2329.
2330250
2331221
2332" | \
2333  $at_diff - "$at_stdout" || at_failed=:
2334at_fn_check_status 0 $at_status "$at_srcdir/showdb.at:19"
2335$at_failed && at_fn_log_failure
2336$at_traceon; }
2337
2338  set +x
2339  $at_times_p && times >"$at_times_file"
2340) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2341read at_status <"$at_status_file"
2342#AT_STOP_8
2343#AT_START_9
2344at_fn_group_banner 9 'showinfo.at:17' \
2345  "show info" "                                      " 3
2346at_xfail=no
2347(
2348  $as_echo "9. $at_setup_line: testing $at_desc ..."
2349  $at_traceon
2350
2351
2352
2353cat >input <<'_ATEOF'
2354show info plnum
2355quit
2356_ATEOF
2357
2358{ set +x
2359$as_echo "$at_srcdir/showinfo.at:19: (dicod --config \$abs_builddir/dicod.conf --stderr -i < input  2>dicod.err| tr -d '\\r' | sed 's/^\\(2[25][0-9]\\) .*/\\1/;s/ *\$//' ; cat dicod.err|sed  's/^dicod: Error: //;/^;;;/d' >&2)"
2360at_fn_check_prepare_notrace 'a shell pipeline' "showinfo.at:19"
2361( $at_check_trace; (dicod --config $abs_builddir/dicod.conf --stderr -i < input  2>dicod.err| tr -d '\r' | sed 's/^\(2[25][0-9]\) .*/\1/;s/ *$//' ; cat dicod.err|sed  's/^dicod: Error: //;/^;;;/d' >&2)
2362) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2363at_status=$? at_failed=false
2364$at_check_filter
2365at_fn_diff_devnull "$at_stderr" || at_failed=:
2366echo >>"$at_stdout"; $as_echo "220
2367112 information for plnum
2368Short English-Polish dictionary of numerals (1 - 10)
2369Hardly worth copyrighting, but just in case:
2370
2371This dictionary is public domain. You can do with it whatever you
2372like to do, except changing the meaning of the words, of course.
2373
2374.
2375250
2376221
2377" | \
2378  $at_diff - "$at_stdout" || at_failed=:
2379at_fn_check_status 0 $at_status "$at_srcdir/showinfo.at:19"
2380$at_failed && at_fn_log_failure
2381$at_traceon; }
2382
2383  set +x
2384  $at_times_p && times >"$at_times_file"
2385) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2386read at_status <"$at_status_file"
2387#AT_STOP_9
2388#AT_START_10
2389at_fn_group_banner 10 'showlang.at:17' \
2390  "show lang info" "                                 " 3
2391at_xfail=no
2392(
2393  $as_echo "10. $at_setup_line: testing $at_desc ..."
2394  $at_traceon
2395
2396
2397
2398cat >input <<'_ATEOF'
2399show lang info plnum
2400quit
2401_ATEOF
2402
2403{ set +x
2404$as_echo "$at_srcdir/showlang.at:19: (dicod --config \$abs_builddir/dicod.conf --stderr -i < input  2>dicod.err| tr -d '\\r' | sed 's/^\\(2[25][0-9]\\) .*/\\1/;s/ *\$//' ; cat dicod.err|sed  's/^dicod: Error: //;/^;;;/d' >&2)"
2405at_fn_check_prepare_notrace 'a shell pipeline' "showlang.at:19"
2406( $at_check_trace; (dicod --config $abs_builddir/dicod.conf --stderr -i < input  2>dicod.err| tr -d '\r' | sed 's/^\(2[25][0-9]\) .*/\1/;s/ *$//' ; cat dicod.err|sed  's/^dicod: Error: //;/^;;;/d' >&2)
2407) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2408at_status=$? at_failed=false
2409$at_check_filter
2410at_fn_diff_devnull "$at_stderr" || at_failed=:
2411echo >>"$at_stdout"; $as_echo "220
2412280 en : pl
2413221
2414" | \
2415  $at_diff - "$at_stdout" || at_failed=:
2416at_fn_check_status 0 $at_status "$at_srcdir/showlang.at:19"
2417$at_failed && at_fn_log_failure
2418$at_traceon; }
2419
2420  set +x
2421  $at_times_p && times >"$at_times_file"
2422) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2423read at_status <"$at_status_file"
2424#AT_STOP_10
2425