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='lmtpd'
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:21;lmtpd version;;
5942;lmtpd.at:17;lmtpd;lmtpd;
595"
596# List of the all the test groups.
597at_groups_all=`$as_echo "$at_help_all" | sed 's/;.*//'`
598
599# at_fn_validate_ranges NAME...
600# -----------------------------
601# Validate and normalize the test group number contained in each variable
602# NAME. Leading zeroes are treated as decimal.
603at_fn_validate_ranges ()
604{
605  for at_grp
606  do
607    eval at_value=\$$at_grp
608    if test $at_value -lt 1 || test $at_value -gt 2; then
609      $as_echo "invalid test group: $at_value" >&2
610      exit 1
611    fi
612    case $at_value in
613      0*) # We want to treat leading 0 as decimal, like expr and test, but
614	  # AS_VAR_ARITH treats it as octal if it uses $(( )).
615	  # With XSI shells, ${at_value#${at_value%%[1-9]*}} avoids the
616	  # expr fork, but it is not worth the effort to determine if the
617	  # shell supports XSI when the user can just avoid leading 0.
618	  eval $at_grp='`expr $at_value + 0`' ;;
619    esac
620  done
621}
622
623at_prev=
624for at_option
625do
626  # If the previous option needs an argument, assign it.
627  if test -n "$at_prev"; then
628    at_option=$at_prev=$at_option
629    at_prev=
630  fi
631
632  case $at_option in
633  *=?*) at_optarg=`expr "X$at_option" : '[^=]*=\(.*\)'` ;;
634  *)    at_optarg= ;;
635  esac
636
637  # Accept the important Cygnus configure options, so we can diagnose typos.
638
639  case $at_option in
640    --help | -h )
641	at_help_p=:
642	;;
643
644    --list | -l )
645	at_list_p=:
646	;;
647
648    --version | -V )
649	at_version_p=:
650	;;
651
652    --clean | -c )
653	at_clean=:
654	;;
655
656    --color )
657	at_color=always
658	;;
659    --color=* )
660	case $at_optarg in
661	no | never | none) at_color=never ;;
662	auto | tty | if-tty) at_color=auto ;;
663	always | yes | force) at_color=always ;;
664	*) at_optname=`echo " $at_option" | sed 's/^ //; s/=.*//'`
665	   as_fn_error $? "unrecognized argument to $at_optname: $at_optarg" ;;
666	esac
667	;;
668
669    --debug | -d )
670	at_debug_p=:
671	;;
672
673    --errexit | -e )
674	at_debug_p=:
675	at_errexit_p=:
676	;;
677
678    --verbose | -v )
679	at_verbose=; at_quiet=:
680	;;
681
682    --trace | -x )
683	at_traceon='set -x'
684	at_trace_echo=echo
685	at_check_filter_trace=at_fn_filter_trace
686	;;
687
688    [0-9] | [0-9][0-9] | [0-9][0-9][0-9] | [0-9][0-9][0-9][0-9])
689	at_fn_validate_ranges at_option
690	as_fn_append at_groups "$at_option$as_nl"
691	;;
692
693    # Ranges
694    [0-9]- | [0-9][0-9]- | [0-9][0-9][0-9]- | [0-9][0-9][0-9][0-9]-)
695	at_range_start=`echo $at_option |tr -d X-`
696	at_fn_validate_ranges at_range_start
697	at_range=`$as_echo "$at_groups_all" | \
698	  sed -ne '/^'$at_range_start'$/,$p'`
699	as_fn_append at_groups "$at_range$as_nl"
700	;;
701
702    -[0-9] | -[0-9][0-9] | -[0-9][0-9][0-9] | -[0-9][0-9][0-9][0-9])
703	at_range_end=`echo $at_option |tr -d X-`
704	at_fn_validate_ranges at_range_end
705	at_range=`$as_echo "$at_groups_all" | \
706	  sed -ne '1,/^'$at_range_end'$/p'`
707	as_fn_append at_groups "$at_range$as_nl"
708	;;
709
710    [0-9]-[0-9] | [0-9]-[0-9][0-9] | [0-9]-[0-9][0-9][0-9] | \
711    [0-9]-[0-9][0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9] | \
712    [0-9][0-9]-[0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9][0-9][0-9] | \
713    [0-9][0-9][0-9]-[0-9][0-9][0-9] | \
714    [0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] | \
715    [0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] )
716	at_range_start=`expr $at_option : '\(.*\)-'`
717	at_range_end=`expr $at_option : '.*-\(.*\)'`
718	if test $at_range_start -gt $at_range_end; then
719	  at_tmp=$at_range_end
720	  at_range_end=$at_range_start
721	  at_range_start=$at_tmp
722	fi
723	at_fn_validate_ranges at_range_start at_range_end
724	at_range=`$as_echo "$at_groups_all" | \
725	  sed -ne '/^'$at_range_start'$/,/^'$at_range_end'$/p'`
726	as_fn_append at_groups "$at_range$as_nl"
727	;;
728
729    # Directory selection.
730    --directory | -C )
731	at_prev=--directory
732	;;
733    --directory=* )
734	at_change_dir=:
735	at_dir=$at_optarg
736	if test x- = "x$at_dir" ; then
737	  at_dir=./-
738	fi
739	;;
740
741    # Parallel execution.
742    --jobs | -j )
743	at_jobs=0
744	;;
745    --jobs=* | -j[0-9]* )
746	if test -n "$at_optarg"; then
747	  at_jobs=$at_optarg
748	else
749	  at_jobs=`expr X$at_option : 'X-j\(.*\)'`
750	fi
751	case $at_jobs in *[!0-9]*)
752	  at_optname=`echo " $at_option" | sed 's/^ //; s/[0-9=].*//'`
753	  as_fn_error $? "non-numeric argument to $at_optname: $at_jobs" ;;
754	esac
755	;;
756
757    # Keywords.
758    --keywords | -k )
759	at_prev=--keywords
760	;;
761    --keywords=* )
762	at_groups_selected=$at_help_all
763	at_save_IFS=$IFS
764	IFS=,
765	set X $at_optarg
766	shift
767	IFS=$at_save_IFS
768	for at_keyword
769	do
770	  at_invert=
771	  case $at_keyword in
772	  '!'*)
773	    at_invert="-v"
774	    at_keyword=`expr "X$at_keyword" : 'X!\(.*\)'`
775	    ;;
776	  esac
777	  # It is on purpose that we match the test group titles too.
778	  at_groups_selected=`$as_echo "$at_groups_selected" |
779	      grep -i $at_invert "^[1-9][^;]*;.*[; ]$at_keyword[ ;]"`
780	done
781	# Smash the keywords.
782	at_groups_selected=`$as_echo "$at_groups_selected" | sed 's/;.*//'`
783	as_fn_append at_groups "$at_groups_selected$as_nl"
784	;;
785    --recheck)
786	at_recheck=:
787	;;
788
789    *=*)
790	at_envvar=`expr "x$at_option" : 'x\([^=]*\)='`
791	# Reject names that are not valid shell variable names.
792	case $at_envvar in
793	  '' | [0-9]* | *[!_$as_cr_alnum]* )
794	    as_fn_error $? "invalid variable name: \`$at_envvar'" ;;
795	esac
796	at_value=`$as_echo "$at_optarg" | sed "s/'/'\\\\\\\\''/g"`
797	# Export now, but save eval for later and for debug scripts.
798	export $at_envvar
799	as_fn_append at_debug_args " $at_envvar='$at_value'"
800	;;
801
802     *) $as_echo "$as_me: invalid option: $at_option" >&2
803	$as_echo "Try \`$0 --help' for more information." >&2
804	exit 1
805	;;
806  esac
807done
808
809# Verify our last option didn't require an argument
810if test -n "$at_prev"; then :
811  as_fn_error $? "\`$at_prev' requires an argument"
812fi
813
814# The file containing the suite.
815at_suite_log=$at_dir/$as_me.log
816
817# Selected test groups.
818if test -z "$at_groups$at_recheck"; then
819  at_groups=$at_groups_all
820else
821  if test -n "$at_recheck" && test -r "$at_suite_log"; then
822    at_oldfails=`sed -n '
823      /^Failed tests:$/,/^Skipped tests:$/{
824	s/^[ ]*\([1-9][0-9]*\):.*/\1/p
825      }
826      /^Unexpected passes:$/,/^## Detailed failed tests/{
827	s/^[ ]*\([1-9][0-9]*\):.*/\1/p
828      }
829      /^## Detailed failed tests/q
830      ' "$at_suite_log"`
831    as_fn_append at_groups "$at_oldfails$as_nl"
832  fi
833  # Sort the tests, removing duplicates.
834  at_groups=`$as_echo "$at_groups" | sort -nu | sed '/^$/d'`
835fi
836
837if test x"$at_color" = xalways \
838   || { test x"$at_color" = xauto && test -t 1; }; then
839  at_red=`printf '\033[0;31m'`
840  at_grn=`printf '\033[0;32m'`
841  at_lgn=`printf '\033[1;32m'`
842  at_blu=`printf '\033[1;34m'`
843  at_std=`printf '\033[m'`
844else
845  at_red= at_grn= at_lgn= at_blu= at_std=
846fi
847
848# Help message.
849if $at_help_p; then
850  cat <<_ATEOF || at_write_fail=1
851Usage: $0 [OPTION]... [VARIABLE=VALUE]... [TESTS]
852
853Run all the tests, or the selected TESTS, given by numeric ranges, and
854save a detailed log file.  Upon failure, create debugging scripts.
855
856Do not change environment variables directly.  Instead, set them via
857command line arguments.  Set \`AUTOTEST_PATH' to select the executables
858to exercise.  Each relative directory is expanded as build and source
859directories relative to the top level of this distribution.
860E.g., from within the build directory /tmp/foo-1.0, invoking this:
861
862  $ $0 AUTOTEST_PATH=bin
863
864is equivalent to the following, assuming the source directory is /src/foo-1.0:
865
866  PATH=/tmp/foo-1.0/bin:/src/foo-1.0/bin:\$PATH $0
867_ATEOF
868cat <<_ATEOF || at_write_fail=1
869
870Operation modes:
871  -h, --help     print the help message, then exit
872  -V, --version  print version number, then exit
873  -c, --clean    remove all the files this test suite might create and exit
874  -l, --list     describes all the tests, or the selected TESTS
875_ATEOF
876cat <<_ATEOF || at_write_fail=1
877
878Execution tuning:
879  -C, --directory=DIR
880                 change to directory DIR before starting
881      --color[=never|auto|always]
882                 enable colored test results on terminal, or always
883  -j, --jobs[=N]
884                 Allow N jobs at once; infinite jobs with no arg (default 1)
885  -k, --keywords=KEYWORDS
886                 select the tests matching all the comma-separated KEYWORDS
887                 multiple \`-k' accumulate; prefixed \`!' negates a KEYWORD
888      --recheck  select all tests that failed or passed unexpectedly last time
889  -e, --errexit  abort as soon as a test fails; implies --debug
890  -v, --verbose  force more detailed output
891                 default for debugging scripts
892  -d, --debug    inhibit clean up and top-level logging
893                 default for debugging scripts
894  -x, --trace    enable tests shell tracing
895_ATEOF
896cat <<_ATEOF || at_write_fail=1
897
898Report bugs to <bug-mailutils@gnu.org>.
899General help using GNU software: <http://www.gnu.org/gethelp/>.
900_ATEOF
901  exit $at_write_fail
902fi
903
904# List of tests.
905if $at_list_p; then
906  cat <<_ATEOF || at_write_fail=1
907GNU Mailutils 3.13 test suite test groups:
908
909 NUM: FILE-NAME:LINE     TEST-GROUP-NAME
910      KEYWORDS
911
912_ATEOF
913  # Pass an empty line as separator between selected groups and help.
914  $as_echo "$at_groups$as_nl$as_nl$at_help_all" |
915    awk 'NF == 1 && FS != ";" {
916	   selected[$ 1] = 1
917	   next
918	 }
919	 /^$/ { FS = ";" }
920	 NF > 0 {
921	   if (selected[$ 1]) {
922	     printf " %3d: %-18s %s\n", $ 1, $ 2, $ 3
923	     if ($ 4) {
924	       lmax = 79
925	       indent = "     "
926	       line = indent
927	       len = length (line)
928	       n = split ($ 4, a, " ")
929	       for (i = 1; i <= n; i++) {
930		 l = length (a[i]) + 1
931		 if (i > 1 && len + l > lmax) {
932		   print line
933		   line = indent " " a[i]
934		   len = length (line)
935		 } else {
936		   line = line " " a[i]
937		   len += l
938		 }
939	       }
940	       if (n)
941		 print line
942	     }
943	   }
944	 }' || at_write_fail=1
945  exit $at_write_fail
946fi
947if $at_version_p; then
948  $as_echo "$as_me (GNU Mailutils 3.13)" &&
949  cat <<\_ATEOF || at_write_fail=1
950
951Copyright (C) 2012 Free Software Foundation, Inc.
952This test suite is free software; the Free Software Foundation gives
953unlimited permission to copy, distribute and modify it.
954_ATEOF
955  exit $at_write_fail
956fi
957
958# Should we print banners?  Yes if more than one test is run.
959case $at_groups in #(
960  *$as_nl* )
961      at_print_banners=: ;; #(
962  * ) at_print_banners=false ;;
963esac
964# Text for banner N, set to a single space once printed.
965
966# Take any -C into account.
967if $at_change_dir ; then
968  test x != "x$at_dir" && cd "$at_dir" \
969    || as_fn_error $? "unable to change directory"
970  at_dir=`pwd`
971fi
972
973# Load the config files for any default variable assignments.
974for at_file in atconfig atlocal
975do
976  test -r $at_file || continue
977  . ./$at_file || as_fn_error $? "invalid content: $at_file"
978done
979
980# Autoconf <=2.59b set at_top_builddir instead of at_top_build_prefix:
981: "${at_top_build_prefix=$at_top_builddir}"
982
983# Perform any assignments requested during argument parsing.
984eval "$at_debug_args"
985
986# atconfig delivers names relative to the directory the test suite is
987# in, but the groups themselves are run in testsuite-dir/group-dir.
988if test -n "$at_top_srcdir"; then
989  builddir=../..
990  for at_dir_var in srcdir top_srcdir top_build_prefix
991  do
992    eval at_val=\$at_$at_dir_var
993    case $at_val in
994      [\\/$]* | ?:[\\/]* ) at_prefix= ;;
995      *) at_prefix=../../ ;;
996    esac
997    eval "$at_dir_var=\$at_prefix\$at_val"
998  done
999fi
1000
1001## -------------------- ##
1002## Directory structure. ##
1003## -------------------- ##
1004
1005# This is the set of directories and files used by this script
1006# (non-literals are capitalized):
1007#
1008# TESTSUITE         - the testsuite
1009# TESTSUITE.log     - summarizes the complete testsuite run
1010# TESTSUITE.dir/    - created during a run, remains after -d or failed test
1011# + at-groups/      - during a run: status of all groups in run
1012# | + NNN/          - during a run: meta-data about test group NNN
1013# | | + check-line  - location (source file and line) of current AT_CHECK
1014# | | + status      - exit status of current AT_CHECK
1015# | | + stdout      - stdout of current AT_CHECK
1016# | | + stder1      - stderr, including trace
1017# | | + stderr      - stderr, with trace filtered out
1018# | | + test-source - portion of testsuite that defines group
1019# | | + times       - timestamps for computing duration
1020# | | + pass        - created if group passed
1021# | | + xpass       - created if group xpassed
1022# | | + fail        - created if group failed
1023# | | + xfail       - created if group xfailed
1024# | | + skip        - created if group skipped
1025# + at-stop         - during a run: end the run if this file exists
1026# + at-source-lines - during a run: cache of TESTSUITE line numbers for extraction
1027# + 0..NNN/         - created for each group NNN, remains after -d or failed test
1028# | + TESTSUITE.log - summarizes the group results
1029# | + ...           - files created during the group
1030
1031# The directory the whole suite works in.
1032# Should be absolute to let the user `cd' at will.
1033at_suite_dir=$at_dir/$as_me.dir
1034# The file containing the suite ($at_dir might have changed since earlier).
1035at_suite_log=$at_dir/$as_me.log
1036# The directory containing helper files per test group.
1037at_helper_dir=$at_suite_dir/at-groups
1038# Stop file: if it exists, do not start new jobs.
1039at_stop_file=$at_suite_dir/at-stop
1040# The fifo used for the job dispatcher.
1041at_job_fifo=$at_suite_dir/at-job-fifo
1042
1043if $at_clean; then
1044  test -d "$at_suite_dir" &&
1045    find "$at_suite_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \;
1046  rm -f -r "$at_suite_dir" "$at_suite_log"
1047  exit $?
1048fi
1049
1050# Don't take risks: use only absolute directories in PATH.
1051#
1052# For stand-alone test suites (ie. atconfig was not found),
1053# AUTOTEST_PATH is relative to `.'.
1054#
1055# For embedded test suites, AUTOTEST_PATH is relative to the top level
1056# of the package.  Then expand it into build/src parts, since users
1057# may create executables in both places.
1058AUTOTEST_PATH=`$as_echo "$AUTOTEST_PATH" | sed "s|:|$PATH_SEPARATOR|g"`
1059at_path=
1060as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1061for as_dir in $AUTOTEST_PATH $PATH
1062do
1063  IFS=$as_save_IFS
1064  test -z "$as_dir" && as_dir=.
1065    test -n "$at_path" && as_fn_append at_path $PATH_SEPARATOR
1066case $as_dir in
1067  [\\/]* | ?:[\\/]* )
1068    as_fn_append at_path "$as_dir"
1069    ;;
1070  * )
1071    if test -z "$at_top_build_prefix"; then
1072      # Stand-alone test suite.
1073      as_fn_append at_path "$as_dir"
1074    else
1075      # Embedded test suite.
1076      as_fn_append at_path "$at_top_build_prefix$as_dir$PATH_SEPARATOR"
1077      as_fn_append at_path "$at_top_srcdir/$as_dir"
1078    fi
1079    ;;
1080esac
1081  done
1082IFS=$as_save_IFS
1083
1084
1085# Now build and simplify PATH.
1086#
1087# There might be directories that don't exist, but don't redirect
1088# builtins' (eg., cd) stderr directly: Ultrix's sh hates that.
1089at_new_path=
1090as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1091for as_dir in $at_path
1092do
1093  IFS=$as_save_IFS
1094  test -z "$as_dir" && as_dir=.
1095    test -d "$as_dir" || continue
1096case $as_dir in
1097  [\\/]* | ?:[\\/]* ) ;;
1098  * ) as_dir=`(cd "$as_dir" && pwd) 2>/dev/null` ;;
1099esac
1100case $PATH_SEPARATOR$at_new_path$PATH_SEPARATOR in
1101  *$PATH_SEPARATOR$as_dir$PATH_SEPARATOR*) ;;
1102  $PATH_SEPARATOR$PATH_SEPARATOR) at_new_path=$as_dir ;;
1103  *) as_fn_append at_new_path "$PATH_SEPARATOR$as_dir" ;;
1104esac
1105  done
1106IFS=$as_save_IFS
1107
1108PATH=$at_new_path
1109export PATH
1110
1111# Setting up the FDs.
1112
1113
1114
1115# 5 is the log file.  Not to be overwritten if `-d'.
1116if $at_debug_p; then
1117  at_suite_log=/dev/null
1118else
1119  : >"$at_suite_log"
1120fi
1121exec 5>>"$at_suite_log"
1122
1123# Banners and logs.
1124$as_echo "## ------------------------------ ##
1125## GNU Mailutils 3.13 test suite. ##
1126## ------------------------------ ##"
1127{
1128  $as_echo "## ------------------------------ ##
1129## GNU Mailutils 3.13 test suite. ##
1130## ------------------------------ ##"
1131  echo
1132
1133  $as_echo "$as_me: command line was:"
1134  $as_echo "  \$ $0 $at_cli_args"
1135  echo
1136
1137  # If ChangeLog exists, list a few lines in case it might help determining
1138  # the exact version.
1139  if test -n "$at_top_srcdir" && test -f "$at_top_srcdir/ChangeLog"; then
1140    $as_echo "## ---------- ##
1141## ChangeLog. ##
1142## ---------- ##"
1143    echo
1144    sed 's/^/| /;10q' "$at_top_srcdir/ChangeLog"
1145    echo
1146  fi
1147
1148  {
1149cat <<_ASUNAME
1150## --------- ##
1151## Platform. ##
1152## --------- ##
1153
1154hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
1155uname -m = `(uname -m) 2>/dev/null || echo unknown`
1156uname -r = `(uname -r) 2>/dev/null || echo unknown`
1157uname -s = `(uname -s) 2>/dev/null || echo unknown`
1158uname -v = `(uname -v) 2>/dev/null || echo unknown`
1159
1160/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
1161/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
1162
1163/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
1164/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
1165/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
1166/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
1167/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
1168/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
1169/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
1170
1171_ASUNAME
1172
1173as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1174for as_dir in $PATH
1175do
1176  IFS=$as_save_IFS
1177  test -z "$as_dir" && as_dir=.
1178    $as_echo "PATH: $as_dir"
1179  done
1180IFS=$as_save_IFS
1181
1182}
1183  echo
1184
1185  # Contents of the config files.
1186  for at_file in atconfig atlocal
1187  do
1188    test -r $at_file || continue
1189    $as_echo "$as_me: $at_file:"
1190    sed 's/^/| /' $at_file
1191    echo
1192  done
1193} >&5
1194
1195# This setting is needed on FreeBSD to ensure the LD_LIBRARY_PATH overrides
1196# the DT_RPATH tag in ELF header.  See
1197# https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27510
1198# for details.
1199LD_LIBRARY_PATH_RPATH=y
1200export LD_LIBRARY_PATH_RPATH
1201
1202
1203## ------------------------- ##
1204## Autotest shell functions. ##
1205## ------------------------- ##
1206
1207# at_fn_banner NUMBER
1208# -------------------
1209# Output banner NUMBER, provided the testsuite is running multiple groups and
1210# this particular banner has not yet been printed.
1211at_fn_banner ()
1212{
1213  $at_print_banners || return 0
1214  eval at_banner_text=\$at_banner_text_$1
1215  test "x$at_banner_text" = "x " && return 0
1216  eval "at_banner_text_$1=\" \""
1217  if test -z "$at_banner_text"; then
1218    $at_first || echo
1219  else
1220    $as_echo "$as_nl$at_banner_text$as_nl"
1221  fi
1222} # at_fn_banner
1223
1224# at_fn_check_prepare_notrace REASON LINE
1225# ---------------------------------------
1226# Perform AT_CHECK preparations for the command at LINE for an untraceable
1227# command; REASON is the reason for disabling tracing.
1228at_fn_check_prepare_notrace ()
1229{
1230  $at_trace_echo "Not enabling shell tracing (command contains $1)"
1231  $as_echo "$2" >"$at_check_line_file"
1232  at_check_trace=: at_check_filter=:
1233  : >"$at_stdout"; : >"$at_stderr"
1234}
1235
1236# at_fn_check_prepare_trace LINE
1237# ------------------------------
1238# Perform AT_CHECK preparations for the command at LINE for a traceable
1239# command.
1240at_fn_check_prepare_trace ()
1241{
1242  $as_echo "$1" >"$at_check_line_file"
1243  at_check_trace=$at_traceon at_check_filter=$at_check_filter_trace
1244  : >"$at_stdout"; : >"$at_stderr"
1245}
1246
1247# at_fn_check_prepare_dynamic COMMAND LINE
1248# ----------------------------------------
1249# Decide if COMMAND at LINE is traceable at runtime, and call the appropriate
1250# preparation function.
1251at_fn_check_prepare_dynamic ()
1252{
1253  case $1 in
1254    *$as_nl*)
1255      at_fn_check_prepare_notrace 'an embedded newline' "$2" ;;
1256    *)
1257      at_fn_check_prepare_trace "$2" ;;
1258  esac
1259}
1260
1261# at_fn_filter_trace
1262# ------------------
1263# Remove the lines in the file "$at_stderr" generated by "set -x" and print
1264# them to stderr.
1265at_fn_filter_trace ()
1266{
1267  mv "$at_stderr" "$at_stder1"
1268  grep '^ *+' "$at_stder1" >&2
1269  grep -v '^ *+' "$at_stder1" >"$at_stderr"
1270}
1271
1272# at_fn_log_failure FILE-LIST
1273# ---------------------------
1274# Copy the files in the list on stdout with a "> " prefix, and exit the shell
1275# with a failure exit code.
1276at_fn_log_failure ()
1277{
1278  for file
1279    do $as_echo "$file:"; sed 's/^/> /' "$file"; done
1280  echo 1 > "$at_status_file"
1281  exit 1
1282}
1283
1284# at_fn_check_skip EXIT-CODE LINE
1285# -------------------------------
1286# Check whether EXIT-CODE is a special exit code (77 or 99), and if so exit
1287# the test group subshell with that same exit code. Use LINE in any report
1288# about test failure.
1289at_fn_check_skip ()
1290{
1291  case $1 in
1292    99) echo 99 > "$at_status_file"; at_failed=:
1293	$as_echo "$2: hard failure"; exit 99;;
1294    77) echo 77 > "$at_status_file"; exit 77;;
1295  esac
1296}
1297
1298# at_fn_check_status EXPECTED EXIT-CODE LINE
1299# ------------------------------------------
1300# Check whether EXIT-CODE is the EXPECTED exit code, and if so do nothing.
1301# Otherwise, if it is 77 or 99, exit the test group subshell with that same
1302# exit code; if it is anything else print an error message referring to LINE,
1303# and fail the test.
1304at_fn_check_status ()
1305{
1306  case $2 in
1307    $1 ) ;;
1308    77) echo 77 > "$at_status_file"; exit 77;;
1309    99) echo 99 > "$at_status_file"; at_failed=:
1310	$as_echo "$3: hard failure"; exit 99;;
1311    *) $as_echo "$3: exit code was $2, expected $1"
1312      at_failed=:;;
1313  esac
1314}
1315
1316# at_fn_diff_devnull FILE
1317# -----------------------
1318# Emit a diff between /dev/null and FILE. Uses "test -s" to avoid useless diff
1319# invocations.
1320at_fn_diff_devnull ()
1321{
1322  test -s "$1" || return 0
1323  $at_diff "$at_devnull" "$1"
1324}
1325
1326# at_fn_test NUMBER
1327# -----------------
1328# Parse out test NUMBER from the tail of this file.
1329at_fn_test ()
1330{
1331  eval at_sed=\$at_sed$1
1332  sed "$at_sed" "$at_myself" > "$at_test_source"
1333}
1334
1335# at_fn_create_debugging_script
1336# -----------------------------
1337# Create the debugging script $at_group_dir/run which will reproduce the
1338# current test group.
1339at_fn_create_debugging_script ()
1340{
1341  {
1342    echo "#! /bin/sh" &&
1343    echo 'test "${ZSH_VERSION+set}" = set && alias -g '\''${1+"$@"}'\''='\''"$@"'\''' &&
1344    $as_echo "cd '$at_dir'" &&
1345    $as_echo "exec \${CONFIG_SHELL-$SHELL} \"$at_myself\" -v -d $at_debug_args $at_group \${1+\"\$@\"}" &&
1346    echo 'exit 1'
1347  } >"$at_group_dir/run" &&
1348  chmod +x "$at_group_dir/run"
1349}
1350
1351## -------------------------------- ##
1352## End of autotest shell functions. ##
1353## -------------------------------- ##
1354{
1355  $as_echo "## ---------------- ##
1356## Tested programs. ##
1357## ---------------- ##"
1358  echo
1359} >&5
1360
1361# Report what programs are being tested.
1362for at_program in : $at_tested
1363do
1364  test "$at_program" = : && continue
1365  case $at_program in
1366    [\\/]* | ?:[\\/]* ) $at_program_=$at_program ;;
1367    * )
1368    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1369for as_dir in $PATH
1370do
1371  IFS=$as_save_IFS
1372  test -z "$as_dir" && as_dir=.
1373    test -f "$as_dir/$at_program" && break
1374  done
1375IFS=$as_save_IFS
1376
1377    at_program_=$as_dir/$at_program ;;
1378  esac
1379  if test -f "$at_program_"; then
1380    {
1381      $as_echo "$at_srcdir/testsuite.at:19: $at_program_ --version"
1382      "$at_program_" --version </dev/null
1383      echo
1384    } >&5 2>&1
1385  else
1386    as_fn_error $? "cannot find $at_program" "$LINENO" 5
1387  fi
1388done
1389
1390{
1391  $as_echo "## ------------------ ##
1392## Running the tests. ##
1393## ------------------ ##"
1394} >&5
1395
1396at_start_date=`date`
1397at_start_time=`date +%s 2>/dev/null`
1398$as_echo "$as_me: starting at: $at_start_date" >&5
1399
1400# Create the master directory if it doesn't already exist.
1401as_dir="$at_suite_dir"; as_fn_mkdir_p ||
1402  as_fn_error $? "cannot create \`$at_suite_dir'" "$LINENO" 5
1403
1404# Can we diff with `/dev/null'?  DU 5.0 refuses.
1405if diff /dev/null /dev/null >/dev/null 2>&1; then
1406  at_devnull=/dev/null
1407else
1408  at_devnull=$at_suite_dir/devnull
1409  >"$at_devnull"
1410fi
1411
1412# Use `diff -u' when possible.
1413if at_diff=`diff -u "$at_devnull" "$at_devnull" 2>&1` && test -z "$at_diff"
1414then
1415  at_diff='diff -u'
1416else
1417  at_diff=diff
1418fi
1419
1420# Get the last needed group.
1421for at_group in : $at_groups; do :; done
1422
1423# Extract the start and end lines of each test group at the tail
1424# of this file
1425awk '
1426BEGIN { FS="" }
1427/^#AT_START_/ {
1428  start = NR
1429}
1430/^#AT_STOP_/ {
1431  test = substr ($ 0, 10)
1432  print "at_sed" test "=\"1," start "d;" (NR-1) "q\""
1433  if (test == "'"$at_group"'") exit
1434}' "$at_myself" > "$at_suite_dir/at-source-lines" &&
1435. "$at_suite_dir/at-source-lines" ||
1436  as_fn_error $? "cannot create test line number cache" "$LINENO" 5
1437rm -f "$at_suite_dir/at-source-lines"
1438
1439# Set number of jobs for `-j'; avoid more jobs than test groups.
1440set X $at_groups; shift; at_max_jobs=$#
1441if test $at_max_jobs -eq 0; then
1442  at_jobs=1
1443fi
1444if test $at_jobs -ne 1 &&
1445   { test $at_jobs -eq 0 || test $at_jobs -gt $at_max_jobs; }; then
1446  at_jobs=$at_max_jobs
1447fi
1448
1449# If parallel mode, don't output banners, don't split summary lines.
1450if test $at_jobs -ne 1; then
1451  at_print_banners=false
1452  at_quiet=:
1453fi
1454
1455# Set up helper dirs.
1456rm -rf "$at_helper_dir" &&
1457mkdir "$at_helper_dir" &&
1458cd "$at_helper_dir" &&
1459{ test -z "$at_groups" || mkdir $at_groups; } ||
1460as_fn_error $? "testsuite directory setup failed" "$LINENO" 5
1461
1462# Functions for running a test group.  We leave the actual
1463# test group execution outside of a shell function in order
1464# to avoid hitting zsh 4.x exit status bugs.
1465
1466# at_fn_group_prepare
1467# -------------------
1468# Prepare for running a test group.
1469at_fn_group_prepare ()
1470{
1471  # The directory for additional per-group helper files.
1472  at_job_dir=$at_helper_dir/$at_group
1473  # The file containing the location of the last AT_CHECK.
1474  at_check_line_file=$at_job_dir/check-line
1475  # The file containing the exit status of the last command.
1476  at_status_file=$at_job_dir/status
1477  # The files containing the output of the tested commands.
1478  at_stdout=$at_job_dir/stdout
1479  at_stder1=$at_job_dir/stder1
1480  at_stderr=$at_job_dir/stderr
1481  # The file containing the code for a test group.
1482  at_test_source=$at_job_dir/test-source
1483  # The file containing dates.
1484  at_times_file=$at_job_dir/times
1485
1486  # Be sure to come back to the top test directory.
1487  cd "$at_suite_dir"
1488
1489  # Clearly separate the test groups when verbose.
1490  $at_first || $at_verbose echo
1491
1492  at_group_normalized=$at_group
1493
1494  eval 'while :; do
1495    case $at_group_normalized in #(
1496    '"$at_format"'*) break;;
1497    esac
1498    at_group_normalized=0$at_group_normalized
1499  done'
1500
1501
1502  # Create a fresh directory for the next test group, and enter.
1503  # If one already exists, the user may have invoked ./run from
1504  # within that directory; we remove the contents, but not the
1505  # directory itself, so that we aren't pulling the rug out from
1506  # under the shell's notion of the current directory.
1507  at_group_dir=$at_suite_dir/$at_group_normalized
1508  at_group_log=$at_group_dir/$as_me.log
1509  if test -d "$at_group_dir"; then
1510  find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx {} \;
1511  rm -fr "$at_group_dir"/* "$at_group_dir"/.[!.] "$at_group_dir"/.??*
1512fi ||
1513    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: test directory for $at_group_normalized could not be cleaned" >&5
1514$as_echo "$as_me: WARNING: test directory for $at_group_normalized could not be cleaned" >&2;}
1515  # Be tolerant if the above `rm' was not able to remove the directory.
1516  as_dir="$at_group_dir"; as_fn_mkdir_p
1517
1518  echo 0 > "$at_status_file"
1519
1520  # In verbose mode, append to the log file *and* show on
1521  # the standard output; in quiet mode only write to the log.
1522  if test -z "$at_verbose"; then
1523    at_tee_pipe='tee -a "$at_group_log"'
1524  else
1525    at_tee_pipe='cat >> "$at_group_log"'
1526  fi
1527}
1528
1529# at_fn_group_banner ORDINAL LINE DESC PAD [BANNER]
1530# -------------------------------------------------
1531# Declare the test group ORDINAL, located at LINE with group description DESC,
1532# and residing under BANNER. Use PAD to align the status column.
1533at_fn_group_banner ()
1534{
1535  at_setup_line="$2"
1536  test -n "$5" && at_fn_banner $5
1537  at_desc="$3"
1538  case $1 in
1539    [0-9])      at_desc_line="  $1: ";;
1540    [0-9][0-9]) at_desc_line=" $1: " ;;
1541    *)          at_desc_line="$1: "  ;;
1542  esac
1543  as_fn_append at_desc_line "$3$4"
1544  $at_quiet $as_echo_n "$at_desc_line"
1545  echo "#                             -*- compilation -*-" >> "$at_group_log"
1546}
1547
1548# at_fn_group_postprocess
1549# -----------------------
1550# Perform cleanup after running a test group.
1551at_fn_group_postprocess ()
1552{
1553  # Be sure to come back to the suite directory, in particular
1554  # since below we might `rm' the group directory we are in currently.
1555  cd "$at_suite_dir"
1556
1557  if test ! -f "$at_check_line_file"; then
1558    sed "s/^ */$as_me: WARNING: /" <<_ATEOF
1559      A failure happened in a test group before any test could be
1560      run. This means that test suite is improperly designed.  Please
1561      report this failure to <bug-mailutils@gnu.org>.
1562_ATEOF
1563    $as_echo "$at_setup_line" >"$at_check_line_file"
1564    at_status=99
1565  fi
1566  $at_verbose $as_echo_n "$at_group. $at_setup_line: "
1567  $as_echo_n "$at_group. $at_setup_line: " >> "$at_group_log"
1568  case $at_xfail:$at_status in
1569    yes:0)
1570	at_msg="UNEXPECTED PASS"
1571	at_res=xpass
1572	at_errexit=$at_errexit_p
1573	at_color=$at_red
1574	;;
1575    no:0)
1576	at_msg="ok"
1577	at_res=pass
1578	at_errexit=false
1579	at_color=$at_grn
1580	;;
1581    *:77)
1582	at_msg='skipped ('`cat "$at_check_line_file"`')'
1583	at_res=skip
1584	at_errexit=false
1585	at_color=$at_blu
1586	;;
1587    no:* | *:99)
1588	at_msg='FAILED ('`cat "$at_check_line_file"`')'
1589	at_res=fail
1590	at_errexit=$at_errexit_p
1591	at_color=$at_red
1592	;;
1593    yes:*)
1594	at_msg='expected failure ('`cat "$at_check_line_file"`')'
1595	at_res=xfail
1596	at_errexit=false
1597	at_color=$at_lgn
1598	;;
1599  esac
1600  echo "$at_res" > "$at_job_dir/$at_res"
1601  # In parallel mode, output the summary line only afterwards.
1602  if test $at_jobs -ne 1 && test -n "$at_verbose"; then
1603    $as_echo "$at_desc_line $at_color$at_msg$at_std"
1604  else
1605    # Make sure there is a separator even with long titles.
1606    $as_echo " $at_color$at_msg$at_std"
1607  fi
1608  at_log_msg="$at_group. $at_desc ($at_setup_line): $at_msg"
1609  case $at_status in
1610    0|77)
1611      # $at_times_file is only available if the group succeeded.
1612      # We're not including the group log, so the success message
1613      # is written in the global log separately.  But we also
1614      # write to the group log in case they're using -d.
1615      if test -f "$at_times_file"; then
1616	at_log_msg="$at_log_msg     ("`sed 1d "$at_times_file"`')'
1617	rm -f "$at_times_file"
1618      fi
1619      $as_echo "$at_log_msg" >> "$at_group_log"
1620      $as_echo "$at_log_msg" >&5
1621
1622      # Cleanup the group directory, unless the user wants the files
1623      # or the success was unexpected.
1624      if $at_debug_p || test $at_res = xpass; then
1625	at_fn_create_debugging_script
1626	if test $at_res = xpass && $at_errexit; then
1627	  echo stop > "$at_stop_file"
1628	fi
1629      else
1630	if test -d "$at_group_dir"; then
1631	  find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \;
1632	  rm -fr "$at_group_dir"
1633	fi
1634	rm -f "$at_test_source"
1635      fi
1636      ;;
1637    *)
1638      # Upon failure, include the log into the testsuite's global
1639      # log.  The failure message is written in the group log.  It
1640      # is later included in the global log.
1641      $as_echo "$at_log_msg" >> "$at_group_log"
1642
1643      # Upon failure, keep the group directory for autopsy, and create
1644      # the debugging script.  With -e, do not start any further tests.
1645      at_fn_create_debugging_script
1646      if $at_errexit; then
1647	echo stop > "$at_stop_file"
1648      fi
1649      ;;
1650  esac
1651}
1652
1653
1654## ------------ ##
1655## Driver loop. ##
1656## ------------ ##
1657
1658
1659if (set -m && set +m && set +b) >/dev/null 2>&1; then
1660  set +b
1661  at_job_control_on='set -m' at_job_control_off='set +m' at_job_group=-
1662else
1663  at_job_control_on=: at_job_control_off=: at_job_group=
1664fi
1665
1666for at_signal in 1 2 15; do
1667  trap 'set +x; set +e
1668	$at_job_control_off
1669	at_signal='"$at_signal"'
1670	echo stop > "$at_stop_file"
1671	trap "" $at_signal
1672	at_pgids=
1673	for at_pgid in `jobs -p 2>/dev/null`; do
1674	  at_pgids="$at_pgids $at_job_group$at_pgid"
1675	done
1676	test -z "$at_pgids" || kill -$at_signal $at_pgids 2>/dev/null
1677	wait
1678	if test "$at_jobs" -eq 1 || test -z "$at_verbose"; then
1679	  echo >&2
1680	fi
1681	at_signame=`kill -l $at_signal 2>&1 || echo $at_signal`
1682	set x $at_signame
1683	test 0 -gt 2 && at_signame=$at_signal
1684	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: caught signal $at_signame, bailing out" >&5
1685$as_echo "$as_me: WARNING: caught signal $at_signame, bailing out" >&2;}
1686	as_fn_arith 128 + $at_signal && exit_status=$as_val
1687	as_fn_exit $exit_status' $at_signal
1688done
1689
1690rm -f "$at_stop_file"
1691at_first=:
1692
1693if test $at_jobs -ne 1 &&
1694     rm -f "$at_job_fifo" &&
1695     test -n "$at_job_group" &&
1696     ( mkfifo "$at_job_fifo" && trap 'exit 1' PIPE STOP TSTP ) 2>/dev/null
1697then
1698  # FIFO job dispatcher.
1699
1700  trap 'at_pids=
1701	for at_pid in `jobs -p`; do
1702	  at_pids="$at_pids $at_job_group$at_pid"
1703	done
1704	if test -n "$at_pids"; then
1705	  at_sig=TSTP
1706	  test "${TMOUT+set}" = set && at_sig=STOP
1707	  kill -$at_sig $at_pids 2>/dev/null
1708	fi
1709	kill -STOP $$
1710	test -z "$at_pids" || kill -CONT $at_pids 2>/dev/null' TSTP
1711
1712  echo
1713  # Turn jobs into a list of numbers, starting from 1.
1714  at_joblist=`$as_echo "$at_groups" | sed -n 1,${at_jobs}p`
1715
1716  set X $at_joblist
1717  shift
1718  for at_group in $at_groups; do
1719    $at_job_control_on 2>/dev/null
1720    (
1721      # Start one test group.
1722      $at_job_control_off
1723      if $at_first; then
1724	exec 7>"$at_job_fifo"
1725      else
1726	exec 6<&-
1727      fi
1728      trap 'set +x; set +e
1729	    trap "" PIPE
1730	    echo stop > "$at_stop_file"
1731	    echo >&7
1732	    as_fn_exit 141' PIPE
1733      at_fn_group_prepare
1734      if cd "$at_group_dir" &&
1735	 at_fn_test $at_group &&
1736	 . "$at_test_source"
1737      then :; else
1738	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5
1739$as_echo "$as_me: WARNING: unable to parse test group: $at_group" >&2;}
1740	at_failed=:
1741      fi
1742      at_fn_group_postprocess
1743      echo >&7
1744    ) &
1745    $at_job_control_off
1746    if $at_first; then
1747      at_first=false
1748      exec 6<"$at_job_fifo" 7>"$at_job_fifo"
1749    fi
1750    shift # Consume one token.
1751    if test $# -gt 0; then :; else
1752      read at_token <&6 || break
1753      set x $*
1754    fi
1755    test -f "$at_stop_file" && break
1756  done
1757  exec 7>&-
1758  # Read back the remaining ($at_jobs - 1) tokens.
1759  set X $at_joblist
1760  shift
1761  if test $# -gt 0; then
1762    shift
1763    for at_job
1764    do
1765      read at_token
1766    done <&6
1767  fi
1768  exec 6<&-
1769  wait
1770else
1771  # Run serially, avoid forks and other potential surprises.
1772  for at_group in $at_groups; do
1773    at_fn_group_prepare
1774    if cd "$at_group_dir" &&
1775       at_fn_test $at_group &&
1776       . "$at_test_source"; then :; else
1777      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5
1778$as_echo "$as_me: WARNING: unable to parse test group: $at_group" >&2;}
1779      at_failed=:
1780    fi
1781    at_fn_group_postprocess
1782    test -f "$at_stop_file" && break
1783    at_first=false
1784  done
1785fi
1786
1787# Wrap up the test suite with summary statistics.
1788cd "$at_helper_dir"
1789
1790# Use ?..???? when the list must remain sorted, the faster * otherwise.
1791at_pass_list=`for f in */pass; do echo $f; done | sed '/\*/d; s,/pass,,'`
1792at_skip_list=`for f in */skip; do echo $f; done | sed '/\*/d; s,/skip,,'`
1793at_xfail_list=`for f in */xfail; do echo $f; done | sed '/\*/d; s,/xfail,,'`
1794at_xpass_list=`for f in ?/xpass ??/xpass ???/xpass ????/xpass; do
1795		 echo $f; done | sed '/?/d; s,/xpass,,'`
1796at_fail_list=`for f in ?/fail ??/fail ???/fail ????/fail; do
1797		echo $f; done | sed '/?/d; s,/fail,,'`
1798
1799set X $at_pass_list $at_xpass_list $at_xfail_list $at_fail_list $at_skip_list
1800shift; at_group_count=$#
1801set X $at_xpass_list; shift; at_xpass_count=$#; at_xpass_list=$*
1802set X $at_xfail_list; shift; at_xfail_count=$#
1803set X $at_fail_list; shift; at_fail_count=$#; at_fail_list=$*
1804set X $at_skip_list; shift; at_skip_count=$#
1805
1806as_fn_arith $at_group_count - $at_skip_count && at_run_count=$as_val
1807as_fn_arith $at_xpass_count + $at_fail_count && at_unexpected_count=$as_val
1808as_fn_arith $at_xfail_count + $at_fail_count && at_total_fail_count=$as_val
1809
1810# Back to the top directory.
1811cd "$at_dir"
1812rm -rf "$at_helper_dir"
1813
1814# Compute the duration of the suite.
1815at_stop_date=`date`
1816at_stop_time=`date +%s 2>/dev/null`
1817$as_echo "$as_me: ending at: $at_stop_date" >&5
1818case $at_start_time,$at_stop_time in
1819  [0-9]*,[0-9]*)
1820    as_fn_arith $at_stop_time - $at_start_time && at_duration_s=$as_val
1821    as_fn_arith $at_duration_s / 60 && at_duration_m=$as_val
1822    as_fn_arith $at_duration_m / 60 && at_duration_h=$as_val
1823    as_fn_arith $at_duration_s % 60 && at_duration_s=$as_val
1824    as_fn_arith $at_duration_m % 60 && at_duration_m=$as_val
1825    at_duration="${at_duration_h}h ${at_duration_m}m ${at_duration_s}s"
1826    $as_echo "$as_me: test suite duration: $at_duration" >&5
1827    ;;
1828esac
1829
1830echo
1831$as_echo "## ------------- ##
1832## Test results. ##
1833## ------------- ##"
1834echo
1835{
1836  echo
1837  $as_echo "## ------------- ##
1838## Test results. ##
1839## ------------- ##"
1840  echo
1841} >&5
1842
1843if test $at_run_count = 1; then
1844  at_result="1 test"
1845  at_were=was
1846else
1847  at_result="$at_run_count tests"
1848  at_were=were
1849fi
1850if $at_errexit_p && test $at_unexpected_count != 0; then
1851  if test $at_xpass_count = 1; then
1852    at_result="$at_result $at_were run, one passed"
1853  else
1854    at_result="$at_result $at_were run, one failed"
1855  fi
1856  at_result="$at_result unexpectedly and inhibited subsequent tests."
1857  at_color=$at_red
1858else
1859  # Don't you just love exponential explosion of the number of cases?
1860  at_color=$at_red
1861  case $at_xpass_count:$at_fail_count:$at_xfail_count in
1862    # So far, so good.
1863    0:0:0) at_result="$at_result $at_were successful." at_color=$at_grn ;;
1864    0:0:*) at_result="$at_result behaved as expected." at_color=$at_lgn ;;
1865
1866    # Some unexpected failures
1867    0:*:0) at_result="$at_result $at_were run,
1868$at_fail_count failed unexpectedly." ;;
1869
1870    # Some failures, both expected and unexpected
1871    0:*:1) at_result="$at_result $at_were run,
1872$at_total_fail_count failed ($at_xfail_count expected failure)." ;;
1873    0:*:*) at_result="$at_result $at_were run,
1874$at_total_fail_count failed ($at_xfail_count expected failures)." ;;
1875
1876    # No unexpected failures, but some xpasses
1877    *:0:*) at_result="$at_result $at_were run,
1878$at_xpass_count passed unexpectedly." ;;
1879
1880    # No expected failures, but failures and xpasses
1881    *:1:0) at_result="$at_result $at_were run,
1882$at_unexpected_count did not behave as expected ($at_fail_count unexpected failure)." ;;
1883    *:*:0) at_result="$at_result $at_were run,
1884$at_unexpected_count did not behave as expected ($at_fail_count unexpected failures)." ;;
1885
1886    # All of them.
1887    *:*:1) at_result="$at_result $at_were run,
1888$at_xpass_count passed unexpectedly,
1889$at_total_fail_count failed ($at_xfail_count expected failure)." ;;
1890    *:*:*) at_result="$at_result $at_were run,
1891$at_xpass_count passed unexpectedly,
1892$at_total_fail_count failed ($at_xfail_count expected failures)." ;;
1893  esac
1894
1895  if test $at_skip_count = 0 && test $at_run_count -gt 1; then
1896    at_result="All $at_result"
1897  fi
1898fi
1899
1900# Now put skips in the mix.
1901case $at_skip_count in
1902  0) ;;
1903  1) at_result="$at_result
19041 test was skipped." ;;
1905  *) at_result="$at_result
1906$at_skip_count tests were skipped." ;;
1907esac
1908
1909if test $at_unexpected_count = 0; then
1910  echo "$at_color$at_result$at_std"
1911  echo "$at_result" >&5
1912else
1913  echo "${at_color}ERROR: $at_result$at_std" >&2
1914  echo "ERROR: $at_result" >&5
1915  {
1916    echo
1917    $as_echo "## ------------------------ ##
1918## Summary of the failures. ##
1919## ------------------------ ##"
1920
1921    # Summary of failed and skipped tests.
1922    if test $at_fail_count != 0; then
1923      echo "Failed tests:"
1924      $SHELL "$at_myself" $at_fail_list --list
1925      echo
1926    fi
1927    if test $at_skip_count != 0; then
1928      echo "Skipped tests:"
1929      $SHELL "$at_myself" $at_skip_list --list
1930      echo
1931    fi
1932    if test $at_xpass_count != 0; then
1933      echo "Unexpected passes:"
1934      $SHELL "$at_myself" $at_xpass_list --list
1935      echo
1936    fi
1937    if test $at_fail_count != 0; then
1938      $as_echo "## ---------------------- ##
1939## Detailed failed tests. ##
1940## ---------------------- ##"
1941      echo
1942      for at_group in $at_fail_list
1943      do
1944	at_group_normalized=$at_group
1945
1946  eval 'while :; do
1947    case $at_group_normalized in #(
1948    '"$at_format"'*) break;;
1949    esac
1950    at_group_normalized=0$at_group_normalized
1951  done'
1952
1953	cat "$at_suite_dir/$at_group_normalized/$as_me.log"
1954	echo
1955      done
1956      echo
1957    fi
1958    if test -n "$at_top_srcdir"; then
1959      sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
1960## ${at_top_build_prefix}config.log ##
1961_ASBOX
1962      sed 's/^/| /' ${at_top_build_prefix}config.log
1963      echo
1964    fi
1965  } >&5
1966
1967  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
1968## $as_me.log was created. ##
1969_ASBOX
1970
1971  echo
1972  if $at_debug_p; then
1973    at_msg='per-test log files'
1974  else
1975    at_msg="\`${at_testdir+${at_testdir}/}$as_me.log'"
1976  fi
1977  $as_echo "Please send $at_msg and all information you think might help:
1978
1979   To: <bug-mailutils@gnu.org>
1980   Subject: [GNU Mailutils 3.13] $as_me: $at_fail_list${at_fail_list:+ failed${at_xpass_list:+, }}$at_xpass_list${at_xpass_list:+ passed unexpectedly}
1981
1982You may investigate any problem if you feel able to do so, in which
1983case the test suite provides a good starting point.  Its output may
1984be found below \`${at_testdir+${at_testdir}/}$as_me.dir'.
1985"
1986  exit 1
1987fi
1988
1989exit 0
1990
1991## ------------- ##
1992## Actual tests. ##
1993## ------------- ##
1994#AT_START_1
1995at_fn_group_banner 1 'testsuite.at:21' \
1996  "lmtpd version" "                                  "
1997at_xfail=no
1998(
1999  $as_echo "1. $at_setup_line: testing $at_desc ..."
2000  $at_traceon
2001
2002
2003{ set +x
2004$as_echo "$at_srcdir/testsuite.at:21: lmtpd --version | sed '1{s/-[0-9][0-9]* //;s/ *\\[.*\\]//;q;}' "
2005at_fn_check_prepare_notrace 'a shell pipeline' "testsuite.at:21"
2006( $at_check_trace; lmtpd --version | sed '1{s/-[0-9][0-9]* //;s/ *\[.*\]//;q;}'
2007) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2008at_status=$? at_failed=false
2009$at_check_filter
2010at_fn_diff_devnull "$at_stderr" || at_failed=:
2011echo >>"$at_stdout"; $as_echo "lmtpd (GNU Mailutils) 3.13
2012" | \
2013  $at_diff - "$at_stdout" || at_failed=:
2014at_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:21"
2015$at_failed && at_fn_log_failure
2016$at_traceon; }
2017
2018
2019  set +x
2020  $at_times_p && times >"$at_times_file"
2021) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2022read at_status <"$at_status_file"
2023#AT_STOP_1
2024#AT_START_2
2025at_fn_group_banner 2 'lmtpd.at:17' \
2026  "lmtpd" "                                          "
2027at_xfail=no
2028(
2029  $as_echo "2. $at_setup_line: testing $at_desc ..."
2030  $at_traceon
2031
2032
2033
2034
2035
2036{ set +x
2037$as_echo "$at_srcdir/lmtpd.at:23:
2038cat >session_start <<'_ATEOF'
2039LHLO localhost
2040MAIL FROM:<gulliver@example.net>
2041RCPT TO:<root@localhost>
2042DATA
2043_ATEOF
2044
2045cat >session_end <<'_ATEOF'
2046.
2047QUIT
2048_ATEOF
2049
2050
2051cat \$INPUT_MSG > expout
2052
2053cat session_start \$INPUT_MSG session_end | \$abs_top_builddir/libmailutils/tests/fltst crlf encode read > session || exit \$?
2054
2055mkdir spool
2056lmtpd --set '|mailbox|mailbox-pattern=mbox://'\`pwd\`'/spool/\${user}' --set .auth.authorization=system --stderr --set 'group=()' < session > transcript || exit \$?
2057
2058dumpmail spool/root
2059cat transcript | tr -d '\\r' | sed '/...-/d;s/ .*//' >&2
2060"
2061at_fn_check_prepare_notrace 'a `...` command substitution' "lmtpd.at:23"
2062( $at_check_trace;
2063cat >session_start <<'_ATEOF'
2064LHLO localhost
2065MAIL FROM:<gulliver@example.net>
2066RCPT TO:<root@localhost>
2067DATA
2068_ATEOF
2069
2070cat >session_end <<'_ATEOF'
2071.
2072QUIT
2073_ATEOF
2074
2075
2076cat $INPUT_MSG > expout
2077
2078cat session_start $INPUT_MSG session_end | $abs_top_builddir/libmailutils/tests/fltst crlf encode read > session || exit $?
2079
2080mkdir spool
2081lmtpd --set '|mailbox|mailbox-pattern=mbox://'`pwd`'/spool/${user}' --set .auth.authorization=system --stderr --set 'group=()' < session > transcript || exit $?
2082
2083dumpmail spool/root
2084cat transcript | tr -d '\r' | sed '/...-/d;s/ .*//' >&2
2085
2086) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2087at_status=$? at_failed=false
2088$at_check_filter
2089echo >>"$at_stderr"; $as_echo "220
2090250
2091250
2092250
2093354
2094250
2095221
2096" | \
2097  $at_diff - "$at_stderr" || at_failed=:
2098$at_diff expout "$at_stdout" || at_failed=:
2099at_fn_check_status 0 $at_status "$at_srcdir/lmtpd.at:23"
2100$at_failed && at_fn_log_failure
2101$at_traceon; }
2102
2103
2104  set +x
2105  $at_times_p && times >"$at_times_file"
2106) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2107read at_status <"$at_status_file"
2108#AT_STOP_2
2109