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;testsuite.at:28;dicod version;version;
5942;startup.at:17;startup;startup;
5953;help00.at:17;help;help help00;
5964;help01.at:17;help reflects capabilities;help help01;
5975;help02.at:17;user-defined help;help help02;
5986;help03.at:17;user-augmented help;help help03;
5997;showstrat.at:17;show strategies;show stratlist showstrat;
6008;showdb.at:17;show databases;show showdb;
6019;info.at:17;info;;
60210;descr.at:17;descr;;
60311;match.at:17;match;match;
60412;nomatch.at:17;no match;nomatch;
60513;def.at:17;define;def define;
60614;nodef.at:17;no definition;nodef;
60715;vis00.at:17;global visibility-acl;auth apop vis00;
60816;vis01.at:17;per-database visibility-acl;auth apop vis01;
60917;vis02.at:17;server info visibility;auth apop vis02;
61018;apop.at:17;apop;auth apop;
61119;alias.at:17;aliases;alias;
61220;virt01.at:17;show db;virtual virtual01;
61321;virt02.at:17;match;virtual virtual02;
61422;virt03.at:17;define;virtual virtual03;
61523;virt04.at:17;show info;virtual virtual04;
616"
617# List of the all the test groups.
618at_groups_all=`$as_echo "$at_help_all" | sed 's/;.*//'`
619
620# at_fn_validate_ranges NAME...
621# -----------------------------
622# Validate and normalize the test group number contained in each variable
623# NAME. Leading zeroes are treated as decimal.
624at_fn_validate_ranges ()
625{
626  for at_grp
627  do
628    eval at_value=\$$at_grp
629    if test $at_value -lt 1 || test $at_value -gt 23; then
630      $as_echo "invalid test group: $at_value" >&2
631      exit 1
632    fi
633    case $at_value in
634      0*) # We want to treat leading 0 as decimal, like expr and test, but
635	  # AS_VAR_ARITH treats it as octal if it uses $(( )).
636	  # With XSI shells, ${at_value#${at_value%%[1-9]*}} avoids the
637	  # expr fork, but it is not worth the effort to determine if the
638	  # shell supports XSI when the user can just avoid leading 0.
639	  eval $at_grp='`expr $at_value + 0`' ;;
640    esac
641  done
642}
643
644at_prev=
645for at_option
646do
647  # If the previous option needs an argument, assign it.
648  if test -n "$at_prev"; then
649    at_option=$at_prev=$at_option
650    at_prev=
651  fi
652
653  case $at_option in
654  *=?*) at_optarg=`expr "X$at_option" : '[^=]*=\(.*\)'` ;;
655  *)    at_optarg= ;;
656  esac
657
658  # Accept the important Cygnus configure options, so we can diagnose typos.
659
660  case $at_option in
661    --help | -h )
662	at_help_p=:
663	;;
664
665    --list | -l )
666	at_list_p=:
667	;;
668
669    --version | -V )
670	at_version_p=:
671	;;
672
673    --clean | -c )
674	at_clean=:
675	;;
676
677    --color )
678	at_color=always
679	;;
680    --color=* )
681	case $at_optarg in
682	no | never | none) at_color=never ;;
683	auto | tty | if-tty) at_color=auto ;;
684	always | yes | force) at_color=always ;;
685	*) at_optname=`echo " $at_option" | sed 's/^ //; s/=.*//'`
686	   as_fn_error $? "unrecognized argument to $at_optname: $at_optarg" ;;
687	esac
688	;;
689
690    --debug | -d )
691	at_debug_p=:
692	;;
693
694    --errexit | -e )
695	at_debug_p=:
696	at_errexit_p=:
697	;;
698
699    --verbose | -v )
700	at_verbose=; at_quiet=:
701	;;
702
703    --trace | -x )
704	at_traceon='set -x'
705	at_trace_echo=echo
706	at_check_filter_trace=at_fn_filter_trace
707	;;
708
709    [0-9] | [0-9][0-9] | [0-9][0-9][0-9] | [0-9][0-9][0-9][0-9])
710	at_fn_validate_ranges at_option
711	as_fn_append at_groups "$at_option$as_nl"
712	;;
713
714    # Ranges
715    [0-9]- | [0-9][0-9]- | [0-9][0-9][0-9]- | [0-9][0-9][0-9][0-9]-)
716	at_range_start=`echo $at_option |tr -d X-`
717	at_fn_validate_ranges at_range_start
718	at_range=`$as_echo "$at_groups_all" | \
719	  sed -ne '/^'$at_range_start'$/,$p'`
720	as_fn_append at_groups "$at_range$as_nl"
721	;;
722
723    -[0-9] | -[0-9][0-9] | -[0-9][0-9][0-9] | -[0-9][0-9][0-9][0-9])
724	at_range_end=`echo $at_option |tr -d X-`
725	at_fn_validate_ranges at_range_end
726	at_range=`$as_echo "$at_groups_all" | \
727	  sed -ne '1,/^'$at_range_end'$/p'`
728	as_fn_append at_groups "$at_range$as_nl"
729	;;
730
731    [0-9]-[0-9] | [0-9]-[0-9][0-9] | [0-9]-[0-9][0-9][0-9] | \
732    [0-9]-[0-9][0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9] | \
733    [0-9][0-9]-[0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9][0-9][0-9] | \
734    [0-9][0-9][0-9]-[0-9][0-9][0-9] | \
735    [0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] | \
736    [0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] )
737	at_range_start=`expr $at_option : '\(.*\)-'`
738	at_range_end=`expr $at_option : '.*-\(.*\)'`
739	if test $at_range_start -gt $at_range_end; then
740	  at_tmp=$at_range_end
741	  at_range_end=$at_range_start
742	  at_range_start=$at_tmp
743	fi
744	at_fn_validate_ranges at_range_start at_range_end
745	at_range=`$as_echo "$at_groups_all" | \
746	  sed -ne '/^'$at_range_start'$/,/^'$at_range_end'$/p'`
747	as_fn_append at_groups "$at_range$as_nl"
748	;;
749
750    # Directory selection.
751    --directory | -C )
752	at_prev=--directory
753	;;
754    --directory=* )
755	at_change_dir=:
756	at_dir=$at_optarg
757	if test x- = "x$at_dir" ; then
758	  at_dir=./-
759	fi
760	;;
761
762    # Parallel execution.
763    --jobs | -j )
764	at_jobs=0
765	;;
766    --jobs=* | -j[0-9]* )
767	if test -n "$at_optarg"; then
768	  at_jobs=$at_optarg
769	else
770	  at_jobs=`expr X$at_option : 'X-j\(.*\)'`
771	fi
772	case $at_jobs in *[!0-9]*)
773	  at_optname=`echo " $at_option" | sed 's/^ //; s/[0-9=].*//'`
774	  as_fn_error $? "non-numeric argument to $at_optname: $at_jobs" ;;
775	esac
776	;;
777
778    # Keywords.
779    --keywords | -k )
780	at_prev=--keywords
781	;;
782    --keywords=* )
783	at_groups_selected=$at_help_all
784	at_save_IFS=$IFS
785	IFS=,
786	set X $at_optarg
787	shift
788	IFS=$at_save_IFS
789	for at_keyword
790	do
791	  at_invert=
792	  case $at_keyword in
793	  '!'*)
794	    at_invert="-v"
795	    at_keyword=`expr "X$at_keyword" : 'X!\(.*\)'`
796	    ;;
797	  esac
798	  # It is on purpose that we match the test group titles too.
799	  at_groups_selected=`$as_echo "$at_groups_selected" |
800	      grep -i $at_invert "^[1-9][^;]*;.*[; ]$at_keyword[ ;]"`
801	done
802	# Smash the keywords.
803	at_groups_selected=`$as_echo "$at_groups_selected" | sed 's/;.*//'`
804	as_fn_append at_groups "$at_groups_selected$as_nl"
805	;;
806    --recheck)
807	at_recheck=:
808	;;
809
810    *=*)
811	at_envvar=`expr "x$at_option" : 'x\([^=]*\)='`
812	# Reject names that are not valid shell variable names.
813	case $at_envvar in
814	  '' | [0-9]* | *[!_$as_cr_alnum]* )
815	    as_fn_error $? "invalid variable name: \`$at_envvar'" ;;
816	esac
817	at_value=`$as_echo "$at_optarg" | sed "s/'/'\\\\\\\\''/g"`
818	# Export now, but save eval for later and for debug scripts.
819	export $at_envvar
820	as_fn_append at_debug_args " $at_envvar='$at_value'"
821	;;
822
823     *) $as_echo "$as_me: invalid option: $at_option" >&2
824	$as_echo "Try \`$0 --help' for more information." >&2
825	exit 1
826	;;
827  esac
828done
829
830# Verify our last option didn't require an argument
831if test -n "$at_prev"; then :
832  as_fn_error $? "\`$at_prev' requires an argument"
833fi
834
835# The file containing the suite.
836at_suite_log=$at_dir/$as_me.log
837
838# Selected test groups.
839if test -z "$at_groups$at_recheck"; then
840  at_groups=$at_groups_all
841else
842  if test -n "$at_recheck" && test -r "$at_suite_log"; then
843    at_oldfails=`sed -n '
844      /^Failed tests:$/,/^Skipped tests:$/{
845	s/^[ ]*\([1-9][0-9]*\):.*/\1/p
846      }
847      /^Unexpected passes:$/,/^## Detailed failed tests/{
848	s/^[ ]*\([1-9][0-9]*\):.*/\1/p
849      }
850      /^## Detailed failed tests/q
851      ' "$at_suite_log"`
852    as_fn_append at_groups "$at_oldfails$as_nl"
853  fi
854  # Sort the tests, removing duplicates.
855  at_groups=`$as_echo "$at_groups" | sort -nu | sed '/^$/d'`
856fi
857
858if test x"$at_color" = xalways \
859   || { test x"$at_color" = xauto && test -t 1; }; then
860  at_red=`printf '\033[0;31m'`
861  at_grn=`printf '\033[0;32m'`
862  at_lgn=`printf '\033[1;32m'`
863  at_blu=`printf '\033[1;34m'`
864  at_std=`printf '\033[m'`
865else
866  at_red= at_grn= at_lgn= at_blu= at_std=
867fi
868
869# Help message.
870if $at_help_p; then
871  cat <<_ATEOF || at_write_fail=1
872Usage: $0 [OPTION]... [VARIABLE=VALUE]... [TESTS]
873
874Run all the tests, or the selected TESTS, given by numeric ranges, and
875save a detailed log file.  Upon failure, create debugging scripts.
876
877Do not change environment variables directly.  Instead, set them via
878command line arguments.  Set \`AUTOTEST_PATH' to select the executables
879to exercise.  Each relative directory is expanded as build and source
880directories relative to the top level of this distribution.
881E.g., from within the build directory /tmp/foo-1.0, invoking this:
882
883  $ $0 AUTOTEST_PATH=bin
884
885is equivalent to the following, assuming the source directory is /src/foo-1.0:
886
887  PATH=/tmp/foo-1.0/bin:/src/foo-1.0/bin:\$PATH $0
888_ATEOF
889cat <<_ATEOF || at_write_fail=1
890
891Operation modes:
892  -h, --help     print the help message, then exit
893  -V, --version  print version number, then exit
894  -c, --clean    remove all the files this test suite might create and exit
895  -l, --list     describes all the tests, or the selected TESTS
896_ATEOF
897cat <<_ATEOF || at_write_fail=1
898
899Execution tuning:
900  -C, --directory=DIR
901                 change to directory DIR before starting
902      --color[=never|auto|always]
903                 enable colored test results on terminal, or always
904  -j, --jobs[=N]
905                 Allow N jobs at once; infinite jobs with no arg (default 1)
906  -k, --keywords=KEYWORDS
907                 select the tests matching all the comma-separated KEYWORDS
908                 multiple \`-k' accumulate; prefixed \`!' negates a KEYWORD
909      --recheck  select all tests that failed or passed unexpectedly last time
910  -e, --errexit  abort as soon as a test fails; implies --debug
911  -v, --verbose  force more detailed output
912                 default for debugging scripts
913  -d, --debug    inhibit clean up and top-level logging
914                 default for debugging scripts
915  -x, --trace    enable tests shell tracing
916_ATEOF
917cat <<_ATEOF || at_write_fail=1
918
919Report bugs to <bug-dico@gnu.org>.
920General help using GNU software: <http://www.gnu.org/gethelp/>.
921_ATEOF
922  exit $at_write_fail
923fi
924
925# List of tests.
926if $at_list_p; then
927  cat <<_ATEOF || at_write_fail=1
928GNU dico 2.10 test suite test groups:
929
930 NUM: FILE-NAME:LINE     TEST-GROUP-NAME
931      KEYWORDS
932
933_ATEOF
934  # Pass an empty line as separator between selected groups and help.
935  $as_echo "$at_groups$as_nl$as_nl$at_help_all" |
936    awk 'NF == 1 && FS != ";" {
937	   selected[$ 1] = 1
938	   next
939	 }
940	 /^$/ { FS = ";" }
941	 NF > 0 {
942	   if (selected[$ 1]) {
943	     printf " %3d: %-18s %s\n", $ 1, $ 2, $ 3
944	     if ($ 4) {
945	       lmax = 79
946	       indent = "     "
947	       line = indent
948	       len = length (line)
949	       n = split ($ 4, a, " ")
950	       for (i = 1; i <= n; i++) {
951		 l = length (a[i]) + 1
952		 if (i > 1 && len + l > lmax) {
953		   print line
954		   line = indent " " a[i]
955		   len = length (line)
956		 } else {
957		   line = line " " a[i]
958		   len += l
959		 }
960	       }
961	       if (n)
962		 print line
963	     }
964	   }
965	 }' || at_write_fail=1
966  exit $at_write_fail
967fi
968if $at_version_p; then
969  $as_echo "$as_me (GNU dico 2.10)" &&
970  cat <<\_ATEOF || at_write_fail=1
971
972Copyright (C) 2012 Free Software Foundation, Inc.
973This test suite is free software; the Free Software Foundation gives
974unlimited permission to copy, distribute and modify it.
975_ATEOF
976  exit $at_write_fail
977fi
978
979# Should we print banners?  Yes if more than one test is run.
980case $at_groups in #(
981  *$as_nl* )
982      at_print_banners=: ;; #(
983  * ) at_print_banners=false ;;
984esac
985# Text for banner N, set to a single space once printed.
986# Banner 1. testsuite.at:31
987# Category starts at test group 3.
988at_banner_text_1="HELP output"
989# Banner 2. testsuite.at:37
990# Category starts at test group 7.
991at_banner_text_2="SHOW commands"
992# Banner 3. testsuite.at:43
993# Category starts at test group 11.
994at_banner_text_3="MATCH"
995# Banner 4. testsuite.at:47
996# Category starts at test group 13.
997at_banner_text_4="DEFINE"
998# Banner 5. testsuite.at:51
999# Category starts at test group 15.
1000at_banner_text_5="Visibility"
1001# Banner 6. testsuite.at:56
1002# Category starts at test group 18.
1003at_banner_text_6="Other features"
1004# Banner 7. testsuite.at:60
1005# Category starts at test group 20.
1006at_banner_text_7="Virtual databases"
1007
1008# Take any -C into account.
1009if $at_change_dir ; then
1010  test x != "x$at_dir" && cd "$at_dir" \
1011    || as_fn_error $? "unable to change directory"
1012  at_dir=`pwd`
1013fi
1014
1015# Load the config files for any default variable assignments.
1016for at_file in atconfig atlocal
1017do
1018  test -r $at_file || continue
1019  . ./$at_file || as_fn_error $? "invalid content: $at_file"
1020done
1021
1022# Autoconf <=2.59b set at_top_builddir instead of at_top_build_prefix:
1023: "${at_top_build_prefix=$at_top_builddir}"
1024
1025# Perform any assignments requested during argument parsing.
1026eval "$at_debug_args"
1027
1028# atconfig delivers names relative to the directory the test suite is
1029# in, but the groups themselves are run in testsuite-dir/group-dir.
1030if test -n "$at_top_srcdir"; then
1031  builddir=../..
1032  for at_dir_var in srcdir top_srcdir top_build_prefix
1033  do
1034    eval at_val=\$at_$at_dir_var
1035    case $at_val in
1036      [\\/$]* | ?:[\\/]* ) at_prefix= ;;
1037      *) at_prefix=../../ ;;
1038    esac
1039    eval "$at_dir_var=\$at_prefix\$at_val"
1040  done
1041fi
1042
1043## -------------------- ##
1044## Directory structure. ##
1045## -------------------- ##
1046
1047# This is the set of directories and files used by this script
1048# (non-literals are capitalized):
1049#
1050# TESTSUITE         - the testsuite
1051# TESTSUITE.log     - summarizes the complete testsuite run
1052# TESTSUITE.dir/    - created during a run, remains after -d or failed test
1053# + at-groups/      - during a run: status of all groups in run
1054# | + NNN/          - during a run: meta-data about test group NNN
1055# | | + check-line  - location (source file and line) of current AT_CHECK
1056# | | + status      - exit status of current AT_CHECK
1057# | | + stdout      - stdout of current AT_CHECK
1058# | | + stder1      - stderr, including trace
1059# | | + stderr      - stderr, with trace filtered out
1060# | | + test-source - portion of testsuite that defines group
1061# | | + times       - timestamps for computing duration
1062# | | + pass        - created if group passed
1063# | | + xpass       - created if group xpassed
1064# | | + fail        - created if group failed
1065# | | + xfail       - created if group xfailed
1066# | | + skip        - created if group skipped
1067# + at-stop         - during a run: end the run if this file exists
1068# + at-source-lines - during a run: cache of TESTSUITE line numbers for extraction
1069# + 0..NNN/         - created for each group NNN, remains after -d or failed test
1070# | + TESTSUITE.log - summarizes the group results
1071# | + ...           - files created during the group
1072
1073# The directory the whole suite works in.
1074# Should be absolute to let the user `cd' at will.
1075at_suite_dir=$at_dir/$as_me.dir
1076# The file containing the suite ($at_dir might have changed since earlier).
1077at_suite_log=$at_dir/$as_me.log
1078# The directory containing helper files per test group.
1079at_helper_dir=$at_suite_dir/at-groups
1080# Stop file: if it exists, do not start new jobs.
1081at_stop_file=$at_suite_dir/at-stop
1082# The fifo used for the job dispatcher.
1083at_job_fifo=$at_suite_dir/at-job-fifo
1084
1085if $at_clean; then
1086  test -d "$at_suite_dir" &&
1087    find "$at_suite_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \;
1088  rm -f -r "$at_suite_dir" "$at_suite_log"
1089  exit $?
1090fi
1091
1092# Don't take risks: use only absolute directories in PATH.
1093#
1094# For stand-alone test suites (ie. atconfig was not found),
1095# AUTOTEST_PATH is relative to `.'.
1096#
1097# For embedded test suites, AUTOTEST_PATH is relative to the top level
1098# of the package.  Then expand it into build/src parts, since users
1099# may create executables in both places.
1100AUTOTEST_PATH=`$as_echo "$AUTOTEST_PATH" | sed "s|:|$PATH_SEPARATOR|g"`
1101at_path=
1102as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1103for as_dir in $AUTOTEST_PATH $PATH
1104do
1105  IFS=$as_save_IFS
1106  test -z "$as_dir" && as_dir=.
1107    test -n "$at_path" && as_fn_append at_path $PATH_SEPARATOR
1108case $as_dir in
1109  [\\/]* | ?:[\\/]* )
1110    as_fn_append at_path "$as_dir"
1111    ;;
1112  * )
1113    if test -z "$at_top_build_prefix"; then
1114      # Stand-alone test suite.
1115      as_fn_append at_path "$as_dir"
1116    else
1117      # Embedded test suite.
1118      as_fn_append at_path "$at_top_build_prefix$as_dir$PATH_SEPARATOR"
1119      as_fn_append at_path "$at_top_srcdir/$as_dir"
1120    fi
1121    ;;
1122esac
1123  done
1124IFS=$as_save_IFS
1125
1126
1127# Now build and simplify PATH.
1128#
1129# There might be directories that don't exist, but don't redirect
1130# builtins' (eg., cd) stderr directly: Ultrix's sh hates that.
1131at_new_path=
1132as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1133for as_dir in $at_path
1134do
1135  IFS=$as_save_IFS
1136  test -z "$as_dir" && as_dir=.
1137    test -d "$as_dir" || continue
1138case $as_dir in
1139  [\\/]* | ?:[\\/]* ) ;;
1140  * ) as_dir=`(cd "$as_dir" && pwd) 2>/dev/null` ;;
1141esac
1142case $PATH_SEPARATOR$at_new_path$PATH_SEPARATOR in
1143  *$PATH_SEPARATOR$as_dir$PATH_SEPARATOR*) ;;
1144  $PATH_SEPARATOR$PATH_SEPARATOR) at_new_path=$as_dir ;;
1145  *) as_fn_append at_new_path "$PATH_SEPARATOR$as_dir" ;;
1146esac
1147  done
1148IFS=$as_save_IFS
1149
1150PATH=$at_new_path
1151export PATH
1152
1153# Setting up the FDs.
1154
1155
1156
1157# 5 is the log file.  Not to be overwritten if `-d'.
1158if $at_debug_p; then
1159  at_suite_log=/dev/null
1160else
1161  : >"$at_suite_log"
1162fi
1163exec 5>>"$at_suite_log"
1164
1165# Banners and logs.
1166$as_echo "## ------------------------- ##
1167## GNU dico 2.10 test suite. ##
1168## ------------------------- ##"
1169{
1170  $as_echo "## ------------------------- ##
1171## GNU dico 2.10 test suite. ##
1172## ------------------------- ##"
1173  echo
1174
1175  $as_echo "$as_me: command line was:"
1176  $as_echo "  \$ $0 $at_cli_args"
1177  echo
1178
1179  # If ChangeLog exists, list a few lines in case it might help determining
1180  # the exact version.
1181  if test -n "$at_top_srcdir" && test -f "$at_top_srcdir/ChangeLog"; then
1182    $as_echo "## ---------- ##
1183## ChangeLog. ##
1184## ---------- ##"
1185    echo
1186    sed 's/^/| /;10q' "$at_top_srcdir/ChangeLog"
1187    echo
1188  fi
1189
1190  {
1191cat <<_ASUNAME
1192## --------- ##
1193## Platform. ##
1194## --------- ##
1195
1196hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
1197uname -m = `(uname -m) 2>/dev/null || echo unknown`
1198uname -r = `(uname -r) 2>/dev/null || echo unknown`
1199uname -s = `(uname -s) 2>/dev/null || echo unknown`
1200uname -v = `(uname -v) 2>/dev/null || echo unknown`
1201
1202/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
1203/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
1204
1205/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
1206/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
1207/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
1208/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
1209/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
1210/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
1211/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
1212
1213_ASUNAME
1214
1215as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1216for as_dir in $PATH
1217do
1218  IFS=$as_save_IFS
1219  test -z "$as_dir" && as_dir=.
1220    $as_echo "PATH: $as_dir"
1221  done
1222IFS=$as_save_IFS
1223
1224}
1225  echo
1226
1227  # Contents of the config files.
1228  for at_file in atconfig atlocal
1229  do
1230    test -r $at_file || continue
1231    $as_echo "$as_me: $at_file:"
1232    sed 's/^/| /' $at_file
1233    echo
1234  done
1235} >&5
1236
1237
1238## ------------------------- ##
1239## Autotest shell functions. ##
1240## ------------------------- ##
1241
1242# at_fn_banner NUMBER
1243# -------------------
1244# Output banner NUMBER, provided the testsuite is running multiple groups and
1245# this particular banner has not yet been printed.
1246at_fn_banner ()
1247{
1248  $at_print_banners || return 0
1249  eval at_banner_text=\$at_banner_text_$1
1250  test "x$at_banner_text" = "x " && return 0
1251  eval "at_banner_text_$1=\" \""
1252  if test -z "$at_banner_text"; then
1253    $at_first || echo
1254  else
1255    $as_echo "$as_nl$at_banner_text$as_nl"
1256  fi
1257} # at_fn_banner
1258
1259# at_fn_check_prepare_notrace REASON LINE
1260# ---------------------------------------
1261# Perform AT_CHECK preparations for the command at LINE for an untraceable
1262# command; REASON is the reason for disabling tracing.
1263at_fn_check_prepare_notrace ()
1264{
1265  $at_trace_echo "Not enabling shell tracing (command contains $1)"
1266  $as_echo "$2" >"$at_check_line_file"
1267  at_check_trace=: at_check_filter=:
1268  : >"$at_stdout"; : >"$at_stderr"
1269}
1270
1271# at_fn_check_prepare_trace LINE
1272# ------------------------------
1273# Perform AT_CHECK preparations for the command at LINE for a traceable
1274# command.
1275at_fn_check_prepare_trace ()
1276{
1277  $as_echo "$1" >"$at_check_line_file"
1278  at_check_trace=$at_traceon at_check_filter=$at_check_filter_trace
1279  : >"$at_stdout"; : >"$at_stderr"
1280}
1281
1282# at_fn_check_prepare_dynamic COMMAND LINE
1283# ----------------------------------------
1284# Decide if COMMAND at LINE is traceable at runtime, and call the appropriate
1285# preparation function.
1286at_fn_check_prepare_dynamic ()
1287{
1288  case $1 in
1289    *$as_nl*)
1290      at_fn_check_prepare_notrace 'an embedded newline' "$2" ;;
1291    *)
1292      at_fn_check_prepare_trace "$2" ;;
1293  esac
1294}
1295
1296# at_fn_filter_trace
1297# ------------------
1298# Remove the lines in the file "$at_stderr" generated by "set -x" and print
1299# them to stderr.
1300at_fn_filter_trace ()
1301{
1302  mv "$at_stderr" "$at_stder1"
1303  grep '^ *+' "$at_stder1" >&2
1304  grep -v '^ *+' "$at_stder1" >"$at_stderr"
1305}
1306
1307# at_fn_log_failure FILE-LIST
1308# ---------------------------
1309# Copy the files in the list on stdout with a "> " prefix, and exit the shell
1310# with a failure exit code.
1311at_fn_log_failure ()
1312{
1313  for file
1314    do $as_echo "$file:"; sed 's/^/> /' "$file"; done
1315  echo 1 > "$at_status_file"
1316  exit 1
1317}
1318
1319# at_fn_check_skip EXIT-CODE LINE
1320# -------------------------------
1321# Check whether EXIT-CODE is a special exit code (77 or 99), and if so exit
1322# the test group subshell with that same exit code. Use LINE in any report
1323# about test failure.
1324at_fn_check_skip ()
1325{
1326  case $1 in
1327    99) echo 99 > "$at_status_file"; at_failed=:
1328	$as_echo "$2: hard failure"; exit 99;;
1329    77) echo 77 > "$at_status_file"; exit 77;;
1330  esac
1331}
1332
1333# at_fn_check_status EXPECTED EXIT-CODE LINE
1334# ------------------------------------------
1335# Check whether EXIT-CODE is the EXPECTED exit code, and if so do nothing.
1336# Otherwise, if it is 77 or 99, exit the test group subshell with that same
1337# exit code; if it is anything else print an error message referring to LINE,
1338# and fail the test.
1339at_fn_check_status ()
1340{
1341  case $2 in
1342    $1 ) ;;
1343    77) echo 77 > "$at_status_file"; exit 77;;
1344    99) echo 99 > "$at_status_file"; at_failed=:
1345	$as_echo "$3: hard failure"; exit 99;;
1346    *) $as_echo "$3: exit code was $2, expected $1"
1347      at_failed=:;;
1348  esac
1349}
1350
1351# at_fn_diff_devnull FILE
1352# -----------------------
1353# Emit a diff between /dev/null and FILE. Uses "test -s" to avoid useless diff
1354# invocations.
1355at_fn_diff_devnull ()
1356{
1357  test -s "$1" || return 0
1358  $at_diff "$at_devnull" "$1"
1359}
1360
1361# at_fn_test NUMBER
1362# -----------------
1363# Parse out test NUMBER from the tail of this file.
1364at_fn_test ()
1365{
1366  eval at_sed=\$at_sed$1
1367  sed "$at_sed" "$at_myself" > "$at_test_source"
1368}
1369
1370# at_fn_create_debugging_script
1371# -----------------------------
1372# Create the debugging script $at_group_dir/run which will reproduce the
1373# current test group.
1374at_fn_create_debugging_script ()
1375{
1376  {
1377    echo "#! /bin/sh" &&
1378    echo 'test "${ZSH_VERSION+set}" = set && alias -g '\''${1+"$@"}'\''='\''"$@"'\''' &&
1379    $as_echo "cd '$at_dir'" &&
1380    $as_echo "exec \${CONFIG_SHELL-$SHELL} \"$at_myself\" -v -d $at_debug_args $at_group \${1+\"\$@\"}" &&
1381    echo 'exit 1'
1382  } >"$at_group_dir/run" &&
1383  chmod +x "$at_group_dir/run"
1384}
1385
1386## -------------------------------- ##
1387## End of autotest shell functions. ##
1388## -------------------------------- ##
1389{
1390  $as_echo "## ---------------- ##
1391## Tested programs. ##
1392## ---------------- ##"
1393  echo
1394} >&5
1395
1396# Report what programs are being tested.
1397for at_program in : $at_tested
1398do
1399  test "$at_program" = : && continue
1400  case $at_program in
1401    [\\/]* | ?:[\\/]* ) $at_program_=$at_program ;;
1402    * )
1403    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1404for as_dir in $PATH
1405do
1406  IFS=$as_save_IFS
1407  test -z "$as_dir" && as_dir=.
1408    test -f "$as_dir/$at_program" && break
1409  done
1410IFS=$as_save_IFS
1411
1412    at_program_=$as_dir/$at_program ;;
1413  esac
1414  if test -f "$at_program_"; then
1415    {
1416      $as_echo "$at_srcdir/testsuite.at:27: $at_program_ --version"
1417      "$at_program_" --version </dev/null
1418      echo
1419    } >&5 2>&1
1420  else
1421    as_fn_error $? "cannot find $at_program" "$LINENO" 5
1422  fi
1423done
1424
1425{
1426  $as_echo "## ------------------ ##
1427## Running the tests. ##
1428## ------------------ ##"
1429} >&5
1430
1431at_start_date=`date`
1432at_start_time=`date +%s 2>/dev/null`
1433$as_echo "$as_me: starting at: $at_start_date" >&5
1434
1435# Create the master directory if it doesn't already exist.
1436as_dir="$at_suite_dir"; as_fn_mkdir_p ||
1437  as_fn_error $? "cannot create \`$at_suite_dir'" "$LINENO" 5
1438
1439# Can we diff with `/dev/null'?  DU 5.0 refuses.
1440if diff /dev/null /dev/null >/dev/null 2>&1; then
1441  at_devnull=/dev/null
1442else
1443  at_devnull=$at_suite_dir/devnull
1444  >"$at_devnull"
1445fi
1446
1447# Use `diff -u' when possible.
1448if at_diff=`diff -u "$at_devnull" "$at_devnull" 2>&1` && test -z "$at_diff"
1449then
1450  at_diff='diff -u'
1451else
1452  at_diff=diff
1453fi
1454
1455# Get the last needed group.
1456for at_group in : $at_groups; do :; done
1457
1458# Extract the start and end lines of each test group at the tail
1459# of this file
1460awk '
1461BEGIN { FS="" }
1462/^#AT_START_/ {
1463  start = NR
1464}
1465/^#AT_STOP_/ {
1466  test = substr ($ 0, 10)
1467  print "at_sed" test "=\"1," start "d;" (NR-1) "q\""
1468  if (test == "'"$at_group"'") exit
1469}' "$at_myself" > "$at_suite_dir/at-source-lines" &&
1470. "$at_suite_dir/at-source-lines" ||
1471  as_fn_error $? "cannot create test line number cache" "$LINENO" 5
1472rm -f "$at_suite_dir/at-source-lines"
1473
1474# Set number of jobs for `-j'; avoid more jobs than test groups.
1475set X $at_groups; shift; at_max_jobs=$#
1476if test $at_max_jobs -eq 0; then
1477  at_jobs=1
1478fi
1479if test $at_jobs -ne 1 &&
1480   { test $at_jobs -eq 0 || test $at_jobs -gt $at_max_jobs; }; then
1481  at_jobs=$at_max_jobs
1482fi
1483
1484# If parallel mode, don't output banners, don't split summary lines.
1485if test $at_jobs -ne 1; then
1486  at_print_banners=false
1487  at_quiet=:
1488fi
1489
1490# Set up helper dirs.
1491rm -rf "$at_helper_dir" &&
1492mkdir "$at_helper_dir" &&
1493cd "$at_helper_dir" &&
1494{ test -z "$at_groups" || mkdir $at_groups; } ||
1495as_fn_error $? "testsuite directory setup failed" "$LINENO" 5
1496
1497# Functions for running a test group.  We leave the actual
1498# test group execution outside of a shell function in order
1499# to avoid hitting zsh 4.x exit status bugs.
1500
1501# at_fn_group_prepare
1502# -------------------
1503# Prepare for running a test group.
1504at_fn_group_prepare ()
1505{
1506  # The directory for additional per-group helper files.
1507  at_job_dir=$at_helper_dir/$at_group
1508  # The file containing the location of the last AT_CHECK.
1509  at_check_line_file=$at_job_dir/check-line
1510  # The file containing the exit status of the last command.
1511  at_status_file=$at_job_dir/status
1512  # The files containing the output of the tested commands.
1513  at_stdout=$at_job_dir/stdout
1514  at_stder1=$at_job_dir/stder1
1515  at_stderr=$at_job_dir/stderr
1516  # The file containing the code for a test group.
1517  at_test_source=$at_job_dir/test-source
1518  # The file containing dates.
1519  at_times_file=$at_job_dir/times
1520
1521  # Be sure to come back to the top test directory.
1522  cd "$at_suite_dir"
1523
1524  # Clearly separate the test groups when verbose.
1525  $at_first || $at_verbose echo
1526
1527  at_group_normalized=$at_group
1528
1529  eval 'while :; do
1530    case $at_group_normalized in #(
1531    '"$at_format"'*) break;;
1532    esac
1533    at_group_normalized=0$at_group_normalized
1534  done'
1535
1536
1537  # Create a fresh directory for the next test group, and enter.
1538  # If one already exists, the user may have invoked ./run from
1539  # within that directory; we remove the contents, but not the
1540  # directory itself, so that we aren't pulling the rug out from
1541  # under the shell's notion of the current directory.
1542  at_group_dir=$at_suite_dir/$at_group_normalized
1543  at_group_log=$at_group_dir/$as_me.log
1544  if test -d "$at_group_dir"; then
1545  find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx {} \;
1546  rm -fr "$at_group_dir"/* "$at_group_dir"/.[!.] "$at_group_dir"/.??*
1547fi ||
1548    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: test directory for $at_group_normalized could not be cleaned" >&5
1549$as_echo "$as_me: WARNING: test directory for $at_group_normalized could not be cleaned" >&2;}
1550  # Be tolerant if the above `rm' was not able to remove the directory.
1551  as_dir="$at_group_dir"; as_fn_mkdir_p
1552
1553  echo 0 > "$at_status_file"
1554
1555  # In verbose mode, append to the log file *and* show on
1556  # the standard output; in quiet mode only write to the log.
1557  if test -z "$at_verbose"; then
1558    at_tee_pipe='tee -a "$at_group_log"'
1559  else
1560    at_tee_pipe='cat >> "$at_group_log"'
1561  fi
1562}
1563
1564# at_fn_group_banner ORDINAL LINE DESC PAD [BANNER]
1565# -------------------------------------------------
1566# Declare the test group ORDINAL, located at LINE with group description DESC,
1567# and residing under BANNER. Use PAD to align the status column.
1568at_fn_group_banner ()
1569{
1570  at_setup_line="$2"
1571  test -n "$5" && at_fn_banner $5
1572  at_desc="$3"
1573  case $1 in
1574    [0-9])      at_desc_line="  $1: ";;
1575    [0-9][0-9]) at_desc_line=" $1: " ;;
1576    *)          at_desc_line="$1: "  ;;
1577  esac
1578  as_fn_append at_desc_line "$3$4"
1579  $at_quiet $as_echo_n "$at_desc_line"
1580  echo "#                             -*- compilation -*-" >> "$at_group_log"
1581}
1582
1583# at_fn_group_postprocess
1584# -----------------------
1585# Perform cleanup after running a test group.
1586at_fn_group_postprocess ()
1587{
1588  # Be sure to come back to the suite directory, in particular
1589  # since below we might `rm' the group directory we are in currently.
1590  cd "$at_suite_dir"
1591
1592  if test ! -f "$at_check_line_file"; then
1593    sed "s/^ */$as_me: WARNING: /" <<_ATEOF
1594      A failure happened in a test group before any test could be
1595      run. This means that test suite is improperly designed.  Please
1596      report this failure to <bug-dico@gnu.org>.
1597_ATEOF
1598    $as_echo "$at_setup_line" >"$at_check_line_file"
1599    at_status=99
1600  fi
1601  $at_verbose $as_echo_n "$at_group. $at_setup_line: "
1602  $as_echo_n "$at_group. $at_setup_line: " >> "$at_group_log"
1603  case $at_xfail:$at_status in
1604    yes:0)
1605	at_msg="UNEXPECTED PASS"
1606	at_res=xpass
1607	at_errexit=$at_errexit_p
1608	at_color=$at_red
1609	;;
1610    no:0)
1611	at_msg="ok"
1612	at_res=pass
1613	at_errexit=false
1614	at_color=$at_grn
1615	;;
1616    *:77)
1617	at_msg='skipped ('`cat "$at_check_line_file"`')'
1618	at_res=skip
1619	at_errexit=false
1620	at_color=$at_blu
1621	;;
1622    no:* | *:99)
1623	at_msg='FAILED ('`cat "$at_check_line_file"`')'
1624	at_res=fail
1625	at_errexit=$at_errexit_p
1626	at_color=$at_red
1627	;;
1628    yes:*)
1629	at_msg='expected failure ('`cat "$at_check_line_file"`')'
1630	at_res=xfail
1631	at_errexit=false
1632	at_color=$at_lgn
1633	;;
1634  esac
1635  echo "$at_res" > "$at_job_dir/$at_res"
1636  # In parallel mode, output the summary line only afterwards.
1637  if test $at_jobs -ne 1 && test -n "$at_verbose"; then
1638    $as_echo "$at_desc_line $at_color$at_msg$at_std"
1639  else
1640    # Make sure there is a separator even with long titles.
1641    $as_echo " $at_color$at_msg$at_std"
1642  fi
1643  at_log_msg="$at_group. $at_desc ($at_setup_line): $at_msg"
1644  case $at_status in
1645    0|77)
1646      # $at_times_file is only available if the group succeeded.
1647      # We're not including the group log, so the success message
1648      # is written in the global log separately.  But we also
1649      # write to the group log in case they're using -d.
1650      if test -f "$at_times_file"; then
1651	at_log_msg="$at_log_msg     ("`sed 1d "$at_times_file"`')'
1652	rm -f "$at_times_file"
1653      fi
1654      $as_echo "$at_log_msg" >> "$at_group_log"
1655      $as_echo "$at_log_msg" >&5
1656
1657      # Cleanup the group directory, unless the user wants the files
1658      # or the success was unexpected.
1659      if $at_debug_p || test $at_res = xpass; then
1660	at_fn_create_debugging_script
1661	if test $at_res = xpass && $at_errexit; then
1662	  echo stop > "$at_stop_file"
1663	fi
1664      else
1665	if test -d "$at_group_dir"; then
1666	  find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \;
1667	  rm -fr "$at_group_dir"
1668	fi
1669	rm -f "$at_test_source"
1670      fi
1671      ;;
1672    *)
1673      # Upon failure, include the log into the testsuite's global
1674      # log.  The failure message is written in the group log.  It
1675      # is later included in the global log.
1676      $as_echo "$at_log_msg" >> "$at_group_log"
1677
1678      # Upon failure, keep the group directory for autopsy, and create
1679      # the debugging script.  With -e, do not start any further tests.
1680      at_fn_create_debugging_script
1681      if $at_errexit; then
1682	echo stop > "$at_stop_file"
1683      fi
1684      ;;
1685  esac
1686}
1687
1688
1689## ------------ ##
1690## Driver loop. ##
1691## ------------ ##
1692
1693
1694if (set -m && set +m && set +b) >/dev/null 2>&1; then
1695  set +b
1696  at_job_control_on='set -m' at_job_control_off='set +m' at_job_group=-
1697else
1698  at_job_control_on=: at_job_control_off=: at_job_group=
1699fi
1700
1701for at_signal in 1 2 15; do
1702  trap 'set +x; set +e
1703	$at_job_control_off
1704	at_signal='"$at_signal"'
1705	echo stop > "$at_stop_file"
1706	trap "" $at_signal
1707	at_pgids=
1708	for at_pgid in `jobs -p 2>/dev/null`; do
1709	  at_pgids="$at_pgids $at_job_group$at_pgid"
1710	done
1711	test -z "$at_pgids" || kill -$at_signal $at_pgids 2>/dev/null
1712	wait
1713	if test "$at_jobs" -eq 1 || test -z "$at_verbose"; then
1714	  echo >&2
1715	fi
1716	at_signame=`kill -l $at_signal 2>&1 || echo $at_signal`
1717	set x $at_signame
1718	test 0 -gt 2 && at_signame=$at_signal
1719	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: caught signal $at_signame, bailing out" >&5
1720$as_echo "$as_me: WARNING: caught signal $at_signame, bailing out" >&2;}
1721	as_fn_arith 128 + $at_signal && exit_status=$as_val
1722	as_fn_exit $exit_status' $at_signal
1723done
1724
1725rm -f "$at_stop_file"
1726at_first=:
1727
1728if test $at_jobs -ne 1 &&
1729     rm -f "$at_job_fifo" &&
1730     test -n "$at_job_group" &&
1731     ( mkfifo "$at_job_fifo" && trap 'exit 1' PIPE STOP TSTP ) 2>/dev/null
1732then
1733  # FIFO job dispatcher.
1734
1735  trap 'at_pids=
1736	for at_pid in `jobs -p`; do
1737	  at_pids="$at_pids $at_job_group$at_pid"
1738	done
1739	if test -n "$at_pids"; then
1740	  at_sig=TSTP
1741	  test "${TMOUT+set}" = set && at_sig=STOP
1742	  kill -$at_sig $at_pids 2>/dev/null
1743	fi
1744	kill -STOP $$
1745	test -z "$at_pids" || kill -CONT $at_pids 2>/dev/null' TSTP
1746
1747  echo
1748  # Turn jobs into a list of numbers, starting from 1.
1749  at_joblist=`$as_echo "$at_groups" | sed -n 1,${at_jobs}p`
1750
1751  set X $at_joblist
1752  shift
1753  for at_group in $at_groups; do
1754    $at_job_control_on 2>/dev/null
1755    (
1756      # Start one test group.
1757      $at_job_control_off
1758      if $at_first; then
1759	exec 7>"$at_job_fifo"
1760      else
1761	exec 6<&-
1762      fi
1763      trap 'set +x; set +e
1764	    trap "" PIPE
1765	    echo stop > "$at_stop_file"
1766	    echo >&7
1767	    as_fn_exit 141' PIPE
1768      at_fn_group_prepare
1769      if cd "$at_group_dir" &&
1770	 at_fn_test $at_group &&
1771	 . "$at_test_source"
1772      then :; else
1773	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5
1774$as_echo "$as_me: WARNING: unable to parse test group: $at_group" >&2;}
1775	at_failed=:
1776      fi
1777      at_fn_group_postprocess
1778      echo >&7
1779    ) &
1780    $at_job_control_off
1781    if $at_first; then
1782      at_first=false
1783      exec 6<"$at_job_fifo" 7>"$at_job_fifo"
1784    fi
1785    shift # Consume one token.
1786    if test $# -gt 0; then :; else
1787      read at_token <&6 || break
1788      set x $*
1789    fi
1790    test -f "$at_stop_file" && break
1791  done
1792  exec 7>&-
1793  # Read back the remaining ($at_jobs - 1) tokens.
1794  set X $at_joblist
1795  shift
1796  if test $# -gt 0; then
1797    shift
1798    for at_job
1799    do
1800      read at_token
1801    done <&6
1802  fi
1803  exec 6<&-
1804  wait
1805else
1806  # Run serially, avoid forks and other potential surprises.
1807  for at_group in $at_groups; do
1808    at_fn_group_prepare
1809    if cd "$at_group_dir" &&
1810       at_fn_test $at_group &&
1811       . "$at_test_source"; then :; else
1812      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5
1813$as_echo "$as_me: WARNING: unable to parse test group: $at_group" >&2;}
1814      at_failed=:
1815    fi
1816    at_fn_group_postprocess
1817    test -f "$at_stop_file" && break
1818    at_first=false
1819  done
1820fi
1821
1822# Wrap up the test suite with summary statistics.
1823cd "$at_helper_dir"
1824
1825# Use ?..???? when the list must remain sorted, the faster * otherwise.
1826at_pass_list=`for f in */pass; do echo $f; done | sed '/\*/d; s,/pass,,'`
1827at_skip_list=`for f in */skip; do echo $f; done | sed '/\*/d; s,/skip,,'`
1828at_xfail_list=`for f in */xfail; do echo $f; done | sed '/\*/d; s,/xfail,,'`
1829at_xpass_list=`for f in ?/xpass ??/xpass ???/xpass ????/xpass; do
1830		 echo $f; done | sed '/?/d; s,/xpass,,'`
1831at_fail_list=`for f in ?/fail ??/fail ???/fail ????/fail; do
1832		echo $f; done | sed '/?/d; s,/fail,,'`
1833
1834set X $at_pass_list $at_xpass_list $at_xfail_list $at_fail_list $at_skip_list
1835shift; at_group_count=$#
1836set X $at_xpass_list; shift; at_xpass_count=$#; at_xpass_list=$*
1837set X $at_xfail_list; shift; at_xfail_count=$#
1838set X $at_fail_list; shift; at_fail_count=$#; at_fail_list=$*
1839set X $at_skip_list; shift; at_skip_count=$#
1840
1841as_fn_arith $at_group_count - $at_skip_count && at_run_count=$as_val
1842as_fn_arith $at_xpass_count + $at_fail_count && at_unexpected_count=$as_val
1843as_fn_arith $at_xfail_count + $at_fail_count && at_total_fail_count=$as_val
1844
1845# Back to the top directory.
1846cd "$at_dir"
1847rm -rf "$at_helper_dir"
1848
1849# Compute the duration of the suite.
1850at_stop_date=`date`
1851at_stop_time=`date +%s 2>/dev/null`
1852$as_echo "$as_me: ending at: $at_stop_date" >&5
1853case $at_start_time,$at_stop_time in
1854  [0-9]*,[0-9]*)
1855    as_fn_arith $at_stop_time - $at_start_time && at_duration_s=$as_val
1856    as_fn_arith $at_duration_s / 60 && at_duration_m=$as_val
1857    as_fn_arith $at_duration_m / 60 && at_duration_h=$as_val
1858    as_fn_arith $at_duration_s % 60 && at_duration_s=$as_val
1859    as_fn_arith $at_duration_m % 60 && at_duration_m=$as_val
1860    at_duration="${at_duration_h}h ${at_duration_m}m ${at_duration_s}s"
1861    $as_echo "$as_me: test suite duration: $at_duration" >&5
1862    ;;
1863esac
1864
1865echo
1866$as_echo "## ------------- ##
1867## Test results. ##
1868## ------------- ##"
1869echo
1870{
1871  echo
1872  $as_echo "## ------------- ##
1873## Test results. ##
1874## ------------- ##"
1875  echo
1876} >&5
1877
1878if test $at_run_count = 1; then
1879  at_result="1 test"
1880  at_were=was
1881else
1882  at_result="$at_run_count tests"
1883  at_were=were
1884fi
1885if $at_errexit_p && test $at_unexpected_count != 0; then
1886  if test $at_xpass_count = 1; then
1887    at_result="$at_result $at_were run, one passed"
1888  else
1889    at_result="$at_result $at_were run, one failed"
1890  fi
1891  at_result="$at_result unexpectedly and inhibited subsequent tests."
1892  at_color=$at_red
1893else
1894  # Don't you just love exponential explosion of the number of cases?
1895  at_color=$at_red
1896  case $at_xpass_count:$at_fail_count:$at_xfail_count in
1897    # So far, so good.
1898    0:0:0) at_result="$at_result $at_were successful." at_color=$at_grn ;;
1899    0:0:*) at_result="$at_result behaved as expected." at_color=$at_lgn ;;
1900
1901    # Some unexpected failures
1902    0:*:0) at_result="$at_result $at_were run,
1903$at_fail_count failed unexpectedly." ;;
1904
1905    # Some failures, both expected and unexpected
1906    0:*:1) at_result="$at_result $at_were run,
1907$at_total_fail_count failed ($at_xfail_count expected failure)." ;;
1908    0:*:*) at_result="$at_result $at_were run,
1909$at_total_fail_count failed ($at_xfail_count expected failures)." ;;
1910
1911    # No unexpected failures, but some xpasses
1912    *:0:*) at_result="$at_result $at_were run,
1913$at_xpass_count passed unexpectedly." ;;
1914
1915    # No expected failures, but failures and xpasses
1916    *:1:0) at_result="$at_result $at_were run,
1917$at_unexpected_count did not behave as expected ($at_fail_count unexpected failure)." ;;
1918    *:*:0) at_result="$at_result $at_were run,
1919$at_unexpected_count did not behave as expected ($at_fail_count unexpected failures)." ;;
1920
1921    # All of them.
1922    *:*:1) at_result="$at_result $at_were run,
1923$at_xpass_count passed unexpectedly,
1924$at_total_fail_count failed ($at_xfail_count expected failure)." ;;
1925    *:*:*) at_result="$at_result $at_were run,
1926$at_xpass_count passed unexpectedly,
1927$at_total_fail_count failed ($at_xfail_count expected failures)." ;;
1928  esac
1929
1930  if test $at_skip_count = 0 && test $at_run_count -gt 1; then
1931    at_result="All $at_result"
1932  fi
1933fi
1934
1935# Now put skips in the mix.
1936case $at_skip_count in
1937  0) ;;
1938  1) at_result="$at_result
19391 test was skipped." ;;
1940  *) at_result="$at_result
1941$at_skip_count tests were skipped." ;;
1942esac
1943
1944if test $at_unexpected_count = 0; then
1945  echo "$at_color$at_result$at_std"
1946  echo "$at_result" >&5
1947else
1948  echo "${at_color}ERROR: $at_result$at_std" >&2
1949  echo "ERROR: $at_result" >&5
1950  {
1951    echo
1952    $as_echo "## ------------------------ ##
1953## Summary of the failures. ##
1954## ------------------------ ##"
1955
1956    # Summary of failed and skipped tests.
1957    if test $at_fail_count != 0; then
1958      echo "Failed tests:"
1959      $SHELL "$at_myself" $at_fail_list --list
1960      echo
1961    fi
1962    if test $at_skip_count != 0; then
1963      echo "Skipped tests:"
1964      $SHELL "$at_myself" $at_skip_list --list
1965      echo
1966    fi
1967    if test $at_xpass_count != 0; then
1968      echo "Unexpected passes:"
1969      $SHELL "$at_myself" $at_xpass_list --list
1970      echo
1971    fi
1972    if test $at_fail_count != 0; then
1973      $as_echo "## ---------------------- ##
1974## Detailed failed tests. ##
1975## ---------------------- ##"
1976      echo
1977      for at_group in $at_fail_list
1978      do
1979	at_group_normalized=$at_group
1980
1981  eval 'while :; do
1982    case $at_group_normalized in #(
1983    '"$at_format"'*) break;;
1984    esac
1985    at_group_normalized=0$at_group_normalized
1986  done'
1987
1988	cat "$at_suite_dir/$at_group_normalized/$as_me.log"
1989	echo
1990      done
1991      echo
1992    fi
1993    if test -n "$at_top_srcdir"; then
1994      sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
1995## ${at_top_build_prefix}config.log ##
1996_ASBOX
1997      sed 's/^/| /' ${at_top_build_prefix}config.log
1998      echo
1999    fi
2000  } >&5
2001
2002  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
2003## $as_me.log was created. ##
2004_ASBOX
2005
2006  echo
2007  if $at_debug_p; then
2008    at_msg='per-test log files'
2009  else
2010    at_msg="\`${at_testdir+${at_testdir}/}$as_me.log'"
2011  fi
2012  $as_echo "Please send $at_msg and all information you think might help:
2013
2014   To: <bug-dico@gnu.org>
2015   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}
2016
2017You may investigate any problem if you feel able to do so, in which
2018case the test suite provides a good starting point.  Its output may
2019be found below \`${at_testdir+${at_testdir}/}$as_me.dir'.
2020"
2021  exit 1
2022fi
2023
2024exit 0
2025
2026## ------------- ##
2027## Actual tests. ##
2028## ------------- ##
2029#AT_START_1
2030at_fn_group_banner 1 'testsuite.at:28' \
2031  "dicod version" "                                  "
2032at_xfail=no
2033(
2034  $as_echo "1. $at_setup_line: testing $at_desc ..."
2035  $at_traceon
2036
2037
2038{ set +x
2039$as_echo "$at_srcdir/testsuite.at:28: dicod --version | sed '1{s/ *\\[.*\\]//;q;}' "
2040at_fn_check_prepare_notrace 'a shell pipeline' "testsuite.at:28"
2041( $at_check_trace; dicod --version | sed '1{s/ *\[.*\]//;q;}'
2042) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2043at_status=$? at_failed=false
2044$at_check_filter
2045at_fn_diff_devnull "$at_stderr" || at_failed=:
2046echo >>"$at_stdout"; $as_echo "dicod (GNU dico) 2.10
2047" | \
2048  $at_diff - "$at_stdout" || at_failed=:
2049at_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:28"
2050if $at_failed; then :
2051  cat >.xfailfile <<'_EOT'
2052
2053==============================================================
2054WARNING: Not using the proper version, *all* checks dubious...
2055==============================================================
2056_EOT
2057
2058else
2059  rm -f $XFAILFILE
2060fi
2061$at_failed && at_fn_log_failure
2062$at_traceon; }
2063
2064  set +x
2065  $at_times_p && times >"$at_times_file"
2066) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2067read at_status <"$at_status_file"
2068#AT_STOP_1
2069#AT_START_2
2070at_fn_group_banner 2 'startup.at:17' \
2071  "startup" "                                        "
2072at_xfail=no
2073(
2074  $as_echo "2. $at_setup_line: testing $at_desc ..."
2075  $at_traceon
2076
2077
2078
2079cat >input <<'_ATEOF'
2080quit
2081_ATEOF
2082
2083{ set +x
2084$as_echo "$at_srcdir/startup.at:22:
2085cat > dicod.conf <<__EOT__
2086prepend-load-path \"\$abs_builddir\";
2087load-module echo;
2088
2089database {
2090	name dummy;
2091	handler echo;
2092}
2093
2094__EOT__
2095
2096
2097dicod --config ./dicod.conf --stderr -i < input  | tr -d '\\r' | sed 's/^\\(2[25][0-9]\\) .*/\\1/;s/ *\$//' "
2098at_fn_check_prepare_notrace 'an embedded newline' "startup.at:22"
2099( $at_check_trace;
2100cat > dicod.conf <<__EOT__
2101prepend-load-path "$abs_builddir";
2102load-module echo;
2103
2104database {
2105	name dummy;
2106	handler echo;
2107}
2108
2109__EOT__
2110
2111
2112dicod --config ./dicod.conf --stderr -i < input  | tr -d '\r' | sed 's/^\(2[25][0-9]\) .*/\1/;s/ *$//'
2113) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2114at_status=$? at_failed=false
2115$at_check_filter
2116at_fn_diff_devnull "$at_stderr" || at_failed=:
2117echo >>"$at_stdout"; $as_echo "220
2118221
2119" | \
2120  $at_diff - "$at_stdout" || at_failed=:
2121at_fn_check_status 0 $at_status "$at_srcdir/startup.at:22"
2122$at_failed && at_fn_log_failure
2123$at_traceon; }
2124
2125
2126  set +x
2127  $at_times_p && times >"$at_times_file"
2128) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2129read at_status <"$at_status_file"
2130#AT_STOP_2
2131#AT_START_3
2132at_fn_group_banner 3 'help00.at:17' \
2133  "help" "                                           " 1
2134at_xfail=no
2135(
2136  $as_echo "3. $at_setup_line: testing $at_desc ..."
2137  $at_traceon
2138
2139
2140cat >input <<'_ATEOF'
2141help
2142quit
2143_ATEOF
2144
2145
2146{ set +x
2147$as_echo "$at_srcdir/help00.at:23:
2148cat > dicod.conf <<__EOT__
2149prepend-load-path \"\$abs_builddir\";
2150load-module echo;
2151
2152database {
2153	name dummy;
2154	handler \"echo null\";
2155}
2156
2157__EOT__
2158
2159
2160dicod --config ./dicod.conf --stderr -i < input  | tr -d '\\r' | sed 's/^\\(2[25][0-9]\\) .*/\\1/;s/ *\$//' |sed '/SASLAUTH/d'"
2161at_fn_check_prepare_notrace 'an embedded newline' "help00.at:23"
2162( $at_check_trace;
2163cat > dicod.conf <<__EOT__
2164prepend-load-path "$abs_builddir";
2165load-module echo;
2166
2167database {
2168	name dummy;
2169	handler "echo null";
2170}
2171
2172__EOT__
2173
2174
2175dicod --config ./dicod.conf --stderr -i < input  | tr -d '\r' | sed 's/^\(2[25][0-9]\) .*/\1/;s/ *$//' |sed '/SASLAUTH/d'
2176) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2177at_status=$? at_failed=false
2178$at_check_filter
2179at_fn_diff_devnull "$at_stderr" || at_failed=:
2180echo >>"$at_stdout"; $as_echo "220
2181113 help text follows
2182DEFINE database word            -- look up word in database
2183MATCH database strategy word    -- match word in database using strategy
2184SHOW DB                         -- list all accessible databases
2185SHOW DATABASES                  -- list all accessible databases
2186SHOW STRAT                      -- list available matching strategies
2187SHOW STRATEGIES                 -- list available matching strategies
2188SHOW INFO database              -- provide information about the database
2189SHOW SERVER                     -- provide site-specific information
2190CLIENT info                     -- identify client to server
2191STATUS                          -- display timing information
2192HELP                            -- display this help information
2193QUIT                            -- terminate connection
2194
2195.
2196250
2197221
2198" | \
2199  $at_diff - "$at_stdout" || at_failed=:
2200at_fn_check_status 0 $at_status "$at_srcdir/help00.at:23"
2201$at_failed && at_fn_log_failure
2202$at_traceon; }
2203
2204
2205  set +x
2206  $at_times_p && times >"$at_times_file"
2207) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2208read at_status <"$at_status_file"
2209#AT_STOP_3
2210#AT_START_4
2211at_fn_group_banner 4 'help01.at:17' \
2212  "help reflects capabilities" "                     " 1
2213at_xfail=no
2214(
2215  $as_echo "4. $at_setup_line: testing $at_desc ..."
2216  $at_traceon
2217
2218
2219cat >input <<'_ATEOF'
2220help
2221quit
2222_ATEOF
2223
2224
2225{ set +x
2226$as_echo "$at_srcdir/help01.at:23:
2227cat > dicod.conf <<__EOT__
2228prepend-load-path \"\$abs_builddir\";
2229load-module echo;
2230
2231capability auth;
2232user-db text://\$abs_srcdir {
2233        password-resource passwd;
2234        group-resource group;
2235}
2236database {
2237	name dummy;
2238	handler \"echo null\";
2239}
2240
2241__EOT__
2242
2243
2244dicod --config ./dicod.conf --stderr -i < input  | tr -d '\\r' | sed 's/^\\(2[25][0-9]\\) .*/\\1/;s/ *\$//' |sed '/SASLAUTH/d'"
2245at_fn_check_prepare_notrace 'an embedded newline' "help01.at:23"
2246( $at_check_trace;
2247cat > dicod.conf <<__EOT__
2248prepend-load-path "$abs_builddir";
2249load-module echo;
2250
2251capability auth;
2252user-db text://$abs_srcdir {
2253        password-resource passwd;
2254        group-resource group;
2255}
2256database {
2257	name dummy;
2258	handler "echo null";
2259}
2260
2261__EOT__
2262
2263
2264dicod --config ./dicod.conf --stderr -i < input  | tr -d '\r' | sed 's/^\(2[25][0-9]\) .*/\1/;s/ *$//' |sed '/SASLAUTH/d'
2265) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2266at_status=$? at_failed=false
2267$at_check_filter
2268at_fn_diff_devnull "$at_stderr" || at_failed=:
2269echo >>"$at_stdout"; $as_echo "220
2270113 help text follows
2271DEFINE database word            -- look up word in database
2272MATCH database strategy word    -- match word in database using strategy
2273SHOW DB                         -- list all accessible databases
2274SHOW DATABASES                  -- list all accessible databases
2275SHOW STRAT                      -- list available matching strategies
2276SHOW STRATEGIES                 -- list available matching strategies
2277SHOW INFO database              -- provide information about the database
2278SHOW SERVER                     -- provide site-specific information
2279CLIENT info                     -- identify client to server
2280STATUS                          -- display timing information
2281HELP                            -- display this help information
2282QUIT                            -- terminate connection
2283AUTH user string                -- provide authentication information
2284
2285.
2286250
2287221
2288" | \
2289  $at_diff - "$at_stdout" || at_failed=:
2290at_fn_check_status 0 $at_status "$at_srcdir/help01.at:23"
2291$at_failed && at_fn_log_failure
2292$at_traceon; }
2293
2294
2295  set +x
2296  $at_times_p && times >"$at_times_file"
2297) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2298read at_status <"$at_status_file"
2299#AT_STOP_4
2300#AT_START_5
2301at_fn_group_banner 5 'help02.at:17' \
2302  "user-defined help" "                              " 1
2303at_xfail=no
2304(
2305  $as_echo "5. $at_setup_line: testing $at_desc ..."
2306  $at_traceon
2307
2308
2309cat >input <<'_ATEOF'
2310help
2311quit
2312_ATEOF
2313
2314
2315{ set +x
2316$as_echo "$at_srcdir/help02.at:23:
2317cat > dicod.conf <<__EOT__
2318prepend-load-path \"\$abs_builddir\";
2319load-module echo;
2320
2321help-text <<EOT
2322No special help is available
2323for this server.
2324EOT;
2325
2326database {
2327	name dummy;
2328	handler \"echo null\";
2329}
2330
2331__EOT__
2332
2333
2334dicod --config ./dicod.conf --stderr -i < input  | tr -d '\\r' | sed 's/^\\(2[25][0-9]\\) .*/\\1/;s/ *\$//' |sed '/SASLAUTH/d'"
2335at_fn_check_prepare_notrace 'an embedded newline' "help02.at:23"
2336( $at_check_trace;
2337cat > dicod.conf <<__EOT__
2338prepend-load-path "$abs_builddir";
2339load-module echo;
2340
2341help-text <<EOT
2342No special help is available
2343for this server.
2344EOT;
2345
2346database {
2347	name dummy;
2348	handler "echo null";
2349}
2350
2351__EOT__
2352
2353
2354dicod --config ./dicod.conf --stderr -i < input  | tr -d '\r' | sed 's/^\(2[25][0-9]\) .*/\1/;s/ *$//' |sed '/SASLAUTH/d'
2355) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2356at_status=$? at_failed=false
2357$at_check_filter
2358at_fn_diff_devnull "$at_stderr" || at_failed=:
2359echo >>"$at_stdout"; $as_echo "220
2360113 help text follows
2361No special help is available
2362for this server.
2363
2364.
2365250
2366221
2367" | \
2368  $at_diff - "$at_stdout" || at_failed=:
2369at_fn_check_status 0 $at_status "$at_srcdir/help02.at:23"
2370$at_failed && at_fn_log_failure
2371$at_traceon; }
2372
2373
2374  set +x
2375  $at_times_p && times >"$at_times_file"
2376) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2377read at_status <"$at_status_file"
2378#AT_STOP_5
2379#AT_START_6
2380at_fn_group_banner 6 'help03.at:17' \
2381  "user-augmented help" "                            " 1
2382at_xfail=no
2383(
2384  $as_echo "6. $at_setup_line: testing $at_desc ..."
2385  $at_traceon
2386
2387
2388cat >input <<'_ATEOF'
2389help
2390quit
2391_ATEOF
2392
2393
2394{ set +x
2395$as_echo "$at_srcdir/help03.at:23:
2396cat > dicod.conf <<__EOT__
2397prepend-load-path \"\$abs_builddir\";
2398load-module echo;
2399
2400help-text <<EOT
2401+
2402Have fun!
2403EOT;
2404database {
2405	name dummy;
2406	handler \"echo null\";
2407}
2408
2409__EOT__
2410
2411
2412dicod --config ./dicod.conf --stderr -i < input  | tr -d '\\r' | sed 's/^\\(2[25][0-9]\\) .*/\\1/;s/ *\$//' |sed '/SASLAUTH/d'"
2413at_fn_check_prepare_notrace 'an embedded newline' "help03.at:23"
2414( $at_check_trace;
2415cat > dicod.conf <<__EOT__
2416prepend-load-path "$abs_builddir";
2417load-module echo;
2418
2419help-text <<EOT
2420+
2421Have fun!
2422EOT;
2423database {
2424	name dummy;
2425	handler "echo null";
2426}
2427
2428__EOT__
2429
2430
2431dicod --config ./dicod.conf --stderr -i < input  | tr -d '\r' | sed 's/^\(2[25][0-9]\) .*/\1/;s/ *$//' |sed '/SASLAUTH/d'
2432) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2433at_status=$? at_failed=false
2434$at_check_filter
2435at_fn_diff_devnull "$at_stderr" || at_failed=:
2436echo >>"$at_stdout"; $as_echo "220
2437113 help text follows
2438DEFINE database word            -- look up word in database
2439MATCH database strategy word    -- match word in database using strategy
2440SHOW DB                         -- list all accessible databases
2441SHOW DATABASES                  -- list all accessible databases
2442SHOW STRAT                      -- list available matching strategies
2443SHOW STRATEGIES                 -- list available matching strategies
2444SHOW INFO database              -- provide information about the database
2445SHOW SERVER                     -- provide site-specific information
2446CLIENT info                     -- identify client to server
2447STATUS                          -- display timing information
2448HELP                            -- display this help information
2449QUIT                            -- terminate connection
2450
2451Have fun!
2452
2453.
2454250
2455221
2456" | \
2457  $at_diff - "$at_stdout" || at_failed=:
2458at_fn_check_status 0 $at_status "$at_srcdir/help03.at:23"
2459$at_failed && at_fn_log_failure
2460$at_traceon; }
2461
2462
2463  set +x
2464  $at_times_p && times >"$at_times_file"
2465) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2466read at_status <"$at_status_file"
2467#AT_STOP_6
2468#AT_START_7
2469at_fn_group_banner 7 'showstrat.at:17' \
2470  "show strategies" "                                " 2
2471at_xfail=no
2472(
2473  $as_echo "7. $at_setup_line: testing $at_desc ..."
2474  $at_traceon
2475
2476
2477
2478cat >input <<'_ATEOF'
2479show strategies
2480quit
2481_ATEOF
2482
2483
2484{ set +x
2485$as_echo "$at_srcdir/showstrat.at:24:
2486cat > dicod.conf <<__EOT__
2487prepend-load-path \"\$abs_builddir\";
2488load-module echo;
2489
2490database {
2491	name dummy;
2492	handler echo;
2493}
2494
2495__EOT__
2496
2497
2498dicod --config ./dicod.conf --stderr -i < input  | tr -d '\\r' | sed 's/^\\(2[25][0-9]\\) .*/\\1/;s/ *\$//' "
2499at_fn_check_prepare_notrace 'an embedded newline' "showstrat.at:24"
2500( $at_check_trace;
2501cat > dicod.conf <<__EOT__
2502prepend-load-path "$abs_builddir";
2503load-module echo;
2504
2505database {
2506	name dummy;
2507	handler echo;
2508}
2509
2510__EOT__
2511
2512
2513dicod --config ./dicod.conf --stderr -i < input  | tr -d '\r' | sed 's/^\(2[25][0-9]\) .*/\1/;s/ *$//'
2514) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2515at_status=$? at_failed=false
2516$at_check_filter
2517at_fn_diff_devnull "$at_stderr" || at_failed=:
2518echo >>"$at_stdout"; $as_echo "220
2519111 10 strategies present: list follows
2520exact \"Match words exactly\"
2521prefix \"Match word prefixes\"
2522suffix \"Match word suffixes\"
2523soundex \"Match using SOUNDEX algorithm\"
2524lev \"Match headwords within given Levenshtein distance\"
2525nlev \"Match headwords within given Levenshtein distance (normalized)\"
2526dlev \"Match headwords within given Damerau-Levenshtein distance\"
2527ndlev \"Match headwords within given Damerau-Levenshtein distance (normalized)\"
2528re \"POSIX 1003.2 (modern) regular expressions\"
2529regexp \"Old (basic) regular expressions\"
2530.
2531250
2532221
2533" | \
2534  $at_diff - "$at_stdout" || at_failed=:
2535at_fn_check_status 0 $at_status "$at_srcdir/showstrat.at:24"
2536$at_failed && at_fn_log_failure
2537$at_traceon; }
2538
2539
2540  set +x
2541  $at_times_p && times >"$at_times_file"
2542) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2543read at_status <"$at_status_file"
2544#AT_STOP_7
2545#AT_START_8
2546at_fn_group_banner 8 'showdb.at:17' \
2547  "show databases" "                                 " 2
2548at_xfail=no
2549(
2550  $as_echo "8. $at_setup_line: testing $at_desc ..."
2551  $at_traceon
2552
2553
2554cat >input <<'_ATEOF'
2555show databases
2556quit
2557_ATEOF
2558
2559
2560{ set +x
2561$as_echo "$at_srcdir/showdb.at:23:
2562cat > dicod.conf <<__EOT__
2563prepend-load-path \"\$abs_builddir\";
2564load-module echo;
2565
2566database a {
2567	name \"A\";
2568	handler echo;
2569	description \"Database A\";
2570}
2571database b {
2572	name \"B\";
2573	handler echo;
2574	description \"Database B\";
2575}
2576
2577__EOT__
2578
2579
2580dicod --config ./dicod.conf --stderr -i < input  | tr -d '\\r' | sed 's/^\\(2[25][0-9]\\) .*/\\1/;s/ *\$//'
2581"
2582at_fn_check_prepare_notrace 'an embedded newline' "showdb.at:23"
2583( $at_check_trace;
2584cat > dicod.conf <<__EOT__
2585prepend-load-path "$abs_builddir";
2586load-module echo;
2587
2588database a {
2589	name "A";
2590	handler echo;
2591	description "Database A";
2592}
2593database b {
2594	name "B";
2595	handler echo;
2596	description "Database B";
2597}
2598
2599__EOT__
2600
2601
2602dicod --config ./dicod.conf --stderr -i < input  | tr -d '\r' | sed 's/^\(2[25][0-9]\) .*/\1/;s/ *$//'
2603
2604) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2605at_status=$? at_failed=false
2606$at_check_filter
2607at_fn_diff_devnull "$at_stderr" || at_failed=:
2608echo >>"$at_stdout"; $as_echo "220
2609110 2 databases present
2610A \"Database A\"
2611B \"Database B\"
2612.
2613250
2614221
2615" | \
2616  $at_diff - "$at_stdout" || at_failed=:
2617at_fn_check_status 0 $at_status "$at_srcdir/showdb.at:23"
2618$at_failed && at_fn_log_failure
2619$at_traceon; }
2620
2621
2622  set +x
2623  $at_times_p && times >"$at_times_file"
2624) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2625read at_status <"$at_status_file"
2626#AT_STOP_8
2627#AT_START_9
2628at_fn_group_banner 9 'info.at:17' \
2629  "info" "                                           " 2
2630at_xfail=no
2631(
2632  $as_echo "9. $at_setup_line: testing $at_desc ..."
2633  $at_traceon
2634
2635
2636cat >input <<'_ATEOF'
2637show db
2638quit
2639_ATEOF
2640
2641
2642{ set +x
2643$as_echo "$at_srcdir/info.at:24:
2644cat > dicod.conf <<__EOT__
2645prepend-load-path \"\$abs_builddir\";
2646load-module echo;
2647
2648database {
2649	name dummy;
2650	handler \"echo null\";
2651}
2652
2653__EOT__
2654
2655dicod --config ./dicod.conf --stderr -i < input  | tr -d '\\r' | sed 's/^\\(2[25][0-9]\\) .*/\\1/;s/ *\$//' "
2656at_fn_check_prepare_notrace 'an embedded newline' "info.at:24"
2657( $at_check_trace;
2658cat > dicod.conf <<__EOT__
2659prepend-load-path "$abs_builddir";
2660load-module echo;
2661
2662database {
2663	name dummy;
2664	handler "echo null";
2665}
2666
2667__EOT__
2668
2669dicod --config ./dicod.conf --stderr -i < input  | tr -d '\r' | sed 's/^\(2[25][0-9]\) .*/\1/;s/ *$//'
2670) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2671at_status=$? at_failed=false
2672$at_check_filter
2673at_fn_diff_devnull "$at_stderr" || at_failed=:
2674echo >>"$at_stdout"; $as_echo "220
2675110 1 databases present
2676dummy \"GNU Dico NULL database\"
2677.
2678250
2679221
2680" | \
2681  $at_diff - "$at_stdout" || at_failed=:
2682at_fn_check_status 0 $at_status "$at_srcdir/info.at:24"
2683$at_failed && at_fn_log_failure
2684$at_traceon; }
2685
2686
2687  set +x
2688  $at_times_p && times >"$at_times_file"
2689) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2690read at_status <"$at_status_file"
2691#AT_STOP_9
2692#AT_START_10
2693at_fn_group_banner 10 'descr.at:17' \
2694  "descr" "                                          " 2
2695at_xfail=no
2696(
2697  $as_echo "10. $at_setup_line: testing $at_desc ..."
2698  $at_traceon
2699
2700
2701cat >input <<'_ATEOF'
2702show info dummy
2703quit
2704_ATEOF
2705
2706
2707{ set +x
2708$as_echo "$at_srcdir/descr.at:24:
2709cat > dicod.conf <<__EOT__
2710prepend-load-path \"\$abs_builddir\";
2711load-module echo;
2712
2713database {
2714	name dummy;
2715	handler \"echo null\";
2716}
2717
2718__EOT__
2719
2720
2721dicod --config ./dicod.conf --stderr -i < input  | tr -d '\\r' | sed 's/^\\(2[25][0-9]\\) .*/\\1/;s/ *\$//' "
2722at_fn_check_prepare_notrace 'an embedded newline' "descr.at:24"
2723( $at_check_trace;
2724cat > dicod.conf <<__EOT__
2725prepend-load-path "$abs_builddir";
2726load-module echo;
2727
2728database {
2729	name dummy;
2730	handler "echo null";
2731}
2732
2733__EOT__
2734
2735
2736dicod --config ./dicod.conf --stderr -i < input  | tr -d '\r' | sed 's/^\(2[25][0-9]\) .*/\1/;s/ *$//'
2737) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2738at_status=$? at_failed=false
2739$at_check_filter
2740at_fn_diff_devnull "$at_stderr" || at_failed=:
2741echo >>"$at_stdout"; $as_echo "220
2742112 information for dummy
2743NULL database.
2744
2745This database returns NULL (no result) to any match and define
2746requests.
2747
2748.
2749250
2750221
2751" | \
2752  $at_diff - "$at_stdout" || at_failed=:
2753at_fn_check_status 0 $at_status "$at_srcdir/descr.at:24"
2754$at_failed && at_fn_log_failure
2755$at_traceon; }
2756
2757
2758  set +x
2759  $at_times_p && times >"$at_times_file"
2760) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2761read at_status <"$at_status_file"
2762#AT_STOP_10
2763#AT_START_11
2764at_fn_group_banner 11 'match.at:17' \
2765  "match" "                                          " 3
2766at_xfail=no
2767(
2768  $as_echo "11. $at_setup_line: testing $at_desc ..."
2769  $at_traceon
2770
2771
2772cat >input <<'_ATEOF'
2773match * . test
2774quit
2775_ATEOF
2776
2777
2778{ set +x
2779$as_echo "$at_srcdir/match.at:23:
2780cat > dicod.conf <<__EOT__
2781prepend-load-path \"\$abs_builddir\";
2782load-module echo;
2783
2784database {
2785	name echo;
2786	handler echo;
2787}
2788
2789__EOT__
2790
2791
2792dicod --config ./dicod.conf --stderr -i < input  | tr -d '\\r' | sed 's/^\\(2[25][0-9]\\) .*/\\1/;s/ *\$//' "
2793at_fn_check_prepare_notrace 'an embedded newline' "match.at:23"
2794( $at_check_trace;
2795cat > dicod.conf <<__EOT__
2796prepend-load-path "$abs_builddir";
2797load-module echo;
2798
2799database {
2800	name echo;
2801	handler echo;
2802}
2803
2804__EOT__
2805
2806
2807dicod --config ./dicod.conf --stderr -i < input  | tr -d '\r' | sed 's/^\(2[25][0-9]\) .*/\1/;s/ *$//'
2808) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2809at_status=$? at_failed=false
2810$at_check_filter
2811at_fn_diff_devnull "$at_stderr" || at_failed=:
2812echo >>"$at_stdout"; $as_echo "220
2813152 1 matches found: list follows
2814echo \"test\"
2815.
2816250
2817221
2818" | \
2819  $at_diff - "$at_stdout" || at_failed=:
2820at_fn_check_status 0 $at_status "$at_srcdir/match.at:23"
2821$at_failed && at_fn_log_failure
2822$at_traceon; }
2823
2824
2825  set +x
2826  $at_times_p && times >"$at_times_file"
2827) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2828read at_status <"$at_status_file"
2829#AT_STOP_11
2830#AT_START_12
2831at_fn_group_banner 12 'nomatch.at:17' \
2832  "no match" "                                       " 3
2833at_xfail=no
2834(
2835  $as_echo "12. $at_setup_line: testing $at_desc ..."
2836  $at_traceon
2837
2838
2839cat >input <<'_ATEOF'
2840match * . test
2841quit
2842_ATEOF
2843
2844
2845{ set +x
2846$as_echo "$at_srcdir/nomatch.at:23:
2847cat > dicod.conf <<__EOT__
2848prepend-load-path \"\$abs_builddir\";
2849load-module echo;
2850
2851database {
2852	name dummy;
2853	handler \"echo null\";
2854}
2855
2856__EOT__
2857
2858
2859dicod --config ./dicod.conf --stderr -i < input  | tr -d '\\r' | sed 's/^\\(2[25][0-9]\\) .*/\\1/;s/ *\$//' "
2860at_fn_check_prepare_notrace 'an embedded newline' "nomatch.at:23"
2861( $at_check_trace;
2862cat > dicod.conf <<__EOT__
2863prepend-load-path "$abs_builddir";
2864load-module echo;
2865
2866database {
2867	name dummy;
2868	handler "echo null";
2869}
2870
2871__EOT__
2872
2873
2874dicod --config ./dicod.conf --stderr -i < input  | tr -d '\r' | sed 's/^\(2[25][0-9]\) .*/\1/;s/ *$//'
2875) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2876at_status=$? at_failed=false
2877$at_check_filter
2878at_fn_diff_devnull "$at_stderr" || at_failed=:
2879echo >>"$at_stdout"; $as_echo "220
2880552 No match
2881221
2882" | \
2883  $at_diff - "$at_stdout" || at_failed=:
2884at_fn_check_status 0 $at_status "$at_srcdir/nomatch.at:23"
2885$at_failed && at_fn_log_failure
2886$at_traceon; }
2887
2888
2889  set +x
2890  $at_times_p && times >"$at_times_file"
2891) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2892read at_status <"$at_status_file"
2893#AT_STOP_12
2894#AT_START_13
2895at_fn_group_banner 13 'def.at:17' \
2896  "define" "                                         " 4
2897at_xfail=no
2898(
2899  $as_echo "13. $at_setup_line: testing $at_desc ..."
2900  $at_traceon
2901
2902
2903cat >input <<'_ATEOF'
2904define * test
2905quit
2906_ATEOF
2907
2908
2909{ set +x
2910$as_echo "$at_srcdir/def.at:23:
2911cat > dicod.conf <<__EOT__
2912prepend-load-path \"\$abs_builddir\";
2913load-module echo;
2914
2915database {
2916	name echo;
2917	handler echo;
2918}
2919
2920__EOT__
2921
2922
2923dicod --config ./dicod.conf --stderr -i < input  | tr -d '\\r' | sed 's/^\\(2[25][0-9]\\) .*/\\1/;s/ *\$//' "
2924at_fn_check_prepare_notrace 'an embedded newline' "def.at:23"
2925( $at_check_trace;
2926cat > dicod.conf <<__EOT__
2927prepend-load-path "$abs_builddir";
2928load-module echo;
2929
2930database {
2931	name echo;
2932	handler echo;
2933}
2934
2935__EOT__
2936
2937
2938dicod --config ./dicod.conf --stderr -i < input  | tr -d '\r' | sed 's/^\(2[25][0-9]\) .*/\1/;s/ *$//'
2939) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2940at_status=$? at_failed=false
2941$at_check_filter
2942at_fn_diff_devnull "$at_stderr" || at_failed=:
2943echo >>"$at_stdout"; $as_echo "220
2944150 1 definitions found: list follows
2945151 \"test\" echo \"GNU Dico ECHO database\"
2946test
2947.
2948250
2949221
2950" | \
2951  $at_diff - "$at_stdout" || at_failed=:
2952at_fn_check_status 0 $at_status "$at_srcdir/def.at:23"
2953$at_failed && at_fn_log_failure
2954$at_traceon; }
2955
2956
2957  set +x
2958  $at_times_p && times >"$at_times_file"
2959) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2960read at_status <"$at_status_file"
2961#AT_STOP_13
2962#AT_START_14
2963at_fn_group_banner 14 'nodef.at:17' \
2964  "no definition" "                                  " 4
2965at_xfail=no
2966(
2967  $as_echo "14. $at_setup_line: testing $at_desc ..."
2968  $at_traceon
2969
2970
2971cat >input <<'_ATEOF'
2972define * test
2973quit
2974_ATEOF
2975
2976
2977{ set +x
2978$as_echo "$at_srcdir/nodef.at:23:
2979cat > dicod.conf <<__EOT__
2980prepend-load-path \"\$abs_builddir\";
2981load-module echo;
2982
2983database {
2984	name dummy;
2985	handler \"echo null\";
2986}
2987
2988__EOT__
2989
2990
2991dicod --config ./dicod.conf --stderr -i < input  | tr -d '\\r' | sed 's/^\\(2[25][0-9]\\) .*/\\1/;s/ *\$//' "
2992at_fn_check_prepare_notrace 'an embedded newline' "nodef.at:23"
2993( $at_check_trace;
2994cat > dicod.conf <<__EOT__
2995prepend-load-path "$abs_builddir";
2996load-module echo;
2997
2998database {
2999	name dummy;
3000	handler "echo null";
3001}
3002
3003__EOT__
3004
3005
3006dicod --config ./dicod.conf --stderr -i < input  | tr -d '\r' | sed 's/^\(2[25][0-9]\) .*/\1/;s/ *$//'
3007) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3008at_status=$? at_failed=false
3009$at_check_filter
3010at_fn_diff_devnull "$at_stderr" || at_failed=:
3011echo >>"$at_stdout"; $as_echo "220
3012552 No match
3013221
3014" | \
3015  $at_diff - "$at_stdout" || at_failed=:
3016at_fn_check_status 0 $at_status "$at_srcdir/nodef.at:23"
3017$at_failed && at_fn_log_failure
3018$at_traceon; }
3019
3020
3021  set +x
3022  $at_times_p && times >"$at_times_file"
3023) 5>&1 2>&1 7>&- | eval $at_tee_pipe
3024read at_status <"$at_status_file"
3025#AT_STOP_14
3026#AT_START_15
3027at_fn_group_banner 15 'vis00.at:17' \
3028  "global visibility-acl" "                          " 5
3029at_xfail=no
3030(
3031  $as_echo "15. $at_setup_line: testing $at_desc ..."
3032  $at_traceon
3033
3034
3035cat >input <<'_ATEOF'
3036show databases
3037quit
3038_ATEOF
3039
3040
3041{ set +x
3042$as_echo "$at_srcdir/vis00.at:23:
3043cat > dicod.conf <<__EOT__
3044prepend-load-path \"\$abs_builddir\";
3045load-module echo;
3046
3047capability auth;
3048acl global {
3049        allow authenticated from any;
3050	deny all;
3051}
3052visibility-acl global;
3053database {
3054	name dummy;
3055	handler echo;
3056}
3057user-db text://\$abs_srcdir {
3058        password-resource passwd;
3059        group-resource group;
3060}
3061
3062__EOT__
3063
3064
3065echo \"Not authenticated\"
3066dicod --config ./dicod.conf --stderr -i < input  | tr -d '\\r' | sed 's/^\\(2[25][0-9]\\) .*/\\1/;s/ *\$//'
3067
3068echo \"Authenticated\"
3069apopauth -script=input gray guessme dicod --config ./dicod.conf --stderr -i
3070"
3071at_fn_check_prepare_notrace 'an embedded newline' "vis00.at:23"
3072( $at_check_trace;
3073cat > dicod.conf <<__EOT__
3074prepend-load-path "$abs_builddir";
3075load-module echo;
3076
3077capability auth;
3078acl global {
3079        allow authenticated from any;
3080	deny all;
3081}
3082visibility-acl global;
3083database {
3084	name dummy;
3085	handler echo;
3086}
3087user-db text://$abs_srcdir {
3088        password-resource passwd;
3089        group-resource group;
3090}
3091
3092__EOT__
3093
3094
3095echo "Not authenticated"
3096dicod --config ./dicod.conf --stderr -i < input  | tr -d '\r' | sed 's/^\(2[25][0-9]\) .*/\1/;s/ *$//'
3097
3098echo "Authenticated"
3099apopauth -script=input gray guessme dicod --config ./dicod.conf --stderr -i
3100
3101) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3102at_status=$? at_failed=false
3103$at_check_filter
3104at_fn_diff_devnull "$at_stderr" || at_failed=:
3105echo >>"$at_stdout"; $as_echo "Not authenticated
3106220
3107554 No databases present
3108221
3109Authenticated
3110110 1 databases present
3111dummy \"GNU Dico ECHO database\"
3112.
3113250 ok
3114221 bye
3115" | \
3116  $at_diff - "$at_stdout" || at_failed=:
3117at_fn_check_status 0 $at_status "$at_srcdir/vis00.at:23"
3118$at_failed && at_fn_log_failure
3119$at_traceon; }
3120
3121
3122  set +x
3123  $at_times_p && times >"$at_times_file"
3124) 5>&1 2>&1 7>&- | eval $at_tee_pipe
3125read at_status <"$at_status_file"
3126#AT_STOP_15
3127#AT_START_16
3128at_fn_group_banner 16 'vis01.at:17' \
3129  "per-database visibility-acl" "                    " 5
3130at_xfail=no
3131(
3132  $as_echo "16. $at_setup_line: testing $at_desc ..."
3133  $at_traceon
3134
3135
3136cat >input <<'_ATEOF'
3137show databases
3138quit
3139_ATEOF
3140
3141
3142{ set +x
3143$as_echo "$at_srcdir/vis01.at:23:
3144cat > dicod.conf <<__EOT__
3145prepend-load-path \"\$abs_builddir\";
3146load-module echo;
3147
3148capability auth;
3149acl global {
3150        allow authenticated;
3151	deny all;
3152}
3153acl admin {
3154	allow group admin;
3155	deny all;
3156}
3157visibility-acl global;
3158database a {
3159	name \"A\";
3160	handler echo;
3161	description \"Globally-visible database\";
3162}
3163database b {
3164	name \"B\";
3165	handler echo;
3166	visibility-acl admin;
3167	description \"Visible for group admin\";
3168}
3169
3170user-db text://\$abs_srcdir {
3171        password-resource passwd;
3172        group-resource group;
3173}
3174
3175__EOT__
3176
3177
3178echo \"Not authenticated\"
3179dicod --config ./dicod.conf --stderr -i < input  | tr -d '\\r' | sed 's/^\\(2[25][0-9]\\) .*/\\1/;s/ *\$//'
3180
3181echo \"Authenticated user\"
3182apopauth -script=input smith testtset dicod --config ./dicod.conf --stderr -i
3183
3184echo \"Authenticated admin\"
3185apopauth -script=input gray guessme dicod --config ./dicod.conf --stderr -i
3186"
3187at_fn_check_prepare_notrace 'an embedded newline' "vis01.at:23"
3188( $at_check_trace;
3189cat > dicod.conf <<__EOT__
3190prepend-load-path "$abs_builddir";
3191load-module echo;
3192
3193capability auth;
3194acl global {
3195        allow authenticated;
3196	deny all;
3197}
3198acl admin {
3199	allow group admin;
3200	deny all;
3201}
3202visibility-acl global;
3203database a {
3204	name "A";
3205	handler echo;
3206	description "Globally-visible database";
3207}
3208database b {
3209	name "B";
3210	handler echo;
3211	visibility-acl admin;
3212	description "Visible for group admin";
3213}
3214
3215user-db text://$abs_srcdir {
3216        password-resource passwd;
3217        group-resource group;
3218}
3219
3220__EOT__
3221
3222
3223echo "Not authenticated"
3224dicod --config ./dicod.conf --stderr -i < input  | tr -d '\r' | sed 's/^\(2[25][0-9]\) .*/\1/;s/ *$//'
3225
3226echo "Authenticated user"
3227apopauth -script=input smith testtset dicod --config ./dicod.conf --stderr -i
3228
3229echo "Authenticated admin"
3230apopauth -script=input gray guessme dicod --config ./dicod.conf --stderr -i
3231
3232) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3233at_status=$? at_failed=false
3234$at_check_filter
3235at_fn_diff_devnull "$at_stderr" || at_failed=:
3236echo >>"$at_stdout"; $as_echo "Not authenticated
3237220
3238554 No databases present
3239221
3240Authenticated user
3241110 1 databases present
3242A \"Globally-visible database\"
3243.
3244250 ok
3245221 bye
3246Authenticated admin
3247110 2 databases present
3248A \"Globally-visible database\"
3249B \"Visible for group admin\"
3250.
3251250 ok
3252221 bye
3253" | \
3254  $at_diff - "$at_stdout" || at_failed=:
3255at_fn_check_status 0 $at_status "$at_srcdir/vis01.at:23"
3256$at_failed && at_fn_log_failure
3257$at_traceon; }
3258
3259
3260  set +x
3261  $at_times_p && times >"$at_times_file"
3262) 5>&1 2>&1 7>&- | eval $at_tee_pipe
3263read at_status <"$at_status_file"
3264#AT_STOP_16
3265#AT_START_17
3266at_fn_group_banner 17 'vis02.at:17' \
3267  "server info visibility" "                         " 5
3268at_xfail=no
3269(
3270  $as_echo "17. $at_setup_line: testing $at_desc ..."
3271  $at_traceon
3272
3273
3274cat >input <<'_ATEOF'
3275show server
3276quit
3277_ATEOF
3278
3279
3280{ set +x
3281$as_echo "$at_srcdir/vis02.at:23:
3282cat > dicod.conf <<__EOT__
3283prepend-load-path \"\$abs_builddir\";
3284load-module echo;
3285
3286capability auth;
3287acl admin {
3288	allow group admin;
3289	deny all;
3290}
3291database a {
3292	name \"A\";
3293	handler echo;
3294}
3295show-sys-info admin;
3296user-db text://\$abs_srcdir {
3297        password-resource passwd;
3298        group-resource group;
3299}
3300
3301__EOT__
3302
3303
3304echo \"Not authenticated\"
3305dicod --config ./dicod.conf --stderr -i < input  | tr -d '\\r' | sed 's/^\\(2[25][0-9]\\) .*/\\1/;s/ *\$//'  | sed 's/dicod server on .*/dicod server/'
3306
3307echo \"Authenticated user\"
3308apopauth -script=input smith testtset dicod --config ./dicod.conf          --stderr -i | sed 's/dicod server on .*/dicod server/'
3309
3310echo \"Authenticated admin\"
3311apopauth -script=input gray guessme dicod --config ./dicod.conf          --stderr -i | sed 's/dicod (GNU dico 2.10).*/dicod version/'
3312"
3313at_fn_check_prepare_notrace 'an embedded newline' "vis02.at:23"
3314( $at_check_trace;
3315cat > dicod.conf <<__EOT__
3316prepend-load-path "$abs_builddir";
3317load-module echo;
3318
3319capability auth;
3320acl admin {
3321	allow group admin;
3322	deny all;
3323}
3324database a {
3325	name "A";
3326	handler echo;
3327}
3328show-sys-info admin;
3329user-db text://$abs_srcdir {
3330        password-resource passwd;
3331        group-resource group;
3332}
3333
3334__EOT__
3335
3336
3337echo "Not authenticated"
3338dicod --config ./dicod.conf --stderr -i < input  | tr -d '\r' | sed 's/^\(2[25][0-9]\) .*/\1/;s/ *$//'  | sed 's/dicod server on .*/dicod server/'
3339
3340echo "Authenticated user"
3341apopauth -script=input smith testtset dicod --config ./dicod.conf          --stderr -i | sed 's/dicod server on .*/dicod server/'
3342
3343echo "Authenticated admin"
3344apopauth -script=input gray guessme dicod --config ./dicod.conf          --stderr -i | sed 's/dicod (GNU dico 2.10).*/dicod version/'
3345
3346) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3347at_status=$? at_failed=false
3348$at_check_filter
3349at_fn_diff_devnull "$at_stderr" || at_failed=:
3350echo >>"$at_stdout"; $as_echo "Not authenticated
3351220
3352114 server information
3353dicod server
3354.
3355250
3356221
3357Authenticated user
3358114 server information
3359dicod server
3360.
3361250 ok
3362221 bye
3363Authenticated admin
3364114 server information
3365dicod version
3366.
3367250 ok
3368221 bye
3369" | \
3370  $at_diff - "$at_stdout" || at_failed=:
3371at_fn_check_status 0 $at_status "$at_srcdir/vis02.at:23"
3372$at_failed && at_fn_log_failure
3373$at_traceon; }
3374
3375
3376  set +x
3377  $at_times_p && times >"$at_times_file"
3378) 5>&1 2>&1 7>&- | eval $at_tee_pipe
3379read at_status <"$at_status_file"
3380#AT_STOP_17
3381#AT_START_18
3382at_fn_group_banner 18 'apop.at:17' \
3383  "apop" "                                           " 6
3384at_xfail=no
3385(
3386  $as_echo "18. $at_setup_line: testing $at_desc ..."
3387  $at_traceon
3388
3389
3390{ set +x
3391$as_echo "$at_srcdir/apop.at:19:
3392cat > dicod.conf <<__EOT__
3393prepend-load-path \"\$abs_builddir\";
3394load-module echo;
3395
3396capability auth;
3397
3398database {
3399	name dummy;
3400	handler \"echo null\";
3401}
3402user-db text://\$abs_srcdir {
3403        password-resource passwd;
3404        group-resource group;
3405}
3406
3407__EOT__
3408
3409
3410apopauth gray guessme dicod --config ./dicod.conf --stderr -i"
3411at_fn_check_prepare_notrace 'an embedded newline' "apop.at:19"
3412( $at_check_trace;
3413cat > dicod.conf <<__EOT__
3414prepend-load-path "$abs_builddir";
3415load-module echo;
3416
3417capability auth;
3418
3419database {
3420	name dummy;
3421	handler "echo null";
3422}
3423user-db text://$abs_srcdir {
3424        password-resource passwd;
3425        group-resource group;
3426}
3427
3428__EOT__
3429
3430
3431apopauth gray guessme dicod --config ./dicod.conf --stderr -i
3432) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3433at_status=$? at_failed=false
3434$at_check_filter
3435at_fn_diff_devnull "$at_stderr" || at_failed=:
3436at_fn_diff_devnull "$at_stdout" || at_failed=:
3437at_fn_check_status 0 $at_status "$at_srcdir/apop.at:19"
3438$at_failed && at_fn_log_failure
3439$at_traceon; }
3440
3441
3442  set +x
3443  $at_times_p && times >"$at_times_file"
3444) 5>&1 2>&1 7>&- | eval $at_tee_pipe
3445read at_status <"$at_status_file"
3446#AT_STOP_18
3447#AT_START_19
3448at_fn_group_banner 19 'alias.at:17' \
3449  "aliases" "                                        " 6
3450at_xfail=no
3451(
3452  $as_echo "19. $at_setup_line: testing $at_desc ..."
3453  $at_traceon
3454
3455
3456cat >input <<'_ATEOF'
3457dblist
3458da word
3459mf test
3460q
3461_ATEOF
3462
3463
3464
3465{ set +x
3466$as_echo "$at_srcdir/alias.at:26:
3467cat > dicod.conf <<__EOT__
3468prepend-load-path \"\$abs_builddir\";
3469load-module echo;
3470
3471database {
3472	name dummy;
3473	handler \"echo null\";
3474}
3475alias dblist show databases;
3476alias d DEFINE;
3477alias da d \"*\";
3478alias df d \"!\";
3479alias m MATCH;
3480alias mas m \"*\";
3481alias mfs m \"!\";
3482alias ma mas \".\";
3483alias mf mfs \".\";
3484alias q QUIT;
3485
3486__EOT__
3487
3488
3489dicod --config ./dicod.conf --stderr -i < input  | tr -d '\\r' | sed 's/^\\(2[25][0-9]\\) .*/\\1/;s/ *\$//' |sed '/SASLAUTH/d'"
3490at_fn_check_prepare_notrace 'an embedded newline' "alias.at:26"
3491( $at_check_trace;
3492cat > dicod.conf <<__EOT__
3493prepend-load-path "$abs_builddir";
3494load-module echo;
3495
3496database {
3497	name dummy;
3498	handler "echo null";
3499}
3500alias dblist show databases;
3501alias d DEFINE;
3502alias da d "*";
3503alias df d "!";
3504alias m MATCH;
3505alias mas m "*";
3506alias mfs m "!";
3507alias ma mas ".";
3508alias mf mfs ".";
3509alias q QUIT;
3510
3511__EOT__
3512
3513
3514dicod --config ./dicod.conf --stderr -i < input  | tr -d '\r' | sed 's/^\(2[25][0-9]\) .*/\1/;s/ *$//' |sed '/SASLAUTH/d'
3515) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3516at_status=$? at_failed=false
3517$at_check_filter
3518at_fn_diff_devnull "$at_stderr" || at_failed=:
3519echo >>"$at_stdout"; $as_echo "220
3520110 1 databases present
3521dummy \"GNU Dico NULL database\"
3522.
3523250
3524552 No match
3525552 No match
3526221
3527" | \
3528  $at_diff - "$at_stdout" || at_failed=:
3529at_fn_check_status 0 $at_status "$at_srcdir/alias.at:26"
3530$at_failed && at_fn_log_failure
3531$at_traceon; }
3532
3533
3534  set +x
3535  $at_times_p && times >"$at_times_file"
3536) 5>&1 2>&1 7>&- | eval $at_tee_pipe
3537read at_status <"$at_status_file"
3538#AT_STOP_19
3539#AT_START_20
3540at_fn_group_banner 20 'virt01.at:17' \
3541  "show db" "                                        " 7
3542at_xfail=no
3543(
3544  $as_echo "20. $at_setup_line: testing $at_desc ..."
3545  $at_traceon
3546
3547
3548cat >input <<'_ATEOF'
3549show db
3550quit
3551_ATEOF
3552
3553
3554{ set +x
3555$as_echo "$at_srcdir/virt01.at:23:
3556cat > dicod.conf <<__EOT__
3557prepend-load-path \"\$abs_builddir\";
3558load-module echo;
3559
3560database {
3561	name db1;
3562	handler \"echo prefix=1\";
3563}
3564database {
3565	name db2;
3566	handler \"echo prefix=2\";
3567}
3568database {
3569	name db3;
3570	handler \"echo prefix=3\";
3571}
3572database {
3573	name virt;
3574	handler virtual;
3575	database db1;
3576	database db2;
3577	database db3;
3578}
3579
3580__EOT__
3581
3582
3583dicod --config ./dicod.conf --stderr -i < input  | tr -d '\\r' | sed 's/^\\(2[25][0-9]\\) .*/\\1/;s/ *\$//' "
3584at_fn_check_prepare_notrace 'an embedded newline' "virt01.at:23"
3585( $at_check_trace;
3586cat > dicod.conf <<__EOT__
3587prepend-load-path "$abs_builddir";
3588load-module echo;
3589
3590database {
3591	name db1;
3592	handler "echo prefix=1";
3593}
3594database {
3595	name db2;
3596	handler "echo prefix=2";
3597}
3598database {
3599	name db3;
3600	handler "echo prefix=3";
3601}
3602database {
3603	name virt;
3604	handler virtual;
3605	database db1;
3606	database db2;
3607	database db3;
3608}
3609
3610__EOT__
3611
3612
3613dicod --config ./dicod.conf --stderr -i < input  | tr -d '\r' | sed 's/^\(2[25][0-9]\) .*/\1/;s/ *$//'
3614) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3615at_status=$? at_failed=false
3616$at_check_filter
3617at_fn_diff_devnull "$at_stderr" || at_failed=:
3618echo >>"$at_stdout"; $as_echo "220
3619110 4 databases present
3620db1 \"GNU Dico ECHO database (prefix 1)\"
3621db2 \"GNU Dico ECHO database (prefix 2)\"
3622db3 \"GNU Dico ECHO database (prefix 3)\"
3623virt \"\"
3624.
3625250
3626221
3627" | \
3628  $at_diff - "$at_stdout" || at_failed=:
3629at_fn_check_status 0 $at_status "$at_srcdir/virt01.at:23"
3630$at_failed && at_fn_log_failure
3631$at_traceon; }
3632
3633
3634{ set +x
3635$as_echo "$at_srcdir/virt01.at:59:
3636cat > dicod.conf <<__EOT__
3637prepend-load-path \"\$abs_builddir\";
3638load-module echo;
3639
3640database {
3641	name db1;
3642	handler \"echo prefix=1\";
3643	visible no;
3644}
3645database {
3646	name db2;
3647	handler \"echo prefix=2\";
3648	visible no;
3649}
3650database {
3651	name db3;
3652	handler \"echo prefix=3\";
3653	visible no;
3654}
3655database {
3656	name virt;
3657	handler virtual;
3658	description \"virtual db\";
3659	database db1;
3660	database db2;
3661	database db3;
3662}
3663
3664__EOT__
3665
3666
3667dicod --config ./dicod.conf --stderr -i < input  | tr -d '\\r' | sed 's/^\\(2[25][0-9]\\) .*/\\1/;s/ *\$//' "
3668at_fn_check_prepare_notrace 'an embedded newline' "virt01.at:59"
3669( $at_check_trace;
3670cat > dicod.conf <<__EOT__
3671prepend-load-path "$abs_builddir";
3672load-module echo;
3673
3674database {
3675	name db1;
3676	handler "echo prefix=1";
3677	visible no;
3678}
3679database {
3680	name db2;
3681	handler "echo prefix=2";
3682	visible no;
3683}
3684database {
3685	name db3;
3686	handler "echo prefix=3";
3687	visible no;
3688}
3689database {
3690	name virt;
3691	handler virtual;
3692	description "virtual db";
3693	database db1;
3694	database db2;
3695	database db3;
3696}
3697
3698__EOT__
3699
3700
3701dicod --config ./dicod.conf --stderr -i < input  | tr -d '\r' | sed 's/^\(2[25][0-9]\) .*/\1/;s/ *$//'
3702) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3703at_status=$? at_failed=false
3704$at_check_filter
3705at_fn_diff_devnull "$at_stderr" || at_failed=:
3706echo >>"$at_stdout"; $as_echo "220
3707110 1 databases present
3708virt \"virtual db\"
3709.
3710250
3711221
3712" | \
3713  $at_diff - "$at_stdout" || at_failed=:
3714at_fn_check_status 0 $at_status "$at_srcdir/virt01.at:59"
3715$at_failed && at_fn_log_failure
3716$at_traceon; }
3717
3718
3719  set +x
3720  $at_times_p && times >"$at_times_file"
3721) 5>&1 2>&1 7>&- | eval $at_tee_pipe
3722read at_status <"$at_status_file"
3723#AT_STOP_20
3724#AT_START_21
3725at_fn_group_banner 21 'virt02.at:17' \
3726  "match" "                                          " 7
3727at_xfail=no
3728(
3729  $as_echo "21. $at_setup_line: testing $at_desc ..."
3730  $at_traceon
3731
3732
3733
3734# Explicit matching of a virtual database returns real names of its
3735# visible members.
3736{ set +x
3737$as_echo "$at_srcdir/virt02.at:22:
3738cat > dicod.conf <<__EOT__
3739prepend-load-path \"\$abs_builddir\";
3740load-module echo;
3741
3742database {
3743	name db1;
3744	handler \"echo prefix=1\";
3745}
3746database {
3747	name db2;
3748	handler \"echo prefix=2\";
3749}
3750database {
3751	name db3;
3752	handler \"echo prefix=3\";
3753}
3754database {
3755	name virt;
3756	handler virtual;
3757	database db1;
3758	database db2;
3759	database db3;
3760}
3761
3762__EOT__
3763
3764
3765cat >input <<'_ATEOF'
3766match virt . word
3767quit
3768_ATEOF
3769
3770
3771dicod --config ./dicod.conf --stderr -i < input  | tr -d '\\r' | sed 's/^\\(2[25][0-9]\\) .*/\\1/;s/ *\$//' "
3772at_fn_check_prepare_notrace 'an embedded newline' "virt02.at:22"
3773( $at_check_trace;
3774cat > dicod.conf <<__EOT__
3775prepend-load-path "$abs_builddir";
3776load-module echo;
3777
3778database {
3779	name db1;
3780	handler "echo prefix=1";
3781}
3782database {
3783	name db2;
3784	handler "echo prefix=2";
3785}
3786database {
3787	name db3;
3788	handler "echo prefix=3";
3789}
3790database {
3791	name virt;
3792	handler virtual;
3793	database db1;
3794	database db2;
3795	database db3;
3796}
3797
3798__EOT__
3799
3800
3801cat >input <<'_ATEOF'
3802match virt . word
3803quit
3804_ATEOF
3805
3806
3807dicod --config ./dicod.conf --stderr -i < input  | tr -d '\r' | sed 's/^\(2[25][0-9]\) .*/\1/;s/ *$//'
3808) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3809at_status=$? at_failed=false
3810$at_check_filter
3811at_fn_diff_devnull "$at_stderr" || at_failed=:
3812echo >>"$at_stdout"; $as_echo "220
3813152 3 matches found: list follows
3814db1 \"1word\"
3815db2 \"2word\"
3816db3 \"3word\"
3817.
3818250
3819221
3820" | \
3821  $at_diff - "$at_stdout" || at_failed=:
3822at_fn_check_status 0 $at_status "$at_srcdir/virt02.at:22"
3823$at_failed && at_fn_log_failure
3824$at_traceon; }
3825
3826
3827# Virtual database is excluded from wildcard matching.
3828{ set +x
3829$as_echo "$at_srcdir/virt02.at:62:
3830cat > dicod.conf <<__EOT__
3831prepend-load-path \"\$abs_builddir\";
3832load-module echo;
3833
3834database {
3835	name db1;
3836	handler \"echo prefix=1\";
3837}
3838database {
3839	name db2;
3840	handler \"echo prefix=2\";
3841}
3842database {
3843	name db3;
3844	handler \"echo prefix=3\";
3845}
3846database {
3847	name virt;
3848	handler virtual;
3849	database db1;
3850	database db2;
3851	database db3;
3852}
3853
3854__EOT__
3855
3856
3857cat >input <<'_ATEOF'
3858match * . word
3859quit
3860_ATEOF
3861
3862
3863dicod --config ./dicod.conf --stderr -i < input  | tr -d '\\r' | sed 's/^\\(2[25][0-9]\\) .*/\\1/;s/ *\$//' "
3864at_fn_check_prepare_notrace 'an embedded newline' "virt02.at:62"
3865( $at_check_trace;
3866cat > dicod.conf <<__EOT__
3867prepend-load-path "$abs_builddir";
3868load-module echo;
3869
3870database {
3871	name db1;
3872	handler "echo prefix=1";
3873}
3874database {
3875	name db2;
3876	handler "echo prefix=2";
3877}
3878database {
3879	name db3;
3880	handler "echo prefix=3";
3881}
3882database {
3883	name virt;
3884	handler virtual;
3885	database db1;
3886	database db2;
3887	database db3;
3888}
3889
3890__EOT__
3891
3892
3893cat >input <<'_ATEOF'
3894match * . word
3895quit
3896_ATEOF
3897
3898
3899dicod --config ./dicod.conf --stderr -i < input  | tr -d '\r' | sed 's/^\(2[25][0-9]\) .*/\1/;s/ *$//'
3900) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3901at_status=$? at_failed=false
3902$at_check_filter
3903at_fn_diff_devnull "$at_stderr" || at_failed=:
3904echo >>"$at_stdout"; $as_echo "220
3905152 3 matches found: list follows
3906db1 \"1word\"
3907db2 \"2word\"
3908db3 \"3word\"
3909.
3910250
3911221
3912" | \
3913  $at_diff - "$at_stdout" || at_failed=:
3914at_fn_check_status 0 $at_status "$at_srcdir/virt02.at:62"
3915$at_failed && at_fn_log_failure
3916$at_traceon; }
3917
3918
3919# Matches from a virtual db whose members are invisible, list the
3920# name of the virtual db, not of its members.
3921{ set +x
3922$as_echo "$at_srcdir/virt02.at:103:
3923cat > dicod.conf <<__EOT__
3924prepend-load-path \"\$abs_builddir\";
3925load-module echo;
3926
3927database {
3928	name db1;
3929	handler \"echo prefix=1\";
3930	visible no;
3931}
3932database {
3933	name db2;
3934	handler \"echo prefix=2\";
3935	visible no;
3936}
3937database {
3938	name db3;
3939	handler \"echo prefix=3\";
3940	visible no;
3941}
3942database {
3943	name virt;
3944	handler virtual;
3945	database db1;
3946	database db2;
3947	database db3;
3948}
3949
3950__EOT__
3951
3952
3953cat >input <<'_ATEOF'
3954match virt . word
3955quit
3956_ATEOF
3957
3958
3959dicod --config ./dicod.conf --stderr -i < input  | tr -d '\\r' | sed 's/^\\(2[25][0-9]\\) .*/\\1/;s/ *\$//' "
3960at_fn_check_prepare_notrace 'an embedded newline' "virt02.at:103"
3961( $at_check_trace;
3962cat > dicod.conf <<__EOT__
3963prepend-load-path "$abs_builddir";
3964load-module echo;
3965
3966database {
3967	name db1;
3968	handler "echo prefix=1";
3969	visible no;
3970}
3971database {
3972	name db2;
3973	handler "echo prefix=2";
3974	visible no;
3975}
3976database {
3977	name db3;
3978	handler "echo prefix=3";
3979	visible no;
3980}
3981database {
3982	name virt;
3983	handler virtual;
3984	database db1;
3985	database db2;
3986	database db3;
3987}
3988
3989__EOT__
3990
3991
3992cat >input <<'_ATEOF'
3993match virt . word
3994quit
3995_ATEOF
3996
3997
3998dicod --config ./dicod.conf --stderr -i < input  | tr -d '\r' | sed 's/^\(2[25][0-9]\) .*/\1/;s/ *$//'
3999) >>"$at_stdout" 2>>"$at_stderr" 5>&-
4000at_status=$? at_failed=false
4001$at_check_filter
4002at_fn_diff_devnull "$at_stderr" || at_failed=:
4003echo >>"$at_stdout"; $as_echo "220
4004152 3 matches found: list follows
4005virt \"1word\"
4006virt \"2word\"
4007virt \"3word\"
4008.
4009250
4010221
4011" | \
4012  $at_diff - "$at_stdout" || at_failed=:
4013at_fn_check_status 0 $at_status "$at_srcdir/virt02.at:103"
4014$at_failed && at_fn_log_failure
4015$at_traceon; }
4016
4017
4018# Alternative databases: no mime
4019{ set +x
4020$as_echo "$at_srcdir/virt02.at:146:
4021cat > dicod.conf <<__EOT__
4022prepend-load-path \"\$abs_builddir\";
4023load-module echo;
4024
4025capability mime;
4026database {
4027	name db1;
4028	handler \"echo prefix=1\";
4029	visible no;
4030}
4031database {
4032	name db2;
4033	handler \"echo prefix=2\";
4034	visible no;
4035}
4036database {
4037	name virt;
4038	handler virtual;
4039	database db1 mime;
4040	database db2 nomime;
4041}
4042
4043__EOT__
4044
4045
4046cat >input <<'_ATEOF'
4047match virt . word
4048quit
4049_ATEOF
4050
4051
4052dicod --config ./dicod.conf --stderr -i < input  | tr -d '\\r' | sed 's/^\\(2[25][0-9]\\) .*/\\1/;s/ *\$//' "
4053at_fn_check_prepare_notrace 'an embedded newline' "virt02.at:146"
4054( $at_check_trace;
4055cat > dicod.conf <<__EOT__
4056prepend-load-path "$abs_builddir";
4057load-module echo;
4058
4059capability mime;
4060database {
4061	name db1;
4062	handler "echo prefix=1";
4063	visible no;
4064}
4065database {
4066	name db2;
4067	handler "echo prefix=2";
4068	visible no;
4069}
4070database {
4071	name virt;
4072	handler virtual;
4073	database db1 mime;
4074	database db2 nomime;
4075}
4076
4077__EOT__
4078
4079
4080cat >input <<'_ATEOF'
4081match virt . word
4082quit
4083_ATEOF
4084
4085
4086dicod --config ./dicod.conf --stderr -i < input  | tr -d '\r' | sed 's/^\(2[25][0-9]\) .*/\1/;s/ *$//'
4087) >>"$at_stdout" 2>>"$at_stderr" 5>&-
4088at_status=$? at_failed=false
4089$at_check_filter
4090at_fn_diff_devnull "$at_stderr" || at_failed=:
4091echo >>"$at_stdout"; $as_echo "220
4092152 1 matches found: list follows
4093virt \"2word\"
4094.
4095250
4096221
4097" | \
4098  $at_diff - "$at_stdout" || at_failed=:
4099at_fn_check_status 0 $at_status "$at_srcdir/virt02.at:146"
4100$at_failed && at_fn_log_failure
4101$at_traceon; }
4102
4103
4104# Alternative databases: OPTION MIME
4105{ set +x
4106$as_echo "$at_srcdir/virt02.at:182:
4107cat > dicod.conf <<__EOT__
4108prepend-load-path \"\$abs_builddir\";
4109load-module echo;
4110
4111capability mime;
4112database {
4113	name db1;
4114	handler \"echo prefix=1\";
4115	visible no;
4116}
4117database {
4118	name db2;
4119	handler \"echo prefix=2\";
4120	visible no;
4121}
4122database {
4123	name virt;
4124	handler virtual;
4125	database db1 mime;
4126	database db2 nomime;
4127}
4128
4129__EOT__
4130
4131
4132cat >input <<'_ATEOF'
4133match virt . word
4134option mime
4135match virt . word
4136quit
4137_ATEOF
4138
4139
4140dicod --config ./dicod.conf --stderr -i < input  | tr -d '\\r' | sed 's/^\\(2[25][0-9]\\) .*/\\1/;s/ *\$//' "
4141at_fn_check_prepare_notrace 'an embedded newline' "virt02.at:182"
4142( $at_check_trace;
4143cat > dicod.conf <<__EOT__
4144prepend-load-path "$abs_builddir";
4145load-module echo;
4146
4147capability mime;
4148database {
4149	name db1;
4150	handler "echo prefix=1";
4151	visible no;
4152}
4153database {
4154	name db2;
4155	handler "echo prefix=2";
4156	visible no;
4157}
4158database {
4159	name virt;
4160	handler virtual;
4161	database db1 mime;
4162	database db2 nomime;
4163}
4164
4165__EOT__
4166
4167
4168cat >input <<'_ATEOF'
4169match virt . word
4170option mime
4171match virt . word
4172quit
4173_ATEOF
4174
4175
4176dicod --config ./dicod.conf --stderr -i < input  | tr -d '\r' | sed 's/^\(2[25][0-9]\) .*/\1/;s/ *$//'
4177) >>"$at_stdout" 2>>"$at_stderr" 5>&-
4178at_status=$? at_failed=false
4179$at_check_filter
4180at_fn_diff_devnull "$at_stderr" || at_failed=:
4181echo >>"$at_stdout"; $as_echo "220
4182152 1 matches found: list follows
4183virt \"2word\"
4184.
4185250
4186250
4187152 1 matches found: list follows
4188
4189virt \"1word\"
4190.
4191250
4192221
4193" | \
4194  $at_diff - "$at_stdout" || at_failed=:
4195at_fn_check_status 0 $at_status "$at_srcdir/virt02.at:182"
4196$at_failed && at_fn_log_failure
4197$at_traceon; }
4198
4199
4200  set +x
4201  $at_times_p && times >"$at_times_file"
4202) 5>&1 2>&1 7>&- | eval $at_tee_pipe
4203read at_status <"$at_status_file"
4204#AT_STOP_21
4205#AT_START_22
4206at_fn_group_banner 22 'virt03.at:17' \
4207  "define" "                                         " 7
4208at_xfail=no
4209(
4210  $as_echo "22. $at_setup_line: testing $at_desc ..."
4211  $at_traceon
4212
4213
4214
4215# Explicit define from a virtual database. Real source database names
4216# are shown.
4217{ set +x
4218$as_echo "$at_srcdir/virt03.at:22:
4219cat > dicod.conf <<__EOT__
4220prepend-load-path \"\$abs_builddir\";
4221load-module echo;
4222
4223database {
4224	name db1;
4225	handler \"echo prefix=1\";
4226}
4227database {
4228	name db2;
4229	handler \"echo prefix=2\";
4230}
4231database {
4232	name db3;
4233	handler \"echo prefix=3\";
4234}
4235database {
4236	name virt;
4237	handler virtual;
4238	database db1;
4239	database db2;
4240	database db3;
4241}
4242
4243__EOT__
4244
4245
4246cat >input <<'_ATEOF'
4247define virt word
4248quit
4249_ATEOF
4250
4251
4252dicod --config ./dicod.conf --stderr -i < input  | tr -d '\\r' | sed 's/^\\(2[25][0-9]\\) .*/\\1/;s/ *\$//' "
4253at_fn_check_prepare_notrace 'an embedded newline' "virt03.at:22"
4254( $at_check_trace;
4255cat > dicod.conf <<__EOT__
4256prepend-load-path "$abs_builddir";
4257load-module echo;
4258
4259database {
4260	name db1;
4261	handler "echo prefix=1";
4262}
4263database {
4264	name db2;
4265	handler "echo prefix=2";
4266}
4267database {
4268	name db3;
4269	handler "echo prefix=3";
4270}
4271database {
4272	name virt;
4273	handler virtual;
4274	database db1;
4275	database db2;
4276	database db3;
4277}
4278
4279__EOT__
4280
4281
4282cat >input <<'_ATEOF'
4283define virt word
4284quit
4285_ATEOF
4286
4287
4288dicod --config ./dicod.conf --stderr -i < input  | tr -d '\r' | sed 's/^\(2[25][0-9]\) .*/\1/;s/ *$//'
4289) >>"$at_stdout" 2>>"$at_stderr" 5>&-
4290at_status=$? at_failed=false
4291$at_check_filter
4292at_fn_diff_devnull "$at_stderr" || at_failed=:
4293echo >>"$at_stdout"; $as_echo "220
4294150 3 definitions found: list follows
4295151 \"word\" db1 \"GNU Dico ECHO database (prefix 1)\"
42961word
4297.
4298151 \"word\" db2 \"GNU Dico ECHO database (prefix 2)\"
42992word
4300.
4301151 \"word\" db3 \"GNU Dico ECHO database (prefix 3)\"
43023word
4303.
4304250
4305221
4306" | \
4307  $at_diff - "$at_stdout" || at_failed=:
4308at_fn_check_status 0 $at_status "$at_srcdir/virt03.at:22"
4309$at_failed && at_fn_log_failure
4310$at_traceon; }
4311
4312
4313# Wildcard define. Virtual database is excluded.
4314{ set +x
4315$as_echo "$at_srcdir/virt03.at:67:
4316cat > dicod.conf <<__EOT__
4317prepend-load-path \"\$abs_builddir\";
4318load-module echo;
4319
4320database {
4321	name db1;
4322	handler \"echo prefix=1\";
4323}
4324database {
4325	name db2;
4326	handler \"echo prefix=2\";
4327}
4328database {
4329	name db3;
4330	handler \"echo prefix=3\";
4331}
4332database {
4333	name virt;
4334	handler virtual;
4335	database db1;
4336	database db2;
4337	database db3;
4338}
4339
4340__EOT__
4341
4342
4343cat >input <<'_ATEOF'
4344define * word
4345quit
4346_ATEOF
4347
4348
4349dicod --config ./dicod.conf --stderr -i < input  | tr -d '\\r' | sed 's/^\\(2[25][0-9]\\) .*/\\1/;s/ *\$//' "
4350at_fn_check_prepare_notrace 'an embedded newline' "virt03.at:67"
4351( $at_check_trace;
4352cat > dicod.conf <<__EOT__
4353prepend-load-path "$abs_builddir";
4354load-module echo;
4355
4356database {
4357	name db1;
4358	handler "echo prefix=1";
4359}
4360database {
4361	name db2;
4362	handler "echo prefix=2";
4363}
4364database {
4365	name db3;
4366	handler "echo prefix=3";
4367}
4368database {
4369	name virt;
4370	handler virtual;
4371	database db1;
4372	database db2;
4373	database db3;
4374}
4375
4376__EOT__
4377
4378
4379cat >input <<'_ATEOF'
4380define * word
4381quit
4382_ATEOF
4383
4384
4385dicod --config ./dicod.conf --stderr -i < input  | tr -d '\r' | sed 's/^\(2[25][0-9]\) .*/\1/;s/ *$//'
4386) >>"$at_stdout" 2>>"$at_stderr" 5>&-
4387at_status=$? at_failed=false
4388$at_check_filter
4389at_fn_diff_devnull "$at_stderr" || at_failed=:
4390echo >>"$at_stdout"; $as_echo "220
4391150 3 definitions found: list follows
4392151 \"word\" db1 \"GNU Dico ECHO database (prefix 1)\"
43931word
4394.
4395151 \"word\" db2 \"GNU Dico ECHO database (prefix 2)\"
43962word
4397.
4398151 \"word\" db3 \"GNU Dico ECHO database (prefix 3)\"
43993word
4400.
4401250
4402221
4403" | \
4404  $at_diff - "$at_stdout" || at_failed=:
4405at_fn_check_status 0 $at_status "$at_srcdir/virt03.at:67"
4406$at_failed && at_fn_log_failure
4407$at_traceon; }
4408
4409
4410# Explicit define from a virtual database whose members are invisible.
4411# Virtual database name and description is returned.
4412{ set +x
4413$as_echo "$at_srcdir/virt03.at:113:
4414cat > dicod.conf <<__EOT__
4415prepend-load-path \"\$abs_builddir\";
4416load-module echo;
4417
4418database {
4419	name db1;
4420	handler \"echo prefix=1\";
4421	visible no;
4422}
4423database {
4424	name db2;
4425	handler \"echo prefix=2\";
4426	visible no;
4427}
4428database {
4429	name db3;
4430	handler \"echo prefix=3\";
4431	visible no;
4432}
4433database {
4434	name virt;
4435	handler virtual;
4436	description \"Example Virtual Database\";
4437	database db1;
4438	database db2;
4439	database db3;
4440}
4441
4442__EOT__
4443
4444
4445cat >input <<'_ATEOF'
4446define virt word
4447quit
4448_ATEOF
4449
4450
4451dicod --config ./dicod.conf --stderr -i < input  | tr -d '\\r' | sed 's/^\\(2[25][0-9]\\) .*/\\1/;s/ *\$//' "
4452at_fn_check_prepare_notrace 'an embedded newline' "virt03.at:113"
4453( $at_check_trace;
4454cat > dicod.conf <<__EOT__
4455prepend-load-path "$abs_builddir";
4456load-module echo;
4457
4458database {
4459	name db1;
4460	handler "echo prefix=1";
4461	visible no;
4462}
4463database {
4464	name db2;
4465	handler "echo prefix=2";
4466	visible no;
4467}
4468database {
4469	name db3;
4470	handler "echo prefix=3";
4471	visible no;
4472}
4473database {
4474	name virt;
4475	handler virtual;
4476	description "Example Virtual Database";
4477	database db1;
4478	database db2;
4479	database db3;
4480}
4481
4482__EOT__
4483
4484
4485cat >input <<'_ATEOF'
4486define virt word
4487quit
4488_ATEOF
4489
4490
4491dicod --config ./dicod.conf --stderr -i < input  | tr -d '\r' | sed 's/^\(2[25][0-9]\) .*/\1/;s/ *$//'
4492) >>"$at_stdout" 2>>"$at_stderr" 5>&-
4493at_status=$? at_failed=false
4494$at_check_filter
4495at_fn_diff_devnull "$at_stderr" || at_failed=:
4496echo >>"$at_stdout"; $as_echo "220
4497150 3 definitions found: list follows
4498151 \"word\" virt \"Example Virtual Database\"
44991word
4500.
4501151 \"word\" virt \"Example Virtual Database\"
45022word
4503.
4504151 \"word\" virt \"Example Virtual Database\"
45053word
4506.
4507250
4508221
4509" | \
4510  $at_diff - "$at_stdout" || at_failed=:
4511at_fn_check_status 0 $at_status "$at_srcdir/virt03.at:113"
4512$at_failed && at_fn_log_failure
4513$at_traceon; }
4514
4515
4516# Alternative databases: no mime
4517{ set +x
4518$as_echo "$at_srcdir/virt03.at:162:
4519cat > dicod.conf <<__EOT__
4520prepend-load-path \"\$abs_builddir\";
4521load-module echo;
4522
4523capability mime;
4524database {
4525	name db1;
4526	handler \"echo prefix=1\";
4527	visible no;
4528}
4529database {
4530	name db2;
4531	handler \"echo prefix=2\";
4532	visible no;
4533}
4534database {
4535	name virt;
4536	handler virtual;
4537	description \"Example Virtual Database\";
4538	database db1 mime;
4539	database db2 nomime;
4540}
4541
4542__EOT__
4543
4544
4545cat >input <<'_ATEOF'
4546define virt word
4547quit
4548_ATEOF
4549
4550
4551dicod --config ./dicod.conf --stderr -i < input  | tr -d '\\r' | sed 's/^\\(2[25][0-9]\\) .*/\\1/;s/ *\$//' "
4552at_fn_check_prepare_notrace 'an embedded newline' "virt03.at:162"
4553( $at_check_trace;
4554cat > dicod.conf <<__EOT__
4555prepend-load-path "$abs_builddir";
4556load-module echo;
4557
4558capability mime;
4559database {
4560	name db1;
4561	handler "echo prefix=1";
4562	visible no;
4563}
4564database {
4565	name db2;
4566	handler "echo prefix=2";
4567	visible no;
4568}
4569database {
4570	name virt;
4571	handler virtual;
4572	description "Example Virtual Database";
4573	database db1 mime;
4574	database db2 nomime;
4575}
4576
4577__EOT__
4578
4579
4580cat >input <<'_ATEOF'
4581define virt word
4582quit
4583_ATEOF
4584
4585
4586dicod --config ./dicod.conf --stderr -i < input  | tr -d '\r' | sed 's/^\(2[25][0-9]\) .*/\1/;s/ *$//'
4587) >>"$at_stdout" 2>>"$at_stderr" 5>&-
4588at_status=$? at_failed=false
4589$at_check_filter
4590at_fn_diff_devnull "$at_stderr" || at_failed=:
4591echo >>"$at_stdout"; $as_echo "220
4592150 1 definitions found: list follows
4593151 \"word\" virt \"Example Virtual Database\"
45942word
4595.
4596250
4597221
4598" | \
4599  $at_diff - "$at_stdout" || at_failed=:
4600at_fn_check_status 0 $at_status "$at_srcdir/virt03.at:162"
4601$at_failed && at_fn_log_failure
4602$at_traceon; }
4603
4604
4605# Alternative databases: OPTION MIME
4606{ set +x
4607$as_echo "$at_srcdir/virt03.at:200:
4608cat > dicod.conf <<__EOT__
4609prepend-load-path \"\$abs_builddir\";
4610load-module echo;
4611
4612capability mime;
4613database {
4614	name db1;
4615	handler \"echo prefix=1\";
4616	visible no;
4617}
4618database {
4619	name db2;
4620	handler \"echo prefix=2\";
4621	visible no;
4622}
4623database {
4624	name virt;
4625	handler virtual;
4626	database db1 mime;
4627	database db2 nomime;
4628}
4629
4630__EOT__
4631
4632
4633cat >input <<'_ATEOF'
4634option mime
4635define virt word
4636quit
4637_ATEOF
4638
4639
4640dicod --config ./dicod.conf --stderr -i < input  | tr -d '\\r' | sed 's/^\\(2[25][0-9]\\) .*/\\1/;s/ *\$//' "
4641at_fn_check_prepare_notrace 'an embedded newline' "virt03.at:200"
4642( $at_check_trace;
4643cat > dicod.conf <<__EOT__
4644prepend-load-path "$abs_builddir";
4645load-module echo;
4646
4647capability mime;
4648database {
4649	name db1;
4650	handler "echo prefix=1";
4651	visible no;
4652}
4653database {
4654	name db2;
4655	handler "echo prefix=2";
4656	visible no;
4657}
4658database {
4659	name virt;
4660	handler virtual;
4661	database db1 mime;
4662	database db2 nomime;
4663}
4664
4665__EOT__
4666
4667
4668cat >input <<'_ATEOF'
4669option mime
4670define virt word
4671quit
4672_ATEOF
4673
4674
4675dicod --config ./dicod.conf --stderr -i < input  | tr -d '\r' | sed 's/^\(2[25][0-9]\) .*/\1/;s/ *$//'
4676) >>"$at_stdout" 2>>"$at_stderr" 5>&-
4677at_status=$? at_failed=false
4678$at_check_filter
4679at_fn_diff_devnull "$at_stderr" || at_failed=:
4680echo >>"$at_stdout"; $as_echo "220
4681250
4682150 1 definitions found: list follows
4683151 \"word\" virt \"GNU Dico ECHO database (prefix 1)\"
4684Content-Type: text/plain; charset=utf-8
4685Content-Transfer-Encoding: 8bit
4686
46871word
4688.
4689250
4690221
4691" | \
4692  $at_diff - "$at_stdout" || at_failed=:
4693at_fn_check_status 0 $at_status "$at_srcdir/virt03.at:200"
4694$at_failed && at_fn_log_failure
4695$at_traceon; }
4696
4697
4698
4699  set +x
4700  $at_times_p && times >"$at_times_file"
4701) 5>&1 2>&1 7>&- | eval $at_tee_pipe
4702read at_status <"$at_status_file"
4703#AT_STOP_22
4704#AT_START_23
4705at_fn_group_banner 23 'virt04.at:17' \
4706  "show info" "                                      " 7
4707at_xfail=no
4708(
4709  $as_echo "23. $at_setup_line: testing $at_desc ..."
4710  $at_traceon
4711
4712
4713# Alternative databases: no mime
4714{ set +x
4715$as_echo "$at_srcdir/virt04.at:20:
4716cat > dicod.conf <<__EOT__
4717prepend-load-path \"\$abs_builddir\";
4718load-module echo;
4719
4720capability mime;
4721database {
4722	name db1;
4723	handler \"echo prefix=1\";
4724	visible no;
4725}
4726database {
4727	name db2;
4728	handler \"echo prefix=2\";
4729	visible no;
4730}
4731database {
4732	name virt;
4733	handler virtual;
4734	database db1 mime;
4735	database db2 nomime;
4736}
4737
4738__EOT__
4739
4740
4741cat >input <<'_ATEOF'
4742show info virt
4743quit
4744_ATEOF
4745
4746
4747dicod --config ./dicod.conf --stderr -i < input  | tr -d '\\r' | sed 's/^\\(2[25][0-9]\\) .*/\\1/;s/ *\$//' "
4748at_fn_check_prepare_notrace 'an embedded newline' "virt04.at:20"
4749( $at_check_trace;
4750cat > dicod.conf <<__EOT__
4751prepend-load-path "$abs_builddir";
4752load-module echo;
4753
4754capability mime;
4755database {
4756	name db1;
4757	handler "echo prefix=1";
4758	visible no;
4759}
4760database {
4761	name db2;
4762	handler "echo prefix=2";
4763	visible no;
4764}
4765database {
4766	name virt;
4767	handler virtual;
4768	database db1 mime;
4769	database db2 nomime;
4770}
4771
4772__EOT__
4773
4774
4775cat >input <<'_ATEOF'
4776show info virt
4777quit
4778_ATEOF
4779
4780
4781dicod --config ./dicod.conf --stderr -i < input  | tr -d '\r' | sed 's/^\(2[25][0-9]\) .*/\1/;s/ *$//'
4782) >>"$at_stdout" 2>>"$at_stderr" 5>&-
4783at_status=$? at_failed=false
4784$at_check_filter
4785at_fn_diff_devnull "$at_stderr" || at_failed=:
4786echo >>"$at_stdout"; $as_echo "220
4787112 information for virt
4788ECHO database.
4789
4790This database echoes each query.
4791
4792.
4793250
4794221
4795" | \
4796  $at_diff - "$at_stdout" || at_failed=:
4797at_fn_check_status 0 $at_status "$at_srcdir/virt04.at:20"
4798$at_failed && at_fn_log_failure
4799$at_traceon; }
4800
4801
4802  set +x
4803  $at_times_p && times >"$at_times_file"
4804) 5>&1 2>&1 7>&- | eval $at_tee_pipe
4805read at_status <"$at_status_file"
4806#AT_STOP_23
4807