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;autodetect.at:16;format detection;autodetect;
5942;count.at:17;message count;;
5953;attr.at:17;attributes;;
5964;envelope.at:17;envelope;;
5975;header.at:17;header;;
5986;body.at:17;body;;
5997;uid.at:17;uid;;
6008;uidvalidity.at:17;uidvalidity;;
6019;qget.at:17;qget access;;
60210;new.at:17;deliver messages from new;;
60311;append.at:17;append;;
60412;notify.at:17;append notification;;
60513;delete.at:17;delete;;
60614;uidnext.at:17;UID monotonicity;;
60715;attfixup.at:1;attribute fixup;;
60816;uidfixup.at:1;uid fixup;;
609"
610# List of the all the test groups.
611at_groups_all=`$as_echo "$at_help_all" | sed 's/;.*//'`
612
613# at_fn_validate_ranges NAME...
614# -----------------------------
615# Validate and normalize the test group number contained in each variable
616# NAME. Leading zeroes are treated as decimal.
617at_fn_validate_ranges ()
618{
619  for at_grp
620  do
621    eval at_value=\$$at_grp
622    if test $at_value -lt 1 || test $at_value -gt 16; then
623      $as_echo "invalid test group: $at_value" >&2
624      exit 1
625    fi
626    case $at_value in
627      0*) # We want to treat leading 0 as decimal, like expr and test, but
628	  # AS_VAR_ARITH treats it as octal if it uses $(( )).
629	  # With XSI shells, ${at_value#${at_value%%[1-9]*}} avoids the
630	  # expr fork, but it is not worth the effort to determine if the
631	  # shell supports XSI when the user can just avoid leading 0.
632	  eval $at_grp='`expr $at_value + 0`' ;;
633    esac
634  done
635}
636
637at_prev=
638for at_option
639do
640  # If the previous option needs an argument, assign it.
641  if test -n "$at_prev"; then
642    at_option=$at_prev=$at_option
643    at_prev=
644  fi
645
646  case $at_option in
647  *=?*) at_optarg=`expr "X$at_option" : '[^=]*=\(.*\)'` ;;
648  *)    at_optarg= ;;
649  esac
650
651  # Accept the important Cygnus configure options, so we can diagnose typos.
652
653  case $at_option in
654    --help | -h )
655	at_help_p=:
656	;;
657
658    --list | -l )
659	at_list_p=:
660	;;
661
662    --version | -V )
663	at_version_p=:
664	;;
665
666    --clean | -c )
667	at_clean=:
668	;;
669
670    --color )
671	at_color=always
672	;;
673    --color=* )
674	case $at_optarg in
675	no | never | none) at_color=never ;;
676	auto | tty | if-tty) at_color=auto ;;
677	always | yes | force) at_color=always ;;
678	*) at_optname=`echo " $at_option" | sed 's/^ //; s/=.*//'`
679	   as_fn_error $? "unrecognized argument to $at_optname: $at_optarg" ;;
680	esac
681	;;
682
683    --debug | -d )
684	at_debug_p=:
685	;;
686
687    --errexit | -e )
688	at_debug_p=:
689	at_errexit_p=:
690	;;
691
692    --verbose | -v )
693	at_verbose=; at_quiet=:
694	;;
695
696    --trace | -x )
697	at_traceon='set -x'
698	at_trace_echo=echo
699	at_check_filter_trace=at_fn_filter_trace
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_fn_validate_ranges at_option
704	as_fn_append at_groups "$at_option$as_nl"
705	;;
706
707    # Ranges
708    [0-9]- | [0-9][0-9]- | [0-9][0-9][0-9]- | [0-9][0-9][0-9][0-9]-)
709	at_range_start=`echo $at_option |tr -d X-`
710	at_fn_validate_ranges at_range_start
711	at_range=`$as_echo "$at_groups_all" | \
712	  sed -ne '/^'$at_range_start'$/,$p'`
713	as_fn_append at_groups "$at_range$as_nl"
714	;;
715
716    -[0-9] | -[0-9][0-9] | -[0-9][0-9][0-9] | -[0-9][0-9][0-9][0-9])
717	at_range_end=`echo $at_option |tr -d X-`
718	at_fn_validate_ranges at_range_end
719	at_range=`$as_echo "$at_groups_all" | \
720	  sed -ne '1,/^'$at_range_end'$/p'`
721	as_fn_append at_groups "$at_range$as_nl"
722	;;
723
724    [0-9]-[0-9] | [0-9]-[0-9][0-9] | [0-9]-[0-9][0-9][0-9] | \
725    [0-9]-[0-9][0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9] | \
726    [0-9][0-9]-[0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9][0-9][0-9] | \
727    [0-9][0-9][0-9]-[0-9][0-9][0-9] | \
728    [0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] | \
729    [0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] )
730	at_range_start=`expr $at_option : '\(.*\)-'`
731	at_range_end=`expr $at_option : '.*-\(.*\)'`
732	if test $at_range_start -gt $at_range_end; then
733	  at_tmp=$at_range_end
734	  at_range_end=$at_range_start
735	  at_range_start=$at_tmp
736	fi
737	at_fn_validate_ranges at_range_start at_range_end
738	at_range=`$as_echo "$at_groups_all" | \
739	  sed -ne '/^'$at_range_start'$/,/^'$at_range_end'$/p'`
740	as_fn_append at_groups "$at_range$as_nl"
741	;;
742
743    # Directory selection.
744    --directory | -C )
745	at_prev=--directory
746	;;
747    --directory=* )
748	at_change_dir=:
749	at_dir=$at_optarg
750	if test x- = "x$at_dir" ; then
751	  at_dir=./-
752	fi
753	;;
754
755    # Parallel execution.
756    --jobs | -j )
757	at_jobs=0
758	;;
759    --jobs=* | -j[0-9]* )
760	if test -n "$at_optarg"; then
761	  at_jobs=$at_optarg
762	else
763	  at_jobs=`expr X$at_option : 'X-j\(.*\)'`
764	fi
765	case $at_jobs in *[!0-9]*)
766	  at_optname=`echo " $at_option" | sed 's/^ //; s/[0-9=].*//'`
767	  as_fn_error $? "non-numeric argument to $at_optname: $at_jobs" ;;
768	esac
769	;;
770
771    # Keywords.
772    --keywords | -k )
773	at_prev=--keywords
774	;;
775    --keywords=* )
776	at_groups_selected=$at_help_all
777	at_save_IFS=$IFS
778	IFS=,
779	set X $at_optarg
780	shift
781	IFS=$at_save_IFS
782	for at_keyword
783	do
784	  at_invert=
785	  case $at_keyword in
786	  '!'*)
787	    at_invert="-v"
788	    at_keyword=`expr "X$at_keyword" : 'X!\(.*\)'`
789	    ;;
790	  esac
791	  # It is on purpose that we match the test group titles too.
792	  at_groups_selected=`$as_echo "$at_groups_selected" |
793	      grep -i $at_invert "^[1-9][^;]*;.*[; ]$at_keyword[ ;]"`
794	done
795	# Smash the keywords.
796	at_groups_selected=`$as_echo "$at_groups_selected" | sed 's/;.*//'`
797	as_fn_append at_groups "$at_groups_selected$as_nl"
798	;;
799    --recheck)
800	at_recheck=:
801	;;
802
803    *=*)
804	at_envvar=`expr "x$at_option" : 'x\([^=]*\)='`
805	# Reject names that are not valid shell variable names.
806	case $at_envvar in
807	  '' | [0-9]* | *[!_$as_cr_alnum]* )
808	    as_fn_error $? "invalid variable name: \`$at_envvar'" ;;
809	esac
810	at_value=`$as_echo "$at_optarg" | sed "s/'/'\\\\\\\\''/g"`
811	# Export now, but save eval for later and for debug scripts.
812	export $at_envvar
813	as_fn_append at_debug_args " $at_envvar='$at_value'"
814	;;
815
816     *) $as_echo "$as_me: invalid option: $at_option" >&2
817	$as_echo "Try \`$0 --help' for more information." >&2
818	exit 1
819	;;
820  esac
821done
822
823# Verify our last option didn't require an argument
824if test -n "$at_prev"; then :
825  as_fn_error $? "\`$at_prev' requires an argument"
826fi
827
828# The file containing the suite.
829at_suite_log=$at_dir/$as_me.log
830
831# Selected test groups.
832if test -z "$at_groups$at_recheck"; then
833  at_groups=$at_groups_all
834else
835  if test -n "$at_recheck" && test -r "$at_suite_log"; then
836    at_oldfails=`sed -n '
837      /^Failed tests:$/,/^Skipped tests:$/{
838	s/^[ ]*\([1-9][0-9]*\):.*/\1/p
839      }
840      /^Unexpected passes:$/,/^## Detailed failed tests/{
841	s/^[ ]*\([1-9][0-9]*\):.*/\1/p
842      }
843      /^## Detailed failed tests/q
844      ' "$at_suite_log"`
845    as_fn_append at_groups "$at_oldfails$as_nl"
846  fi
847  # Sort the tests, removing duplicates.
848  at_groups=`$as_echo "$at_groups" | sort -nu | sed '/^$/d'`
849fi
850
851if test x"$at_color" = xalways \
852   || { test x"$at_color" = xauto && test -t 1; }; then
853  at_red=`printf '\033[0;31m'`
854  at_grn=`printf '\033[0;32m'`
855  at_lgn=`printf '\033[1;32m'`
856  at_blu=`printf '\033[1;34m'`
857  at_std=`printf '\033[m'`
858else
859  at_red= at_grn= at_lgn= at_blu= at_std=
860fi
861
862# Help message.
863if $at_help_p; then
864  cat <<_ATEOF || at_write_fail=1
865Usage: $0 [OPTION]... [VARIABLE=VALUE]... [TESTS]
866
867Run all the tests, or the selected TESTS, given by numeric ranges, and
868save a detailed log file.  Upon failure, create debugging scripts.
869
870Do not change environment variables directly.  Instead, set them via
871command line arguments.  Set \`AUTOTEST_PATH' to select the executables
872to exercise.  Each relative directory is expanded as build and source
873directories relative to the top level of this distribution.
874E.g., from within the build directory /tmp/foo-1.0, invoking this:
875
876  $ $0 AUTOTEST_PATH=bin
877
878is equivalent to the following, assuming the source directory is /src/foo-1.0:
879
880  PATH=/tmp/foo-1.0/bin:/src/foo-1.0/bin:\$PATH $0
881_ATEOF
882cat <<_ATEOF || at_write_fail=1
883
884Operation modes:
885  -h, --help     print the help message, then exit
886  -V, --version  print version number, then exit
887  -c, --clean    remove all the files this test suite might create and exit
888  -l, --list     describes all the tests, or the selected TESTS
889_ATEOF
890cat <<_ATEOF || at_write_fail=1
891
892Execution tuning:
893  -C, --directory=DIR
894                 change to directory DIR before starting
895      --color[=never|auto|always]
896                 enable colored test results on terminal, or always
897  -j, --jobs[=N]
898                 Allow N jobs at once; infinite jobs with no arg (default 1)
899  -k, --keywords=KEYWORDS
900                 select the tests matching all the comma-separated KEYWORDS
901                 multiple \`-k' accumulate; prefixed \`!' negates a KEYWORD
902      --recheck  select all tests that failed or passed unexpectedly last time
903  -e, --errexit  abort as soon as a test fails; implies --debug
904  -v, --verbose  force more detailed output
905                 default for debugging scripts
906  -d, --debug    inhibit clean up and top-level logging
907                 default for debugging scripts
908  -x, --trace    enable tests shell tracing
909_ATEOF
910cat <<_ATEOF || at_write_fail=1
911
912Report bugs to <bug-mailutils@gnu.org>.
913General help using GNU software: <http://www.gnu.org/gethelp/>.
914_ATEOF
915  exit $at_write_fail
916fi
917
918# List of tests.
919if $at_list_p; then
920  cat <<_ATEOF || at_write_fail=1
921GNU Mailutils 3.13 test suite test groups:
922
923 NUM: FILE-NAME:LINE     TEST-GROUP-NAME
924      KEYWORDS
925
926_ATEOF
927  # Pass an empty line as separator between selected groups and help.
928  $as_echo "$at_groups$as_nl$as_nl$at_help_all" |
929    awk 'NF == 1 && FS != ";" {
930	   selected[$ 1] = 1
931	   next
932	 }
933	 /^$/ { FS = ";" }
934	 NF > 0 {
935	   if (selected[$ 1]) {
936	     printf " %3d: %-18s %s\n", $ 1, $ 2, $ 3
937	     if ($ 4) {
938	       lmax = 79
939	       indent = "     "
940	       line = indent
941	       len = length (line)
942	       n = split ($ 4, a, " ")
943	       for (i = 1; i <= n; i++) {
944		 l = length (a[i]) + 1
945		 if (i > 1 && len + l > lmax) {
946		   print line
947		   line = indent " " a[i]
948		   len = length (line)
949		 } else {
950		   line = line " " a[i]
951		   len += l
952		 }
953	       }
954	       if (n)
955		 print line
956	     }
957	   }
958	 }' || at_write_fail=1
959  exit $at_write_fail
960fi
961if $at_version_p; then
962  $as_echo "$as_me (GNU Mailutils 3.13)" &&
963  cat <<\_ATEOF || at_write_fail=1
964
965Copyright (C) 2012 Free Software Foundation, Inc.
966This test suite is free software; the Free Software Foundation gives
967unlimited permission to copy, distribute and modify it.
968_ATEOF
969  exit $at_write_fail
970fi
971
972# Should we print banners?  Yes if more than one test is run.
973case $at_groups in #(
974  *$as_nl* )
975      at_print_banners=: ;; #(
976  * ) at_print_banners=false ;;
977esac
978# Text for banner N, set to a single space once printed.
979
980# Take any -C into account.
981if $at_change_dir ; then
982  test x != "x$at_dir" && cd "$at_dir" \
983    || as_fn_error $? "unable to change directory"
984  at_dir=`pwd`
985fi
986
987# Load the config files for any default variable assignments.
988for at_file in atconfig atlocal
989do
990  test -r $at_file || continue
991  . ./$at_file || as_fn_error $? "invalid content: $at_file"
992done
993
994# Autoconf <=2.59b set at_top_builddir instead of at_top_build_prefix:
995: "${at_top_build_prefix=$at_top_builddir}"
996
997# Perform any assignments requested during argument parsing.
998eval "$at_debug_args"
999
1000# atconfig delivers names relative to the directory the test suite is
1001# in, but the groups themselves are run in testsuite-dir/group-dir.
1002if test -n "$at_top_srcdir"; then
1003  builddir=../..
1004  for at_dir_var in srcdir top_srcdir top_build_prefix
1005  do
1006    eval at_val=\$at_$at_dir_var
1007    case $at_val in
1008      [\\/$]* | ?:[\\/]* ) at_prefix= ;;
1009      *) at_prefix=../../ ;;
1010    esac
1011    eval "$at_dir_var=\$at_prefix\$at_val"
1012  done
1013fi
1014
1015## -------------------- ##
1016## Directory structure. ##
1017## -------------------- ##
1018
1019# This is the set of directories and files used by this script
1020# (non-literals are capitalized):
1021#
1022# TESTSUITE         - the testsuite
1023# TESTSUITE.log     - summarizes the complete testsuite run
1024# TESTSUITE.dir/    - created during a run, remains after -d or failed test
1025# + at-groups/      - during a run: status of all groups in run
1026# | + NNN/          - during a run: meta-data about test group NNN
1027# | | + check-line  - location (source file and line) of current AT_CHECK
1028# | | + status      - exit status of current AT_CHECK
1029# | | + stdout      - stdout of current AT_CHECK
1030# | | + stder1      - stderr, including trace
1031# | | + stderr      - stderr, with trace filtered out
1032# | | + test-source - portion of testsuite that defines group
1033# | | + times       - timestamps for computing duration
1034# | | + pass        - created if group passed
1035# | | + xpass       - created if group xpassed
1036# | | + fail        - created if group failed
1037# | | + xfail       - created if group xfailed
1038# | | + skip        - created if group skipped
1039# + at-stop         - during a run: end the run if this file exists
1040# + at-source-lines - during a run: cache of TESTSUITE line numbers for extraction
1041# + 0..NNN/         - created for each group NNN, remains after -d or failed test
1042# | + TESTSUITE.log - summarizes the group results
1043# | + ...           - files created during the group
1044
1045# The directory the whole suite works in.
1046# Should be absolute to let the user `cd' at will.
1047at_suite_dir=$at_dir/$as_me.dir
1048# The file containing the suite ($at_dir might have changed since earlier).
1049at_suite_log=$at_dir/$as_me.log
1050# The directory containing helper files per test group.
1051at_helper_dir=$at_suite_dir/at-groups
1052# Stop file: if it exists, do not start new jobs.
1053at_stop_file=$at_suite_dir/at-stop
1054# The fifo used for the job dispatcher.
1055at_job_fifo=$at_suite_dir/at-job-fifo
1056
1057if $at_clean; then
1058  test -d "$at_suite_dir" &&
1059    find "$at_suite_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \;
1060  rm -f -r "$at_suite_dir" "$at_suite_log"
1061  exit $?
1062fi
1063
1064# Don't take risks: use only absolute directories in PATH.
1065#
1066# For stand-alone test suites (ie. atconfig was not found),
1067# AUTOTEST_PATH is relative to `.'.
1068#
1069# For embedded test suites, AUTOTEST_PATH is relative to the top level
1070# of the package.  Then expand it into build/src parts, since users
1071# may create executables in both places.
1072AUTOTEST_PATH=`$as_echo "$AUTOTEST_PATH" | sed "s|:|$PATH_SEPARATOR|g"`
1073at_path=
1074as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1075for as_dir in $AUTOTEST_PATH $PATH
1076do
1077  IFS=$as_save_IFS
1078  test -z "$as_dir" && as_dir=.
1079    test -n "$at_path" && as_fn_append at_path $PATH_SEPARATOR
1080case $as_dir in
1081  [\\/]* | ?:[\\/]* )
1082    as_fn_append at_path "$as_dir"
1083    ;;
1084  * )
1085    if test -z "$at_top_build_prefix"; then
1086      # Stand-alone test suite.
1087      as_fn_append at_path "$as_dir"
1088    else
1089      # Embedded test suite.
1090      as_fn_append at_path "$at_top_build_prefix$as_dir$PATH_SEPARATOR"
1091      as_fn_append at_path "$at_top_srcdir/$as_dir"
1092    fi
1093    ;;
1094esac
1095  done
1096IFS=$as_save_IFS
1097
1098
1099# Now build and simplify PATH.
1100#
1101# There might be directories that don't exist, but don't redirect
1102# builtins' (eg., cd) stderr directly: Ultrix's sh hates that.
1103at_new_path=
1104as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1105for as_dir in $at_path
1106do
1107  IFS=$as_save_IFS
1108  test -z "$as_dir" && as_dir=.
1109    test -d "$as_dir" || continue
1110case $as_dir in
1111  [\\/]* | ?:[\\/]* ) ;;
1112  * ) as_dir=`(cd "$as_dir" && pwd) 2>/dev/null` ;;
1113esac
1114case $PATH_SEPARATOR$at_new_path$PATH_SEPARATOR in
1115  *$PATH_SEPARATOR$as_dir$PATH_SEPARATOR*) ;;
1116  $PATH_SEPARATOR$PATH_SEPARATOR) at_new_path=$as_dir ;;
1117  *) as_fn_append at_new_path "$PATH_SEPARATOR$as_dir" ;;
1118esac
1119  done
1120IFS=$as_save_IFS
1121
1122PATH=$at_new_path
1123export PATH
1124
1125# Setting up the FDs.
1126
1127
1128
1129# 5 is the log file.  Not to be overwritten if `-d'.
1130if $at_debug_p; then
1131  at_suite_log=/dev/null
1132else
1133  : >"$at_suite_log"
1134fi
1135exec 5>>"$at_suite_log"
1136
1137# Banners and logs.
1138$as_echo "## ------------------------------ ##
1139## GNU Mailutils 3.13 test suite. ##
1140## ------------------------------ ##"
1141{
1142  $as_echo "## ------------------------------ ##
1143## GNU Mailutils 3.13 test suite. ##
1144## ------------------------------ ##"
1145  echo
1146
1147  $as_echo "$as_me: command line was:"
1148  $as_echo "  \$ $0 $at_cli_args"
1149  echo
1150
1151  # If ChangeLog exists, list a few lines in case it might help determining
1152  # the exact version.
1153  if test -n "$at_top_srcdir" && test -f "$at_top_srcdir/ChangeLog"; then
1154    $as_echo "## ---------- ##
1155## ChangeLog. ##
1156## ---------- ##"
1157    echo
1158    sed 's/^/| /;10q' "$at_top_srcdir/ChangeLog"
1159    echo
1160  fi
1161
1162  {
1163cat <<_ASUNAME
1164## --------- ##
1165## Platform. ##
1166## --------- ##
1167
1168hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
1169uname -m = `(uname -m) 2>/dev/null || echo unknown`
1170uname -r = `(uname -r) 2>/dev/null || echo unknown`
1171uname -s = `(uname -s) 2>/dev/null || echo unknown`
1172uname -v = `(uname -v) 2>/dev/null || echo unknown`
1173
1174/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
1175/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
1176
1177/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
1178/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
1179/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
1180/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
1181/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
1182/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
1183/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
1184
1185_ASUNAME
1186
1187as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1188for as_dir in $PATH
1189do
1190  IFS=$as_save_IFS
1191  test -z "$as_dir" && as_dir=.
1192    $as_echo "PATH: $as_dir"
1193  done
1194IFS=$as_save_IFS
1195
1196}
1197  echo
1198
1199  # Contents of the config files.
1200  for at_file in atconfig atlocal
1201  do
1202    test -r $at_file || continue
1203    $as_echo "$as_me: $at_file:"
1204    sed 's/^/| /' $at_file
1205    echo
1206  done
1207} >&5
1208
1209# This setting is needed on FreeBSD to ensure the LD_LIBRARY_PATH overrides
1210# the DT_RPATH tag in ELF header.  See
1211# https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27510
1212# for details.
1213LD_LIBRARY_PATH_RPATH=y
1214export LD_LIBRARY_PATH_RPATH
1215
1216
1217## ------------------------- ##
1218## Autotest shell functions. ##
1219## ------------------------- ##
1220
1221# at_fn_banner NUMBER
1222# -------------------
1223# Output banner NUMBER, provided the testsuite is running multiple groups and
1224# this particular banner has not yet been printed.
1225at_fn_banner ()
1226{
1227  $at_print_banners || return 0
1228  eval at_banner_text=\$at_banner_text_$1
1229  test "x$at_banner_text" = "x " && return 0
1230  eval "at_banner_text_$1=\" \""
1231  if test -z "$at_banner_text"; then
1232    $at_first || echo
1233  else
1234    $as_echo "$as_nl$at_banner_text$as_nl"
1235  fi
1236} # at_fn_banner
1237
1238# at_fn_check_prepare_notrace REASON LINE
1239# ---------------------------------------
1240# Perform AT_CHECK preparations for the command at LINE for an untraceable
1241# command; REASON is the reason for disabling tracing.
1242at_fn_check_prepare_notrace ()
1243{
1244  $at_trace_echo "Not enabling shell tracing (command contains $1)"
1245  $as_echo "$2" >"$at_check_line_file"
1246  at_check_trace=: at_check_filter=:
1247  : >"$at_stdout"; : >"$at_stderr"
1248}
1249
1250# at_fn_check_prepare_trace LINE
1251# ------------------------------
1252# Perform AT_CHECK preparations for the command at LINE for a traceable
1253# command.
1254at_fn_check_prepare_trace ()
1255{
1256  $as_echo "$1" >"$at_check_line_file"
1257  at_check_trace=$at_traceon at_check_filter=$at_check_filter_trace
1258  : >"$at_stdout"; : >"$at_stderr"
1259}
1260
1261# at_fn_check_prepare_dynamic COMMAND LINE
1262# ----------------------------------------
1263# Decide if COMMAND at LINE is traceable at runtime, and call the appropriate
1264# preparation function.
1265at_fn_check_prepare_dynamic ()
1266{
1267  case $1 in
1268    *$as_nl*)
1269      at_fn_check_prepare_notrace 'an embedded newline' "$2" ;;
1270    *)
1271      at_fn_check_prepare_trace "$2" ;;
1272  esac
1273}
1274
1275# at_fn_filter_trace
1276# ------------------
1277# Remove the lines in the file "$at_stderr" generated by "set -x" and print
1278# them to stderr.
1279at_fn_filter_trace ()
1280{
1281  mv "$at_stderr" "$at_stder1"
1282  grep '^ *+' "$at_stder1" >&2
1283  grep -v '^ *+' "$at_stder1" >"$at_stderr"
1284}
1285
1286# at_fn_log_failure FILE-LIST
1287# ---------------------------
1288# Copy the files in the list on stdout with a "> " prefix, and exit the shell
1289# with a failure exit code.
1290at_fn_log_failure ()
1291{
1292  for file
1293    do $as_echo "$file:"; sed 's/^/> /' "$file"; done
1294  echo 1 > "$at_status_file"
1295  exit 1
1296}
1297
1298# at_fn_check_skip EXIT-CODE LINE
1299# -------------------------------
1300# Check whether EXIT-CODE is a special exit code (77 or 99), and if so exit
1301# the test group subshell with that same exit code. Use LINE in any report
1302# about test failure.
1303at_fn_check_skip ()
1304{
1305  case $1 in
1306    99) echo 99 > "$at_status_file"; at_failed=:
1307	$as_echo "$2: hard failure"; exit 99;;
1308    77) echo 77 > "$at_status_file"; exit 77;;
1309  esac
1310}
1311
1312# at_fn_check_status EXPECTED EXIT-CODE LINE
1313# ------------------------------------------
1314# Check whether EXIT-CODE is the EXPECTED exit code, and if so do nothing.
1315# Otherwise, if it is 77 or 99, exit the test group subshell with that same
1316# exit code; if it is anything else print an error message referring to LINE,
1317# and fail the test.
1318at_fn_check_status ()
1319{
1320  case $2 in
1321    $1 ) ;;
1322    77) echo 77 > "$at_status_file"; exit 77;;
1323    99) echo 99 > "$at_status_file"; at_failed=:
1324	$as_echo "$3: hard failure"; exit 99;;
1325    *) $as_echo "$3: exit code was $2, expected $1"
1326      at_failed=:;;
1327  esac
1328}
1329
1330# at_fn_diff_devnull FILE
1331# -----------------------
1332# Emit a diff between /dev/null and FILE. Uses "test -s" to avoid useless diff
1333# invocations.
1334at_fn_diff_devnull ()
1335{
1336  test -s "$1" || return 0
1337  $at_diff "$at_devnull" "$1"
1338}
1339
1340# at_fn_test NUMBER
1341# -----------------
1342# Parse out test NUMBER from the tail of this file.
1343at_fn_test ()
1344{
1345  eval at_sed=\$at_sed$1
1346  sed "$at_sed" "$at_myself" > "$at_test_source"
1347}
1348
1349# at_fn_create_debugging_script
1350# -----------------------------
1351# Create the debugging script $at_group_dir/run which will reproduce the
1352# current test group.
1353at_fn_create_debugging_script ()
1354{
1355  {
1356    echo "#! /bin/sh" &&
1357    echo 'test "${ZSH_VERSION+set}" = set && alias -g '\''${1+"$@"}'\''='\''"$@"'\''' &&
1358    $as_echo "cd '$at_dir'" &&
1359    $as_echo "exec \${CONFIG_SHELL-$SHELL} \"$at_myself\" -v -d $at_debug_args $at_group \${1+\"\$@\"}" &&
1360    echo 'exit 1'
1361  } >"$at_group_dir/run" &&
1362  chmod +x "$at_group_dir/run"
1363}
1364
1365## -------------------------------- ##
1366## End of autotest shell functions. ##
1367## -------------------------------- ##
1368{
1369  $as_echo "## ---------------- ##
1370## Tested programs. ##
1371## ---------------- ##"
1372  echo
1373} >&5
1374
1375# Report what programs are being tested.
1376for at_program in : $at_tested
1377do
1378  test "$at_program" = : && continue
1379  case $at_program in
1380    [\\/]* | ?:[\\/]* ) $at_program_=$at_program ;;
1381    * )
1382    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1383for as_dir in $PATH
1384do
1385  IFS=$as_save_IFS
1386  test -z "$as_dir" && as_dir=.
1387    test -f "$as_dir/$at_program" && break
1388  done
1389IFS=$as_save_IFS
1390
1391    at_program_=$as_dir/$at_program ;;
1392  esac
1393  if test -f "$at_program_"; then
1394    {
1395      $as_echo "$at_srcdir/testsuite.at:19: $at_program_ --version"
1396      "$at_program_" --version </dev/null
1397      echo
1398    } >&5 2>&1
1399  else
1400    as_fn_error $? "cannot find $at_program" "$LINENO" 5
1401  fi
1402done
1403
1404{
1405  $as_echo "## ------------------ ##
1406## Running the tests. ##
1407## ------------------ ##"
1408} >&5
1409
1410at_start_date=`date`
1411at_start_time=`date +%s 2>/dev/null`
1412$as_echo "$as_me: starting at: $at_start_date" >&5
1413
1414# Create the master directory if it doesn't already exist.
1415as_dir="$at_suite_dir"; as_fn_mkdir_p ||
1416  as_fn_error $? "cannot create \`$at_suite_dir'" "$LINENO" 5
1417
1418# Can we diff with `/dev/null'?  DU 5.0 refuses.
1419if diff /dev/null /dev/null >/dev/null 2>&1; then
1420  at_devnull=/dev/null
1421else
1422  at_devnull=$at_suite_dir/devnull
1423  >"$at_devnull"
1424fi
1425
1426# Use `diff -u' when possible.
1427if at_diff=`diff -u "$at_devnull" "$at_devnull" 2>&1` && test -z "$at_diff"
1428then
1429  at_diff='diff -u'
1430else
1431  at_diff=diff
1432fi
1433
1434# Get the last needed group.
1435for at_group in : $at_groups; do :; done
1436
1437# Extract the start and end lines of each test group at the tail
1438# of this file
1439awk '
1440BEGIN { FS="" }
1441/^#AT_START_/ {
1442  start = NR
1443}
1444/^#AT_STOP_/ {
1445  test = substr ($ 0, 10)
1446  print "at_sed" test "=\"1," start "d;" (NR-1) "q\""
1447  if (test == "'"$at_group"'") exit
1448}' "$at_myself" > "$at_suite_dir/at-source-lines" &&
1449. "$at_suite_dir/at-source-lines" ||
1450  as_fn_error $? "cannot create test line number cache" "$LINENO" 5
1451rm -f "$at_suite_dir/at-source-lines"
1452
1453# Set number of jobs for `-j'; avoid more jobs than test groups.
1454set X $at_groups; shift; at_max_jobs=$#
1455if test $at_max_jobs -eq 0; then
1456  at_jobs=1
1457fi
1458if test $at_jobs -ne 1 &&
1459   { test $at_jobs -eq 0 || test $at_jobs -gt $at_max_jobs; }; then
1460  at_jobs=$at_max_jobs
1461fi
1462
1463# If parallel mode, don't output banners, don't split summary lines.
1464if test $at_jobs -ne 1; then
1465  at_print_banners=false
1466  at_quiet=:
1467fi
1468
1469# Set up helper dirs.
1470rm -rf "$at_helper_dir" &&
1471mkdir "$at_helper_dir" &&
1472cd "$at_helper_dir" &&
1473{ test -z "$at_groups" || mkdir $at_groups; } ||
1474as_fn_error $? "testsuite directory setup failed" "$LINENO" 5
1475
1476# Functions for running a test group.  We leave the actual
1477# test group execution outside of a shell function in order
1478# to avoid hitting zsh 4.x exit status bugs.
1479
1480# at_fn_group_prepare
1481# -------------------
1482# Prepare for running a test group.
1483at_fn_group_prepare ()
1484{
1485  # The directory for additional per-group helper files.
1486  at_job_dir=$at_helper_dir/$at_group
1487  # The file containing the location of the last AT_CHECK.
1488  at_check_line_file=$at_job_dir/check-line
1489  # The file containing the exit status of the last command.
1490  at_status_file=$at_job_dir/status
1491  # The files containing the output of the tested commands.
1492  at_stdout=$at_job_dir/stdout
1493  at_stder1=$at_job_dir/stder1
1494  at_stderr=$at_job_dir/stderr
1495  # The file containing the code for a test group.
1496  at_test_source=$at_job_dir/test-source
1497  # The file containing dates.
1498  at_times_file=$at_job_dir/times
1499
1500  # Be sure to come back to the top test directory.
1501  cd "$at_suite_dir"
1502
1503  # Clearly separate the test groups when verbose.
1504  $at_first || $at_verbose echo
1505
1506  at_group_normalized=$at_group
1507
1508  eval 'while :; do
1509    case $at_group_normalized in #(
1510    '"$at_format"'*) break;;
1511    esac
1512    at_group_normalized=0$at_group_normalized
1513  done'
1514
1515
1516  # Create a fresh directory for the next test group, and enter.
1517  # If one already exists, the user may have invoked ./run from
1518  # within that directory; we remove the contents, but not the
1519  # directory itself, so that we aren't pulling the rug out from
1520  # under the shell's notion of the current directory.
1521  at_group_dir=$at_suite_dir/$at_group_normalized
1522  at_group_log=$at_group_dir/$as_me.log
1523  if test -d "$at_group_dir"; then
1524  find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx {} \;
1525  rm -fr "$at_group_dir"/* "$at_group_dir"/.[!.] "$at_group_dir"/.??*
1526fi ||
1527    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: test directory for $at_group_normalized could not be cleaned" >&5
1528$as_echo "$as_me: WARNING: test directory for $at_group_normalized could not be cleaned" >&2;}
1529  # Be tolerant if the above `rm' was not able to remove the directory.
1530  as_dir="$at_group_dir"; as_fn_mkdir_p
1531
1532  echo 0 > "$at_status_file"
1533
1534  # In verbose mode, append to the log file *and* show on
1535  # the standard output; in quiet mode only write to the log.
1536  if test -z "$at_verbose"; then
1537    at_tee_pipe='tee -a "$at_group_log"'
1538  else
1539    at_tee_pipe='cat >> "$at_group_log"'
1540  fi
1541}
1542
1543# at_fn_group_banner ORDINAL LINE DESC PAD [BANNER]
1544# -------------------------------------------------
1545# Declare the test group ORDINAL, located at LINE with group description DESC,
1546# and residing under BANNER. Use PAD to align the status column.
1547at_fn_group_banner ()
1548{
1549  at_setup_line="$2"
1550  test -n "$5" && at_fn_banner $5
1551  at_desc="$3"
1552  case $1 in
1553    [0-9])      at_desc_line="  $1: ";;
1554    [0-9][0-9]) at_desc_line=" $1: " ;;
1555    *)          at_desc_line="$1: "  ;;
1556  esac
1557  as_fn_append at_desc_line "$3$4"
1558  $at_quiet $as_echo_n "$at_desc_line"
1559  echo "#                             -*- compilation -*-" >> "$at_group_log"
1560}
1561
1562# at_fn_group_postprocess
1563# -----------------------
1564# Perform cleanup after running a test group.
1565at_fn_group_postprocess ()
1566{
1567  # Be sure to come back to the suite directory, in particular
1568  # since below we might `rm' the group directory we are in currently.
1569  cd "$at_suite_dir"
1570
1571  if test ! -f "$at_check_line_file"; then
1572    sed "s/^ */$as_me: WARNING: /" <<_ATEOF
1573      A failure happened in a test group before any test could be
1574      run. This means that test suite is improperly designed.  Please
1575      report this failure to <bug-mailutils@gnu.org>.
1576_ATEOF
1577    $as_echo "$at_setup_line" >"$at_check_line_file"
1578    at_status=99
1579  fi
1580  $at_verbose $as_echo_n "$at_group. $at_setup_line: "
1581  $as_echo_n "$at_group. $at_setup_line: " >> "$at_group_log"
1582  case $at_xfail:$at_status in
1583    yes:0)
1584	at_msg="UNEXPECTED PASS"
1585	at_res=xpass
1586	at_errexit=$at_errexit_p
1587	at_color=$at_red
1588	;;
1589    no:0)
1590	at_msg="ok"
1591	at_res=pass
1592	at_errexit=false
1593	at_color=$at_grn
1594	;;
1595    *:77)
1596	at_msg='skipped ('`cat "$at_check_line_file"`')'
1597	at_res=skip
1598	at_errexit=false
1599	at_color=$at_blu
1600	;;
1601    no:* | *:99)
1602	at_msg='FAILED ('`cat "$at_check_line_file"`')'
1603	at_res=fail
1604	at_errexit=$at_errexit_p
1605	at_color=$at_red
1606	;;
1607    yes:*)
1608	at_msg='expected failure ('`cat "$at_check_line_file"`')'
1609	at_res=xfail
1610	at_errexit=false
1611	at_color=$at_lgn
1612	;;
1613  esac
1614  echo "$at_res" > "$at_job_dir/$at_res"
1615  # In parallel mode, output the summary line only afterwards.
1616  if test $at_jobs -ne 1 && test -n "$at_verbose"; then
1617    $as_echo "$at_desc_line $at_color$at_msg$at_std"
1618  else
1619    # Make sure there is a separator even with long titles.
1620    $as_echo " $at_color$at_msg$at_std"
1621  fi
1622  at_log_msg="$at_group. $at_desc ($at_setup_line): $at_msg"
1623  case $at_status in
1624    0|77)
1625      # $at_times_file is only available if the group succeeded.
1626      # We're not including the group log, so the success message
1627      # is written in the global log separately.  But we also
1628      # write to the group log in case they're using -d.
1629      if test -f "$at_times_file"; then
1630	at_log_msg="$at_log_msg     ("`sed 1d "$at_times_file"`')'
1631	rm -f "$at_times_file"
1632      fi
1633      $as_echo "$at_log_msg" >> "$at_group_log"
1634      $as_echo "$at_log_msg" >&5
1635
1636      # Cleanup the group directory, unless the user wants the files
1637      # or the success was unexpected.
1638      if $at_debug_p || test $at_res = xpass; then
1639	at_fn_create_debugging_script
1640	if test $at_res = xpass && $at_errexit; then
1641	  echo stop > "$at_stop_file"
1642	fi
1643      else
1644	if test -d "$at_group_dir"; then
1645	  find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \;
1646	  rm -fr "$at_group_dir"
1647	fi
1648	rm -f "$at_test_source"
1649      fi
1650      ;;
1651    *)
1652      # Upon failure, include the log into the testsuite's global
1653      # log.  The failure message is written in the group log.  It
1654      # is later included in the global log.
1655      $as_echo "$at_log_msg" >> "$at_group_log"
1656
1657      # Upon failure, keep the group directory for autopsy, and create
1658      # the debugging script.  With -e, do not start any further tests.
1659      at_fn_create_debugging_script
1660      if $at_errexit; then
1661	echo stop > "$at_stop_file"
1662      fi
1663      ;;
1664  esac
1665}
1666
1667
1668## ------------ ##
1669## Driver loop. ##
1670## ------------ ##
1671
1672
1673if (set -m && set +m && set +b) >/dev/null 2>&1; then
1674  set +b
1675  at_job_control_on='set -m' at_job_control_off='set +m' at_job_group=-
1676else
1677  at_job_control_on=: at_job_control_off=: at_job_group=
1678fi
1679
1680for at_signal in 1 2 15; do
1681  trap 'set +x; set +e
1682	$at_job_control_off
1683	at_signal='"$at_signal"'
1684	echo stop > "$at_stop_file"
1685	trap "" $at_signal
1686	at_pgids=
1687	for at_pgid in `jobs -p 2>/dev/null`; do
1688	  at_pgids="$at_pgids $at_job_group$at_pgid"
1689	done
1690	test -z "$at_pgids" || kill -$at_signal $at_pgids 2>/dev/null
1691	wait
1692	if test "$at_jobs" -eq 1 || test -z "$at_verbose"; then
1693	  echo >&2
1694	fi
1695	at_signame=`kill -l $at_signal 2>&1 || echo $at_signal`
1696	set x $at_signame
1697	test 0 -gt 2 && at_signame=$at_signal
1698	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: caught signal $at_signame, bailing out" >&5
1699$as_echo "$as_me: WARNING: caught signal $at_signame, bailing out" >&2;}
1700	as_fn_arith 128 + $at_signal && exit_status=$as_val
1701	as_fn_exit $exit_status' $at_signal
1702done
1703
1704rm -f "$at_stop_file"
1705at_first=:
1706
1707if test $at_jobs -ne 1 &&
1708     rm -f "$at_job_fifo" &&
1709     test -n "$at_job_group" &&
1710     ( mkfifo "$at_job_fifo" && trap 'exit 1' PIPE STOP TSTP ) 2>/dev/null
1711then
1712  # FIFO job dispatcher.
1713
1714  trap 'at_pids=
1715	for at_pid in `jobs -p`; do
1716	  at_pids="$at_pids $at_job_group$at_pid"
1717	done
1718	if test -n "$at_pids"; then
1719	  at_sig=TSTP
1720	  test "${TMOUT+set}" = set && at_sig=STOP
1721	  kill -$at_sig $at_pids 2>/dev/null
1722	fi
1723	kill -STOP $$
1724	test -z "$at_pids" || kill -CONT $at_pids 2>/dev/null' TSTP
1725
1726  echo
1727  # Turn jobs into a list of numbers, starting from 1.
1728  at_joblist=`$as_echo "$at_groups" | sed -n 1,${at_jobs}p`
1729
1730  set X $at_joblist
1731  shift
1732  for at_group in $at_groups; do
1733    $at_job_control_on 2>/dev/null
1734    (
1735      # Start one test group.
1736      $at_job_control_off
1737      if $at_first; then
1738	exec 7>"$at_job_fifo"
1739      else
1740	exec 6<&-
1741      fi
1742      trap 'set +x; set +e
1743	    trap "" PIPE
1744	    echo stop > "$at_stop_file"
1745	    echo >&7
1746	    as_fn_exit 141' PIPE
1747      at_fn_group_prepare
1748      if cd "$at_group_dir" &&
1749	 at_fn_test $at_group &&
1750	 . "$at_test_source"
1751      then :; else
1752	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5
1753$as_echo "$as_me: WARNING: unable to parse test group: $at_group" >&2;}
1754	at_failed=:
1755      fi
1756      at_fn_group_postprocess
1757      echo >&7
1758    ) &
1759    $at_job_control_off
1760    if $at_first; then
1761      at_first=false
1762      exec 6<"$at_job_fifo" 7>"$at_job_fifo"
1763    fi
1764    shift # Consume one token.
1765    if test $# -gt 0; then :; else
1766      read at_token <&6 || break
1767      set x $*
1768    fi
1769    test -f "$at_stop_file" && break
1770  done
1771  exec 7>&-
1772  # Read back the remaining ($at_jobs - 1) tokens.
1773  set X $at_joblist
1774  shift
1775  if test $# -gt 0; then
1776    shift
1777    for at_job
1778    do
1779      read at_token
1780    done <&6
1781  fi
1782  exec 6<&-
1783  wait
1784else
1785  # Run serially, avoid forks and other potential surprises.
1786  for at_group in $at_groups; do
1787    at_fn_group_prepare
1788    if cd "$at_group_dir" &&
1789       at_fn_test $at_group &&
1790       . "$at_test_source"; then :; else
1791      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5
1792$as_echo "$as_me: WARNING: unable to parse test group: $at_group" >&2;}
1793      at_failed=:
1794    fi
1795    at_fn_group_postprocess
1796    test -f "$at_stop_file" && break
1797    at_first=false
1798  done
1799fi
1800
1801# Wrap up the test suite with summary statistics.
1802cd "$at_helper_dir"
1803
1804# Use ?..???? when the list must remain sorted, the faster * otherwise.
1805at_pass_list=`for f in */pass; do echo $f; done | sed '/\*/d; s,/pass,,'`
1806at_skip_list=`for f in */skip; do echo $f; done | sed '/\*/d; s,/skip,,'`
1807at_xfail_list=`for f in */xfail; do echo $f; done | sed '/\*/d; s,/xfail,,'`
1808at_xpass_list=`for f in ?/xpass ??/xpass ???/xpass ????/xpass; do
1809		 echo $f; done | sed '/?/d; s,/xpass,,'`
1810at_fail_list=`for f in ?/fail ??/fail ???/fail ????/fail; do
1811		echo $f; done | sed '/?/d; s,/fail,,'`
1812
1813set X $at_pass_list $at_xpass_list $at_xfail_list $at_fail_list $at_skip_list
1814shift; at_group_count=$#
1815set X $at_xpass_list; shift; at_xpass_count=$#; at_xpass_list=$*
1816set X $at_xfail_list; shift; at_xfail_count=$#
1817set X $at_fail_list; shift; at_fail_count=$#; at_fail_list=$*
1818set X $at_skip_list; shift; at_skip_count=$#
1819
1820as_fn_arith $at_group_count - $at_skip_count && at_run_count=$as_val
1821as_fn_arith $at_xpass_count + $at_fail_count && at_unexpected_count=$as_val
1822as_fn_arith $at_xfail_count + $at_fail_count && at_total_fail_count=$as_val
1823
1824# Back to the top directory.
1825cd "$at_dir"
1826rm -rf "$at_helper_dir"
1827
1828# Compute the duration of the suite.
1829at_stop_date=`date`
1830at_stop_time=`date +%s 2>/dev/null`
1831$as_echo "$as_me: ending at: $at_stop_date" >&5
1832case $at_start_time,$at_stop_time in
1833  [0-9]*,[0-9]*)
1834    as_fn_arith $at_stop_time - $at_start_time && at_duration_s=$as_val
1835    as_fn_arith $at_duration_s / 60 && at_duration_m=$as_val
1836    as_fn_arith $at_duration_m / 60 && at_duration_h=$as_val
1837    as_fn_arith $at_duration_s % 60 && at_duration_s=$as_val
1838    as_fn_arith $at_duration_m % 60 && at_duration_m=$as_val
1839    at_duration="${at_duration_h}h ${at_duration_m}m ${at_duration_s}s"
1840    $as_echo "$as_me: test suite duration: $at_duration" >&5
1841    ;;
1842esac
1843
1844echo
1845$as_echo "## ------------- ##
1846## Test results. ##
1847## ------------- ##"
1848echo
1849{
1850  echo
1851  $as_echo "## ------------- ##
1852## Test results. ##
1853## ------------- ##"
1854  echo
1855} >&5
1856
1857if test $at_run_count = 1; then
1858  at_result="1 test"
1859  at_were=was
1860else
1861  at_result="$at_run_count tests"
1862  at_were=were
1863fi
1864if $at_errexit_p && test $at_unexpected_count != 0; then
1865  if test $at_xpass_count = 1; then
1866    at_result="$at_result $at_were run, one passed"
1867  else
1868    at_result="$at_result $at_were run, one failed"
1869  fi
1870  at_result="$at_result unexpectedly and inhibited subsequent tests."
1871  at_color=$at_red
1872else
1873  # Don't you just love exponential explosion of the number of cases?
1874  at_color=$at_red
1875  case $at_xpass_count:$at_fail_count:$at_xfail_count in
1876    # So far, so good.
1877    0:0:0) at_result="$at_result $at_were successful." at_color=$at_grn ;;
1878    0:0:*) at_result="$at_result behaved as expected." at_color=$at_lgn ;;
1879
1880    # Some unexpected failures
1881    0:*:0) at_result="$at_result $at_were run,
1882$at_fail_count failed unexpectedly." ;;
1883
1884    # Some failures, both expected and unexpected
1885    0:*:1) at_result="$at_result $at_were run,
1886$at_total_fail_count failed ($at_xfail_count expected failure)." ;;
1887    0:*:*) at_result="$at_result $at_were run,
1888$at_total_fail_count failed ($at_xfail_count expected failures)." ;;
1889
1890    # No unexpected failures, but some xpasses
1891    *:0:*) at_result="$at_result $at_were run,
1892$at_xpass_count passed unexpectedly." ;;
1893
1894    # No expected failures, but failures and xpasses
1895    *:1:0) at_result="$at_result $at_were run,
1896$at_unexpected_count did not behave as expected ($at_fail_count unexpected failure)." ;;
1897    *:*:0) at_result="$at_result $at_were run,
1898$at_unexpected_count did not behave as expected ($at_fail_count unexpected failures)." ;;
1899
1900    # All of them.
1901    *:*:1) at_result="$at_result $at_were run,
1902$at_xpass_count passed unexpectedly,
1903$at_total_fail_count failed ($at_xfail_count expected failure)." ;;
1904    *:*:*) at_result="$at_result $at_were run,
1905$at_xpass_count passed unexpectedly,
1906$at_total_fail_count failed ($at_xfail_count expected failures)." ;;
1907  esac
1908
1909  if test $at_skip_count = 0 && test $at_run_count -gt 1; then
1910    at_result="All $at_result"
1911  fi
1912fi
1913
1914# Now put skips in the mix.
1915case $at_skip_count in
1916  0) ;;
1917  1) at_result="$at_result
19181 test was skipped." ;;
1919  *) at_result="$at_result
1920$at_skip_count tests were skipped." ;;
1921esac
1922
1923if test $at_unexpected_count = 0; then
1924  echo "$at_color$at_result$at_std"
1925  echo "$at_result" >&5
1926else
1927  echo "${at_color}ERROR: $at_result$at_std" >&2
1928  echo "ERROR: $at_result" >&5
1929  {
1930    echo
1931    $as_echo "## ------------------------ ##
1932## Summary of the failures. ##
1933## ------------------------ ##"
1934
1935    # Summary of failed and skipped tests.
1936    if test $at_fail_count != 0; then
1937      echo "Failed tests:"
1938      $SHELL "$at_myself" $at_fail_list --list
1939      echo
1940    fi
1941    if test $at_skip_count != 0; then
1942      echo "Skipped tests:"
1943      $SHELL "$at_myself" $at_skip_list --list
1944      echo
1945    fi
1946    if test $at_xpass_count != 0; then
1947      echo "Unexpected passes:"
1948      $SHELL "$at_myself" $at_xpass_list --list
1949      echo
1950    fi
1951    if test $at_fail_count != 0; then
1952      $as_echo "## ---------------------- ##
1953## Detailed failed tests. ##
1954## ---------------------- ##"
1955      echo
1956      for at_group in $at_fail_list
1957      do
1958	at_group_normalized=$at_group
1959
1960  eval 'while :; do
1961    case $at_group_normalized in #(
1962    '"$at_format"'*) break;;
1963    esac
1964    at_group_normalized=0$at_group_normalized
1965  done'
1966
1967	cat "$at_suite_dir/$at_group_normalized/$as_me.log"
1968	echo
1969      done
1970      echo
1971    fi
1972    if test -n "$at_top_srcdir"; then
1973      sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
1974## ${at_top_build_prefix}config.log ##
1975_ASBOX
1976      sed 's/^/| /' ${at_top_build_prefix}config.log
1977      echo
1978    fi
1979  } >&5
1980
1981  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
1982## $as_me.log was created. ##
1983_ASBOX
1984
1985  echo
1986  if $at_debug_p; then
1987    at_msg='per-test log files'
1988  else
1989    at_msg="\`${at_testdir+${at_testdir}/}$as_me.log'"
1990  fi
1991  $as_echo "Please send $at_msg and all information you think might help:
1992
1993   To: <bug-mailutils@gnu.org>
1994   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}
1995
1996You may investigate any problem if you feel able to do so, in which
1997case the test suite provides a good starting point.  Its output may
1998be found below \`${at_testdir+${at_testdir}/}$as_me.dir'.
1999"
2000  exit 1
2001fi
2002
2003exit 0
2004
2005## ------------- ##
2006## Actual tests. ##
2007## ------------- ##
2008#AT_START_1
2009at_fn_group_banner 1 'autodetect.at:16' \
2010  "format detection" "                               "
2011at_xfail=no
2012(
2013  $as_echo "1. $at_setup_line: testing $at_desc ..."
2014  $at_traceon
2015
2016
2017{ set +x
2018$as_echo "$at_srcdir/autodetect.at:18:
2019mkdir inbox inbox/cur inbox/new
2020mbop -m inbox --detect
2021"
2022at_fn_check_prepare_notrace 'an embedded newline' "autodetect.at:18"
2023( $at_check_trace;
2024mkdir inbox inbox/cur inbox/new
2025mbop -m inbox --detect
2026
2027) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2028at_status=$? at_failed=false
2029$at_check_filter
2030at_fn_diff_devnull "$at_stderr" || at_failed=:
2031echo >>"$at_stdout"; $as_echo "inbox: 0
2032" | \
2033  $at_diff - "$at_stdout" || at_failed=:
2034at_fn_check_status 1 $at_status "$at_srcdir/autodetect.at:18"
2035$at_failed && at_fn_log_failure
2036$at_traceon; }
2037
2038{ set +x
2039$as_echo "$at_srcdir/autodetect.at:25:
2040mkdir inbox/tmp
2041mbop -m inbox --detect
2042"
2043at_fn_check_prepare_notrace 'an embedded newline' "autodetect.at:25"
2044( $at_check_trace;
2045mkdir inbox/tmp
2046mbop -m inbox --detect
2047
2048) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2049at_status=$? at_failed=false
2050$at_check_filter
2051at_fn_diff_devnull "$at_stderr" || at_failed=:
2052echo >>"$at_stdout"; $as_echo "inbox: 2
2053" | \
2054  $at_diff - "$at_stdout" || at_failed=:
2055at_fn_check_status 0 $at_status "$at_srcdir/autodetect.at:25"
2056$at_failed && at_fn_log_failure
2057$at_traceon; }
2058
2059  set +x
2060  $at_times_p && times >"$at_times_file"
2061) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2062read at_status <"$at_status_file"
2063#AT_STOP_1
2064#AT_START_2
2065at_fn_group_banner 2 'count.at:17' \
2066  "message count" "                                  "
2067at_xfail=no
2068(
2069  $as_echo "2. $at_setup_line: testing $at_desc ..."
2070  $at_traceon
2071
2072{ set +x
2073$as_echo "$at_srcdir/count.at:18: mbox2dir inbox \$spooldir/mbox1"
2074at_fn_check_prepare_dynamic "mbox2dir inbox $spooldir/mbox1" "count.at:18"
2075( $at_check_trace; mbox2dir inbox $spooldir/mbox1
2076) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2077at_status=$? at_failed=false
2078$at_check_filter
2079at_fn_diff_devnull "$at_stderr" || at_failed=:
2080at_fn_diff_devnull "$at_stdout" || at_failed=:
2081at_fn_check_status 0 $at_status "$at_srcdir/count.at:18"
2082$at_failed && at_fn_log_failure
2083$at_traceon; }
2084
2085
2086{ set +x
2087$as_echo "$at_srcdir/count.at:20:
2088mbop -m inbox count
2089"
2090at_fn_check_prepare_notrace 'an embedded newline' "count.at:20"
2091( $at_check_trace;
2092mbop -m inbox count
2093
2094) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2095at_status=$? at_failed=false
2096$at_check_filter
2097at_fn_diff_devnull "$at_stderr" || at_failed=:
2098echo >>"$at_stdout"; $as_echo "count: 5
2099" | \
2100  $at_diff - "$at_stdout" || at_failed=:
2101at_fn_check_status 0 $at_status "$at_srcdir/count.at:20"
2102$at_failed && at_fn_log_failure
2103$at_traceon; }
2104
2105  set +x
2106  $at_times_p && times >"$at_times_file"
2107) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2108read at_status <"$at_status_file"
2109#AT_STOP_2
2110#AT_START_3
2111at_fn_group_banner 3 'attr.at:17' \
2112  "attributes" "                                     "
2113at_xfail=no
2114(
2115  $as_echo "3. $at_setup_line: testing $at_desc ..."
2116  $at_traceon
2117
2118cat >names <<'_ATEOF'
2119cur/1284628225.M17468P3883Q0.Trurl,a=O,u=1:2,
2120cur/1284628225.M19181P3883Q1.Trurl,a=O,u=20:2,S
2121cur/1284628225.M20118P3883Q2.Trurl,u=22:2,
2122cur/1284628225.M21284P3883Q3.Trurl,u=43:2,
2123cur/1284628225.M22502P3883Q4.Trurl,u=50:2,
2124_ATEOF
2125
2126{ set +x
2127$as_echo "$at_srcdir/attr.at:25: mbox2dir -i names -p -v 10 inbox \$spooldir/mbox1"
2128at_fn_check_prepare_dynamic "mbox2dir -i names -p -v 10 inbox $spooldir/mbox1" "attr.at:25"
2129( $at_check_trace; mbox2dir -i names -p -v 10 inbox $spooldir/mbox1
2130) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2131at_status=$? at_failed=false
2132$at_check_filter
2133at_fn_diff_devnull "$at_stderr" || at_failed=:
2134at_fn_diff_devnull "$at_stdout" || at_failed=:
2135at_fn_check_status 0 $at_status "$at_srcdir/attr.at:25"
2136$at_failed && at_fn_log_failure
2137$at_traceon; }
2138
2139
2140{ set +x
2141$as_echo "$at_srcdir/attr.at:27:
2142mbop -m inbox 1 \\; attr \\; 2 \\; attr
2143"
2144at_fn_check_prepare_notrace 'an embedded newline' "attr.at:27"
2145( $at_check_trace;
2146mbop -m inbox 1 \; attr \; 2 \; attr
2147
2148) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2149at_status=$? at_failed=false
2150$at_check_filter
2151at_fn_diff_devnull "$at_stderr" || at_failed=:
2152echo >>"$at_stdout"; $as_echo "1 current message
21531 attr: O
21542 current message
21552 attr: OR
2156" | \
2157  $at_diff - "$at_stdout" || at_failed=:
2158at_fn_check_status 0 $at_status "$at_srcdir/attr.at:27"
2159$at_failed && at_fn_log_failure
2160$at_traceon; }
2161
2162{ set +x
2163$as_echo "$at_srcdir/attr.at:36:
2164cat >commands <<'_ATEOF'
2165# Select 3rd message
21663
2167# Set the read attribute
2168set_read
2169# Set the draft attribute
2170set_draft
2171# Select 5th message
21725
2173# Set the answered attribute
2174set_answered
2175set_seen
2176# Synchronize with the disk storage
2177sync
2178_ATEOF
2179
2180mbop -m inbox < commands
2181"
2182at_fn_check_prepare_notrace 'an embedded newline' "attr.at:36"
2183( $at_check_trace;
2184cat >commands <<'_ATEOF'
2185# Select 3rd message
21863
2187# Set the read attribute
2188set_read
2189# Set the draft attribute
2190set_draft
2191# Select 5th message
21925
2193# Set the answered attribute
2194set_answered
2195set_seen
2196# Synchronize with the disk storage
2197sync
2198_ATEOF
2199
2200mbop -m inbox < commands
2201
2202) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2203at_status=$? at_failed=false
2204$at_check_filter
2205at_fn_diff_devnull "$at_stderr" || at_failed=:
2206echo >>"$at_stdout"; $as_echo "3 current message
22073 set_read: OK
22083 set_draft: OK
22095 current message
22105 set_answered: OK
22115 set_seen: OK
2212sync: OK
2213" | \
2214  $at_diff - "$at_stdout" || at_failed=:
2215at_fn_check_status 0 $at_status "$at_srcdir/attr.at:36"
2216$at_failed && at_fn_log_failure
2217$at_traceon; }
2218
2219{ set +x
2220$as_echo "$at_srcdir/attr.at:63:
2221mbop -m inbox 3 \\; attr \\; 5 \\; attr
2222"
2223at_fn_check_prepare_notrace 'an embedded newline' "attr.at:63"
2224( $at_check_trace;
2225mbop -m inbox 3 \; attr \; 5 \; attr
2226
2227) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2228at_status=$? at_failed=false
2229$at_check_filter
2230at_fn_diff_devnull "$at_stderr" || at_failed=:
2231echo >>"$at_stdout"; $as_echo "3 current message
22323 attr: dR
22335 current message
22345 attr: AO
2235" | \
2236  $at_diff - "$at_stdout" || at_failed=:
2237at_fn_check_status 0 $at_status "$at_srcdir/attr.at:63"
2238$at_failed && at_fn_log_failure
2239$at_traceon; }
2240
2241  set +x
2242  $at_times_p && times >"$at_times_file"
2243) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2244read at_status <"$at_status_file"
2245#AT_STOP_3
2246#AT_START_4
2247at_fn_group_banner 4 'envelope.at:17' \
2248  "envelope" "                                       "
2249at_xfail=no
2250(
2251  $as_echo "4. $at_setup_line: testing $at_desc ..."
2252  $at_traceon
2253
2254cat >names <<'_ATEOF'
2255cur/1284628225.M17468P3883Q0.Trurl,u=1:2,
2256cur/1284628225.M19181P3883Q1.Trurl,u=20:2,S
2257cur/1284628225.M20118P3883Q2.Trurl,u=22:2,
2258cur/1284628225.M21284P3883Q3.Trurl,u=43:2,
2259cur/1284628225.M22502P3883Q4.Trurl,u=50:2,
2260_ATEOF
2261
2262{ set +x
2263$as_echo "$at_srcdir/envelope.at:25: mbox2dir -i names -p -v 10 inbox \$spooldir/mbox1"
2264at_fn_check_prepare_dynamic "mbox2dir -i names -p -v 10 inbox $spooldir/mbox1" "envelope.at:25"
2265( $at_check_trace; mbox2dir -i names -p -v 10 inbox $spooldir/mbox1
2266) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2267at_status=$? at_failed=false
2268$at_check_filter
2269at_fn_diff_devnull "$at_stderr" || at_failed=:
2270at_fn_diff_devnull "$at_stdout" || at_failed=:
2271at_fn_check_status 0 $at_status "$at_srcdir/envelope.at:25"
2272$at_failed && at_fn_log_failure
2273$at_traceon; }
2274
2275{ set +x
2276$as_echo "$at_srcdir/envelope.at:26: mbop -m inbox 2 \\; env_date \\; env_sender"
2277at_fn_check_prepare_trace "envelope.at:26"
2278( $at_check_trace; mbop -m inbox 2 \; env_date \; env_sender
2279) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2280at_status=$? at_failed=false
2281$at_check_filter
2282at_fn_diff_devnull "$at_stderr" || at_failed=:
2283echo >>"$at_stdout"; $as_echo "2 current message
22842 env_date: Fri Dec 28 20:18:08 2001
22852 env_sender: bar@dontmailme.org
2286" | \
2287  $at_diff - "$at_stdout" || at_failed=:
2288at_fn_check_status 0 $at_status "$at_srcdir/envelope.at:26"
2289$at_failed && at_fn_log_failure
2290$at_traceon; }
2291
2292  set +x
2293  $at_times_p && times >"$at_times_file"
2294) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2295read at_status <"$at_status_file"
2296#AT_STOP_4
2297#AT_START_5
2298at_fn_group_banner 5 'header.at:17' \
2299  "header" "                                         "
2300at_xfail=no
2301(
2302  $as_echo "5. $at_setup_line: testing $at_desc ..."
2303  $at_traceon
2304
2305cat >names <<'_ATEOF'
2306cur/1284628225.M17468P3883Q0.Trurl,u=1:2,
2307cur/1284628225.M19181P3883Q1.Trurl,u=20:2,S
2308cur/1284628225.M20118P3883Q2.Trurl,u=22:2,
2309cur/1284628225.M21284P3883Q3.Trurl,u=43:2,
2310cur/1284628225.M22502P3883Q4.Trurl,u=50:2,
2311_ATEOF
2312
2313cat >commands <<'_ATEOF'
23141
2315header_lines
2316header_size
2317header_count
2318headers
23192
2320header_lines
2321header_size
2322header_count
2323headers
2324_ATEOF
2325
2326{ set +x
2327$as_echo "$at_srcdir/header.at:37: mbox2dir -i names -p -v 10 inbox \$spooldir/mbox1"
2328at_fn_check_prepare_dynamic "mbox2dir -i names -p -v 10 inbox $spooldir/mbox1" "header.at:37"
2329( $at_check_trace; mbox2dir -i names -p -v 10 inbox $spooldir/mbox1
2330) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2331at_status=$? at_failed=false
2332$at_check_filter
2333at_fn_diff_devnull "$at_stderr" || at_failed=:
2334at_fn_diff_devnull "$at_stdout" || at_failed=:
2335at_fn_check_status 0 $at_status "$at_srcdir/header.at:37"
2336$at_failed && at_fn_log_failure
2337$at_traceon; }
2338
2339{ set +x
2340$as_echo "$at_srcdir/header.at:38:
2341mbop -m inbox < commands
2342"
2343at_fn_check_prepare_notrace 'an embedded newline' "header.at:38"
2344( $at_check_trace;
2345mbop -m inbox < commands
2346
2347) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2348at_status=$? at_failed=false
2349$at_check_filter
2350at_fn_diff_devnull "$at_stderr" || at_failed=:
2351echo >>"$at_stdout"; $as_echo "1 current message
23521 header_lines: 9
23531 header_size: 317
23541 header_count: 6
23551 headers: Received:(from foobar@nonexistent.net) by nonexistent.net id fBSKI8N04906 for bar@dontmailme.org; Fri, 28 Dec 2001 22:18:08 +0200
2356Date:Fri, 28 Dec 2001 22:18:08 +0200
2357From:Foo Bar <foobar@nonexistent.net>
2358Message-Id:<200112282018.fBSKI8N04906@nonexistent.net>
2359To:Bar <bar@dontmailme.org>
2360Subject:Jabberwocky
2361
23622 current message
23632 header_lines: 9
23642 header_size: 319
23652 header_count: 6
23662 headers: Received:(from bar@dontmailme.org) by dontmailme.org id fERKR9N16790 for foobar@nonexistent.net; Fri, 28 Dec 2001 22:18:08 +0200
2367Date:Fri, 28 Dec 2001 23:28:08 +0200
2368From:Bar <bar@dontmailme.org>
2369To:Foo Bar <foobar@nonexistent.net>
2370Message-Id:<200112232808.fERKR9N16790@dontmailme.org>
2371Subject:Re: Jabberwocky
2372
2373" | \
2374  $at_diff - "$at_stdout" || at_failed=:
2375at_fn_check_status 0 $at_status "$at_srcdir/header.at:38"
2376$at_failed && at_fn_log_failure
2377$at_traceon; }
2378
2379  set +x
2380  $at_times_p && times >"$at_times_file"
2381) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2382read at_status <"$at_status_file"
2383#AT_STOP_5
2384#AT_START_6
2385at_fn_group_banner 6 'body.at:17' \
2386  "body" "                                           "
2387at_xfail=no
2388(
2389  $as_echo "6. $at_setup_line: testing $at_desc ..."
2390  $at_traceon
2391
2392cat >commands <<'_ATEOF'
23931
2394body_lines
2395body_size
2396body_text
23972
2398body_lines
2399body_size
2400body_text
2401_ATEOF
2402
2403{ set +x
2404$as_echo "$at_srcdir/body.at:28: mbox2dir -p -v 10 inbox \$spooldir/mbox1"
2405at_fn_check_prepare_dynamic "mbox2dir -p -v 10 inbox $spooldir/mbox1" "body.at:28"
2406( $at_check_trace; mbox2dir -p -v 10 inbox $spooldir/mbox1
2407) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2408at_status=$? at_failed=false
2409$at_check_filter
2410at_fn_diff_devnull "$at_stderr" || at_failed=:
2411at_fn_diff_devnull "$at_stdout" || at_failed=:
2412at_fn_check_status 0 $at_status "$at_srcdir/body.at:28"
2413$at_failed && at_fn_log_failure
2414$at_traceon; }
2415
2416
2417{ set +x
2418$as_echo "$at_srcdir/body.at:30:
2419mbop -m inbox < commands
2420"
2421at_fn_check_prepare_notrace 'an embedded newline' "body.at:30"
2422( $at_check_trace;
2423mbop -m inbox < commands
2424
2425) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2426at_status=$? at_failed=false
2427$at_check_filter
2428at_fn_diff_devnull "$at_stderr" || at_failed=:
2429echo >>"$at_stdout"; $as_echo "1 current message
24301 body_lines: 35
24311 body_size: 937
24321 body_text: \`Twas brillig, and the slithy toves
2433Did gyre and gimble in the wabe;
2434All mimsy were the borogoves,
2435And the mome raths outgrabe.
2436
2437\`Beware the Jabberwock, my son!
2438The jaws that bite, the claws that catch!
2439Beware the Jujub bird, and shun
2440The frumious Bandersnatch!'
2441
2442He took his vorpal sword in hand:
2443Long time the manxome foe he sought --
2444So rested he by the Tumtum gree,
2445And stood awhile in thought.
2446
2447And as in uffish thought he stood,
2448The Jabberwock, with eyes of flame,
2449Came whiffling through the tulgey wook,
2450And burbled as it came!
2451
2452One, two!  One, two!  And through and through
2453The vorpal blade went snicker-snack!
2454He left it dead, and with its head
2455He went galumphing back.
2456
2457\`And has thou slain the Jabberwock?
2458Come to my arms, my beamish boy!
2459O frabjous day!  Calloh!  Callay!
2460He chortled in his joy.
2461
2462\`Twas brillig, and the slithy toves
2463Did gyre and gimble in the wabe;
2464All mimsy were the borogoves,
2465And the mome raths outgrabe.
2466
2467
24682 current message
24692 body_lines: 4
24702 body_size: 215
24712 body_text: It seems very pretty, but it's *rather* hard to understand!'
2472Somehow it seems to fill my head with ideas -- only I don't
2473exactly know what they are!  However, SOMEBODY killed SOMETHING:
2474that's clear, at any rate...
2475
2476" | \
2477  $at_diff - "$at_stdout" || at_failed=:
2478at_fn_check_status 0 $at_status "$at_srcdir/body.at:30"
2479$at_failed && at_fn_log_failure
2480$at_traceon; }
2481
2482  set +x
2483  $at_times_p && times >"$at_times_file"
2484) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2485read at_status <"$at_status_file"
2486#AT_STOP_6
2487#AT_START_7
2488at_fn_group_banner 7 'uid.at:17' \
2489  "uid" "                                            "
2490at_xfail=no
2491(
2492  $as_echo "7. $at_setup_line: testing $at_desc ..."
2493  $at_traceon
2494
2495cat >names <<'_ATEOF'
2496cur/1284628225.M17468P3883Q0.Trurl,u=1:2,
2497cur/1284628225.M19181P3883Q1.Trurl,u=20:2,S
2498cur/1284628225.M20118P3883Q2.Trurl,u=22:2,
2499cur/1284628225.M21284P3883Q3.Trurl,u=43:2,
2500cur/1284628225.M22502P3883Q4.Trurl,u=50:2,
2501_ATEOF
2502
2503{ set +x
2504$as_echo "$at_srcdir/uid.at:25: mbox2dir -i names -p -v 10 inbox \$spooldir/mbox1"
2505at_fn_check_prepare_dynamic "mbox2dir -i names -p -v 10 inbox $spooldir/mbox1" "uid.at:25"
2506( $at_check_trace; mbox2dir -i names -p -v 10 inbox $spooldir/mbox1
2507) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2508at_status=$? at_failed=false
2509$at_check_filter
2510at_fn_diff_devnull "$at_stderr" || at_failed=:
2511at_fn_diff_devnull "$at_stdout" || at_failed=:
2512at_fn_check_status 0 $at_status "$at_srcdir/uid.at:25"
2513$at_failed && at_fn_log_failure
2514$at_traceon; }
2515
2516{ set +x
2517$as_echo "$at_srcdir/uid.at:26:
2518mbop -m inbox 1 \\; uid \\; 2 \\; uid \\; 3 \\; uid \\; 4 \\; uid \\; 5 \\; uid
2519"
2520at_fn_check_prepare_notrace 'an embedded newline' "uid.at:26"
2521( $at_check_trace;
2522mbop -m inbox 1 \; uid \; 2 \; uid \; 3 \; uid \; 4 \; uid \; 5 \; uid
2523
2524) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2525at_status=$? at_failed=false
2526$at_check_filter
2527at_fn_diff_devnull "$at_stderr" || at_failed=:
2528echo >>"$at_stdout"; $as_echo "1 current message
25291 uid: 1
25302 current message
25312 uid: 20
25323 current message
25333 uid: 22
25344 current message
25354 uid: 43
25365 current message
25375 uid: 50
2538" | \
2539  $at_diff - "$at_stdout" || at_failed=:
2540at_fn_check_status 0 $at_status "$at_srcdir/uid.at:26"
2541$at_failed && at_fn_log_failure
2542$at_traceon; }
2543
2544  set +x
2545  $at_times_p && times >"$at_times_file"
2546) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2547read at_status <"$at_status_file"
2548#AT_STOP_7
2549#AT_START_8
2550at_fn_group_banner 8 'uidvalidity.at:17' \
2551  "uidvalidity" "                                    "
2552at_xfail=no
2553(
2554  $as_echo "8. $at_setup_line: testing $at_desc ..."
2555  $at_traceon
2556
2557cat >names <<'_ATEOF'
2558cur/1284628225.M17468P3883Q0.Trurl,u=1:2,
2559cur/1284628225.M19181P3883Q1.Trurl,u=20:2,S
2560cur/1284628225.M20118P3883Q2.Trurl,u=22:2,
2561cur/1284628225.M21284P3883Q3.Trurl,u=43:2,
2562cur/1284628225.M22502P3883Q4.Trurl,u=50:2,
2563_ATEOF
2564
2565{ set +x
2566$as_echo "$at_srcdir/uidvalidity.at:25: mbox2dir -i names -p -v 10 inbox \$spooldir/mbox1"
2567at_fn_check_prepare_dynamic "mbox2dir -i names -p -v 10 inbox $spooldir/mbox1" "uidvalidity.at:25"
2568( $at_check_trace; mbox2dir -i names -p -v 10 inbox $spooldir/mbox1
2569) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2570at_status=$? at_failed=false
2571$at_check_filter
2572at_fn_diff_devnull "$at_stderr" || at_failed=:
2573at_fn_diff_devnull "$at_stdout" || at_failed=:
2574at_fn_check_status 0 $at_status "$at_srcdir/uidvalidity.at:25"
2575$at_failed && at_fn_log_failure
2576$at_traceon; }
2577
2578{ set +x
2579$as_echo "$at_srcdir/uidvalidity.at:26:
2580mbop -m inbox uidvalidity \\; uidnext
2581"
2582at_fn_check_prepare_notrace 'an embedded newline' "uidvalidity.at:26"
2583( $at_check_trace;
2584mbop -m inbox uidvalidity \; uidnext
2585
2586) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2587at_status=$? at_failed=false
2588$at_check_filter
2589at_fn_diff_devnull "$at_stderr" || at_failed=:
2590echo >>"$at_stdout"; $as_echo "uidvalidity: 10
2591uidnext: 51
2592" | \
2593  $at_diff - "$at_stdout" || at_failed=:
2594at_fn_check_status 0 $at_status "$at_srcdir/uidvalidity.at:26"
2595$at_failed && at_fn_log_failure
2596$at_traceon; }
2597
2598  set +x
2599  $at_times_p && times >"$at_times_file"
2600) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2601read at_status <"$at_status_file"
2602#AT_STOP_8
2603#AT_START_9
2604at_fn_group_banner 9 'qget.at:17' \
2605  "qget access" "                                    "
2606at_xfail=no
2607(
2608  $as_echo "9. $at_setup_line: testing $at_desc ..."
2609  $at_traceon
2610
2611cat >names <<'_ATEOF'
2612cur/1284628225.M17468P3883Q0.Trurl,u=1:2,
2613cur/1284628225.M19181P3883Q1.Trurl,u=2:2,S
2614cur/1284628225.M20118P3883Q2.Trurl,u=3:2,
2615cur/1284628225.M21284P3883Q3.Trurl,u=4:2,
2616cur/1284628225.M22502P3883Q4.Trurl,u=5:2,
2617_ATEOF
2618
2619{ set +x
2620$as_echo "$at_srcdir/qget.at:25: mbox2dir -i names -p -v 10 inbox \$spooldir/mbox1"
2621at_fn_check_prepare_dynamic "mbox2dir -i names -p -v 10 inbox $spooldir/mbox1" "qget.at:25"
2622( $at_check_trace; mbox2dir -i names -p -v 10 inbox $spooldir/mbox1
2623) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2624at_status=$? at_failed=false
2625$at_check_filter
2626at_fn_diff_devnull "$at_stderr" || at_failed=:
2627at_fn_diff_devnull "$at_stdout" || at_failed=:
2628at_fn_check_status 0 $at_status "$at_srcdir/qget.at:25"
2629$at_failed && at_fn_log_failure
2630$at_traceon; }
2631
2632{ set +x
2633$as_echo "$at_srcdir/qget.at:26:
2634mbop -m inbox qget cur/1284628225.M19181P3883Q1.Trurl,u=2:2,S
2635"
2636at_fn_check_prepare_notrace 'an embedded newline' "qget.at:26"
2637( $at_check_trace;
2638mbop -m inbox qget cur/1284628225.M19181P3883Q1.Trurl,u=2:2,S
2639
2640) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2641at_status=$? at_failed=false
2642$at_check_filter
2643at_fn_diff_devnull "$at_stderr" || at_failed=:
2644echo >>"$at_stdout"; $as_echo "qget: Received: (from bar@dontmailme.org)
2645	by dontmailme.org id fERKR9N16790
2646	for foobar@nonexistent.net; Fri, 28 Dec 2001 22:18:08 +0200
2647Date: Fri, 28 Dec 2001 23:28:08 +0200
2648From: Bar <bar@dontmailme.org>
2649To: Foo Bar <foobar@nonexistent.net>
2650Message-Id: <200112232808.fERKR9N16790@dontmailme.org>
2651Subject: Re: Jabberwocky
2652
2653It seems very pretty, but it's *rather* hard to understand!'
2654Somehow it seems to fill my head with ideas -- only I don't
2655exactly know what they are!  However, SOMEBODY killed SOMETHING:
2656that's clear, at any rate...
2657
2658" | \
2659  $at_diff - "$at_stdout" || at_failed=:
2660at_fn_check_status 0 $at_status "$at_srcdir/qget.at:26"
2661$at_failed && at_fn_log_failure
2662$at_traceon; }
2663
2664  set +x
2665  $at_times_p && times >"$at_times_file"
2666) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2667read at_status <"$at_status_file"
2668#AT_STOP_9
2669#AT_START_10
2670at_fn_group_banner 10 'new.at:17' \
2671  "deliver messages from new" "                      "
2672at_xfail=no
2673(
2674  $as_echo "10. $at_setup_line: testing $at_desc ..."
2675  $at_traceon
2676
2677cat >names <<'_ATEOF'
2678cur/1284628225.M17468P3883Q0.Trurl,u=1:2,
2679cur/1284628225.M19181P3883Q1.Trurl,u=20:2,S
2680cur/1284628225.M20118P3883Q2.Trurl,u=22:2,
2681cur/1284628225.M21284P3883Q3.Trurl,u=43:2,
2682new/1284628225.M22502P3883Q4.Trurl
2683_ATEOF
2684
2685{ set +x
2686$as_echo "$at_srcdir/new.at:25: mbox2dir -i names -p -v 10 -u inbox \$spooldir/mbox1"
2687at_fn_check_prepare_dynamic "mbox2dir -i names -p -v 10 -u inbox $spooldir/mbox1" "new.at:25"
2688( $at_check_trace; mbox2dir -i names -p -v 10 -u inbox $spooldir/mbox1
2689) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2690at_status=$? at_failed=false
2691$at_check_filter
2692at_fn_diff_devnull "$at_stderr" || at_failed=:
2693at_fn_diff_devnull "$at_stdout" || at_failed=:
2694at_fn_check_status 0 $at_status "$at_srcdir/new.at:25"
2695$at_failed && at_fn_log_failure
2696$at_traceon; }
2697
2698{ set +x
2699$as_echo "$at_srcdir/new.at:26: mbop -m inbox count \\; 5 \\; uid \\; uidvalidity \\; uidnext"
2700at_fn_check_prepare_trace "new.at:26"
2701( $at_check_trace; mbop -m inbox count \; 5 \; uid \; uidvalidity \; uidnext
2702) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2703at_status=$? at_failed=false
2704$at_check_filter
2705at_fn_diff_devnull "$at_stderr" || at_failed=:
2706echo >>"$at_stdout"; $as_echo "count: 5
27075 current message
27085 uid: 44
2709uidvalidity: 10
2710uidnext: 45
2711" | \
2712  $at_diff - "$at_stdout" || at_failed=:
2713at_fn_check_status 0 $at_status "$at_srcdir/new.at:26"
2714$at_failed && at_fn_log_failure
2715$at_traceon; }
2716
2717  set +x
2718  $at_times_p && times >"$at_times_file"
2719) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2720read at_status <"$at_status_file"
2721#AT_STOP_10
2722#AT_START_11
2723at_fn_group_banner 11 'append.at:17' \
2724  "append" "                                         "
2725at_xfail=no
2726(
2727  $as_echo "11. $at_setup_line: testing $at_desc ..."
2728  $at_traceon
2729
2730{ set +x
2731$as_echo "$at_srcdir/append.at:18: mbox2dir -p -v 10 -u inbox \$spooldir/mbox1"
2732at_fn_check_prepare_dynamic "mbox2dir -p -v 10 -u inbox $spooldir/mbox1" "append.at:18"
2733( $at_check_trace; mbox2dir -p -v 10 -u inbox $spooldir/mbox1
2734) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2735at_status=$? at_failed=false
2736$at_check_filter
2737at_fn_diff_devnull "$at_stderr" || at_failed=:
2738at_fn_diff_devnull "$at_stdout" || at_failed=:
2739at_fn_check_status 0 $at_status "$at_srcdir/append.at:18"
2740$at_failed && at_fn_log_failure
2741$at_traceon; }
2742
2743cat >msg <<'_ATEOF'
2744Received: (from alice@wonder.land)
2745	by wonder.land id 3304
2746	for hare@wonder.land; Mon, 29 Jul 2002 22:00:09 +0100
2747Date: Mon, 29 Jul 2002 22:00:04 +0100
2748From: Alice  <alice@wonder.land>
2749Message-Id: <200207292200.3304@wonder.land>
2750To: March Hare  <hare@wonder.land>
2751Subject: Re: Invitation
2752Return-Path: alice@wonder.land
2753
2754Then it wasn't very civil of you to offer it
2755_ATEOF
2756
2757cat >commands <<'_ATEOF'
2758append msg
2759count
27606
2761uid
2762env_date
2763env_sender
2764headers
2765body_text
2766_ATEOF
2767
2768{ set +x
2769$as_echo "$at_srcdir/append.at:42:
2770mbop -m inbox < commands
2771"
2772at_fn_check_prepare_notrace 'an embedded newline' "append.at:42"
2773( $at_check_trace;
2774mbop -m inbox < commands
2775
2776) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2777at_status=$? at_failed=false
2778$at_check_filter
2779at_fn_diff_devnull "$at_stderr" || at_failed=:
2780echo >>"$at_stdout"; $as_echo "append: OK
2781count: 6
27826 current message
27836 uid: 6
27846 env_date: Mon Jul 29 21:00:09 2002
27856 env_sender: alice@wonder.land
27866 headers: Received:(from alice@wonder.land) by wonder.land id 3304 for hare@wonder.land; Mon, 29 Jul 2002 22:00:09 +0100
2787Date:Mon, 29 Jul 2002 22:00:04 +0100
2788From:Alice  <alice@wonder.land>
2789Message-Id:<200207292200.3304@wonder.land>
2790To:March Hare  <hare@wonder.land>
2791Subject:Re: Invitation
2792Return-Path:alice@wonder.land
2793X-Envelope-Date:Mon Jul 29 21:00:09 2002
2794X-Envelope-Sender:alice@wonder.land
2795
27966 body_text: Then it wasn't very civil of you to offer it
2797
2798" | \
2799  $at_diff - "$at_stdout" || at_failed=:
2800at_fn_check_status 0 $at_status "$at_srcdir/append.at:42"
2801$at_failed && at_fn_log_failure
2802$at_traceon; }
2803
2804{ set +x
2805$as_echo "$at_srcdir/append.at:65:
2806mbop -m inbox uidvalidity
2807"
2808at_fn_check_prepare_notrace 'an embedded newline' "append.at:65"
2809( $at_check_trace;
2810mbop -m inbox uidvalidity
2811
2812) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2813at_status=$? at_failed=false
2814$at_check_filter
2815at_fn_diff_devnull "$at_stderr" || at_failed=:
2816echo >>"$at_stdout"; $as_echo "uidvalidity: 10
2817" | \
2818  $at_diff - "$at_stdout" || at_failed=:
2819at_fn_check_status 0 $at_status "$at_srcdir/append.at:65"
2820$at_failed && at_fn_log_failure
2821$at_traceon; }
2822
2823  set +x
2824  $at_times_p && times >"$at_times_file"
2825) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2826read at_status <"$at_status_file"
2827#AT_STOP_11
2828#AT_START_12
2829at_fn_group_banner 12 'notify.at:17' \
2830  "append notification" "                            "
2831at_xfail=no
2832(
2833  $as_echo "12. $at_setup_line: testing $at_desc ..."
2834  $at_traceon
2835
2836{ set +x
2837$as_echo "$at_srcdir/notify.at:18: mbox2dir -p -v 10 -u inbox \$spooldir/mbox1"
2838at_fn_check_prepare_dynamic "mbox2dir -p -v 10 -u inbox $spooldir/mbox1" "notify.at:18"
2839( $at_check_trace; mbox2dir -p -v 10 -u inbox $spooldir/mbox1
2840) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2841at_status=$? at_failed=false
2842$at_check_filter
2843at_fn_diff_devnull "$at_stderr" || at_failed=:
2844at_fn_diff_devnull "$at_stdout" || at_failed=:
2845at_fn_check_status 0 $at_status "$at_srcdir/notify.at:18"
2846$at_failed && at_fn_log_failure
2847$at_traceon; }
2848
2849cat >msg <<'_ATEOF'
2850Received: (from alice@wonder.land)
2851	by wonder.land id 3304
2852	for hare@wonder.land; Mon, 29 Jul 2002 22:00:09 +0100
2853Date: Mon, 29 Jul 2002 22:00:04 +0100
2854From: Alice  <alice@wonder.land>
2855Message-Id: <200207292200.3304@wonder.land>
2856To: March Hare  <hare@wonder.land>
2857Subject: Re: Invitation
2858Return-Path: alice@wonder.land
2859
2860Then it wasn't very civil of you to offer it
2861_ATEOF
2862
2863{ set +x
2864$as_echo "$at_srcdir/notify.at:32:
2865mbop -m inbox --notify append msg
2866"
2867at_fn_check_prepare_notrace 'an embedded newline' "notify.at:32"
2868( $at_check_trace;
2869mbop -m inbox --notify append msg
2870
2871) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2872at_status=$? at_failed=false
2873$at_check_filter
2874echo >>"$at_stderr"; $as_echo "mbop: new message: Alice  <alice@wonder.land> Re: Invitation
2875" | \
2876  $at_diff - "$at_stderr" || at_failed=:
2877echo >>"$at_stdout"; $as_echo "append: OK
2878" | \
2879  $at_diff - "$at_stdout" || at_failed=:
2880at_fn_check_status 0 $at_status "$at_srcdir/notify.at:32"
2881$at_failed && at_fn_log_failure
2882$at_traceon; }
2883
2884  set +x
2885  $at_times_p && times >"$at_times_file"
2886) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2887read at_status <"$at_status_file"
2888#AT_STOP_12
2889#AT_START_13
2890at_fn_group_banner 13 'delete.at:17' \
2891  "delete" "                                         "
2892at_xfail=no
2893(
2894  $as_echo "13. $at_setup_line: testing $at_desc ..."
2895  $at_traceon
2896
2897{ set +x
2898$as_echo "$at_srcdir/delete.at:18: mbox2dir -p -v 10 -u inbox \$spooldir/mbox1"
2899at_fn_check_prepare_dynamic "mbox2dir -p -v 10 -u inbox $spooldir/mbox1" "delete.at:18"
2900( $at_check_trace; mbox2dir -p -v 10 -u inbox $spooldir/mbox1
2901) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2902at_status=$? at_failed=false
2903$at_check_filter
2904at_fn_diff_devnull "$at_stderr" || at_failed=:
2905at_fn_diff_devnull "$at_stdout" || at_failed=:
2906at_fn_check_status 0 $at_status "$at_srcdir/delete.at:18"
2907$at_failed && at_fn_log_failure
2908$at_traceon; }
2909
2910cat >commands <<'_ATEOF'
29113
2912set_deleted
2913expunge
2914# Message 4 becomes 3 after expunge. Re-select it.
29153
2916uid
2917headers
2918_ATEOF
2919
2920{ set +x
2921$as_echo "$at_srcdir/delete.at:28:
2922mbop -m inbox < commands
2923"
2924at_fn_check_prepare_notrace 'an embedded newline' "delete.at:28"
2925( $at_check_trace;
2926mbop -m inbox < commands
2927
2928) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2929at_status=$? at_failed=false
2930$at_check_filter
2931at_fn_diff_devnull "$at_stderr" || at_failed=:
2932echo >>"$at_stdout"; $as_echo "3 current message
29333 set_deleted: OK
2934expunge: OK
29353 current message
29363 uid: 4
29373 headers: Organization:Mailutils-tests
2938Received:from example.net (localhost [127.0.0.1]) by example.net with ESMTP id g6CLowb05126 for <gray@example.net>; Sat, 13 Jul 2002 00:50:58 +0300
2939Message-Id:<200207122150.g6CLowb05126@example.net>
2940To:Foo Bar <foobar@nonexistent.net>
2941Subject:Nested MIME
2942MIME-Version:1.0
2943Content-Type:multipart/mixed; boundary=\"----- =_aaaaaaaaaa0\"
2944Content-ID:<5122.1026510654.1@example.net>
2945Date:Sat, 13 Jul 2002 00:50:58 +0300
2946From:Sergey Poznyakoff <gray@example.net>
2947
2948" | \
2949  $at_diff - "$at_stdout" || at_failed=:
2950at_fn_check_status 0 $at_status "$at_srcdir/delete.at:28"
2951$at_failed && at_fn_log_failure
2952$at_traceon; }
2953
2954  set +x
2955  $at_times_p && times >"$at_times_file"
2956) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2957read at_status <"$at_status_file"
2958#AT_STOP_13
2959#AT_START_14
2960at_fn_group_banner 14 'uidnext.at:17' \
2961  "UID monotonicity" "                               "
2962at_xfail=no
2963(
2964  $as_echo "14. $at_setup_line: testing $at_desc ..."
2965  $at_traceon
2966
2967cat >names <<'_ATEOF'
2968cur/1284628225.M17468P3883Q0.Trurl,u=1:2,
2969cur/1284628225.M19181P3883Q1.Trurl,u=20:2,S
2970cur/1284628225.M20118P3883Q2.Trurl,u=22:2,
2971cur/1284628225.M21284P3883Q3.Trurl,u=43:2,
2972cur/1284628225.M22502P3883Q4.Trurl,u=50:2,
2973_ATEOF
2974
2975{ set +x
2976$as_echo "$at_srcdir/uidnext.at:25: mbox2dir -i names -p -v 10 -u inbox \$spooldir/mbox1"
2977at_fn_check_prepare_dynamic "mbox2dir -i names -p -v 10 -u inbox $spooldir/mbox1" "uidnext.at:25"
2978( $at_check_trace; mbox2dir -i names -p -v 10 -u inbox $spooldir/mbox1
2979) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2980at_status=$? at_failed=false
2981$at_check_filter
2982at_fn_diff_devnull "$at_stderr" || at_failed=:
2983at_fn_diff_devnull "$at_stdout" || at_failed=:
2984at_fn_check_status 0 $at_status "$at_srcdir/uidnext.at:25"
2985$at_failed && at_fn_log_failure
2986$at_traceon; }
2987
2988
2989{ set +x
2990$as_echo "$at_srcdir/uidnext.at:27: mbop -m inbox uidnext \\; uidvalidity"
2991at_fn_check_prepare_trace "uidnext.at:27"
2992( $at_check_trace; mbop -m inbox uidnext \; uidvalidity
2993) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2994at_status=$? at_failed=false
2995$at_check_filter
2996at_fn_diff_devnull "$at_stderr" || at_failed=:
2997echo >>"$at_stdout"; $as_echo "uidnext: 51
2998uidvalidity: 10
2999" | \
3000  $at_diff - "$at_stdout" || at_failed=:
3001at_fn_check_status 0 $at_status "$at_srcdir/uidnext.at:27"
3002$at_failed && at_fn_log_failure
3003$at_traceon; }
3004
3005
3006{ set +x
3007$as_echo "$at_srcdir/uidnext.at:33: mbop -m inbox 5 \\; set_deleted \\; expunge"
3008at_fn_check_prepare_trace "uidnext.at:33"
3009( $at_check_trace; mbop -m inbox 5 \; set_deleted \; expunge
3010) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3011at_status=$? at_failed=false
3012$at_check_filter
3013at_fn_diff_devnull "$at_stderr" || at_failed=:
3014echo >>"$at_stdout"; $as_echo "5 current message
30155 set_deleted: OK
3016expunge: OK
3017" | \
3018  $at_diff - "$at_stdout" || at_failed=:
3019at_fn_check_status 0 $at_status "$at_srcdir/uidnext.at:33"
3020$at_failed && at_fn_log_failure
3021$at_traceon; }
3022
3023
3024{ set +x
3025$as_echo "$at_srcdir/uidnext.at:40: mbop -m inbox uidnext \\; uidvalidity"
3026at_fn_check_prepare_trace "uidnext.at:40"
3027( $at_check_trace; mbop -m inbox uidnext \; uidvalidity
3028) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3029at_status=$? at_failed=false
3030$at_check_filter
3031at_fn_diff_devnull "$at_stderr" || at_failed=:
3032echo >>"$at_stdout"; $as_echo "uidnext: 51
3033uidvalidity: 10
3034" | \
3035  $at_diff - "$at_stdout" || at_failed=:
3036at_fn_check_status 0 $at_status "$at_srcdir/uidnext.at:40"
3037$at_failed && at_fn_log_failure
3038$at_traceon; }
3039
3040
3041cat >msg <<'_ATEOF'
3042Received: (from alice@wonder.land)
3043	by wonder.land id 3304
3044	for hare@wonder.land; Mon, 29 Jul 2002 22:00:09 +0100
3045Date: Mon, 29 Jul 2002 22:00:04 +0100
3046From: Alice  <alice@wonder.land>
3047Message-Id: <200207292200.3304@wonder.land>
3048To: March Hare  <hare@wonder.land>
3049Subject: Re: Invitation
3050Return-Path: alice@wonder.land
3051
3052Then it wasn't very civil of you to offer it
3053_ATEOF
3054
3055
3056{ set +x
3057$as_echo "$at_srcdir/uidnext.at:60: mbop -m inbox append msg \\; count \\; 5 \\; uid \\; uidnext"
3058at_fn_check_prepare_trace "uidnext.at:60"
3059( $at_check_trace; mbop -m inbox append msg \; count \; 5 \; uid \; uidnext
3060) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3061at_status=$? at_failed=false
3062$at_check_filter
3063at_fn_diff_devnull "$at_stderr" || at_failed=:
3064echo >>"$at_stdout"; $as_echo "append: OK
3065count: 5
30665 current message
30675 uid: 51
3068uidnext: 52
3069" | \
3070  $at_diff - "$at_stdout" || at_failed=:
3071at_fn_check_status 0 $at_status "$at_srcdir/uidnext.at:60"
3072$at_failed && at_fn_log_failure
3073$at_traceon; }
3074
3075
3076{ set +x
3077$as_echo "$at_srcdir/uidnext.at:69: mbop -m inbox uidnext \\; uidvalidity"
3078at_fn_check_prepare_trace "uidnext.at:69"
3079( $at_check_trace; mbop -m inbox uidnext \; uidvalidity
3080) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3081at_status=$? at_failed=false
3082$at_check_filter
3083at_fn_diff_devnull "$at_stderr" || at_failed=:
3084echo >>"$at_stdout"; $as_echo "uidnext: 52
3085uidvalidity: 10
3086" | \
3087  $at_diff - "$at_stdout" || at_failed=:
3088at_fn_check_status 0 $at_status "$at_srcdir/uidnext.at:69"
3089$at_failed && at_fn_log_failure
3090$at_traceon; }
3091
3092
3093  set +x
3094  $at_times_p && times >"$at_times_file"
3095) 5>&1 2>&1 7>&- | eval $at_tee_pipe
3096read at_status <"$at_status_file"
3097#AT_STOP_14
3098#AT_START_15
3099at_fn_group_banner 15 'attfixup.at:1' \
3100  "attribute fixup" "                                "
3101at_xfail=no
3102(
3103  $as_echo "15. $at_setup_line: testing $at_desc ..."
3104  $at_traceon
3105
3106
3107cat >names <<'_ATEOF'
3108cur/1284628225.M17468P3883Q0.Trurl:2,S
3109cur/1284628225.M19181P3883Q1.Trurl:2,RS
3110cur/1284628225.M20118P3883Q2.Trurl:2,S
3111cur/1284628225.M21284P3883Q3.Trurl:2,S
3112cur/1284628225.M22502P3883Q4.Trurl:2,S
3113_ATEOF
3114
3115
3116{ set +x
3117$as_echo "$at_srcdir/attfixup.at:11: mbox2dir -i names inbox \$spooldir/mbox1"
3118at_fn_check_prepare_dynamic "mbox2dir -i names inbox $spooldir/mbox1" "attfixup.at:11"
3119( $at_check_trace; mbox2dir -i names inbox $spooldir/mbox1
3120) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3121at_status=$? at_failed=false
3122$at_check_filter
3123at_fn_diff_devnull "$at_stderr" || at_failed=:
3124at_fn_diff_devnull "$at_stdout" || at_failed=:
3125at_fn_check_status 0 $at_status "$at_srcdir/attfixup.at:11"
3126$at_failed && at_fn_log_failure
3127$at_traceon; }
3128
3129
3130{ set +x
3131$as_echo "$at_srcdir/attfixup.at:13:
3132cat >inbox/.mu-prop <<'_ATEOF'
3133uid-validity: 10
3134_ATEOF
3135
3136mbop -m inbox count
3137find inbox/cur -type f | sort
3138cp inbox/.mu-prop saved_mu_prop
3139"
3140at_fn_check_prepare_notrace 'an embedded newline' "attfixup.at:13"
3141( $at_check_trace;
3142cat >inbox/.mu-prop <<'_ATEOF'
3143uid-validity: 10
3144_ATEOF
3145
3146mbop -m inbox count
3147find inbox/cur -type f | sort
3148cp inbox/.mu-prop saved_mu_prop
3149
3150) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3151at_status=$? at_failed=false
3152$at_check_filter
3153at_fn_diff_devnull "$at_stderr" || at_failed=:
3154echo >>"$at_stdout"; $as_echo "count: 5
3155inbox/cur/1284628225.M17468P3883Q0.Trurl,a=O,u=1:2,
3156inbox/cur/1284628225.M19181P3883Q1.Trurl,a=O,u=2:2,S
3157inbox/cur/1284628225.M20118P3883Q2.Trurl,a=O,u=3:2,
3158inbox/cur/1284628225.M21284P3883Q3.Trurl,a=O,u=4:2,
3159inbox/cur/1284628225.M22502P3883Q4.Trurl,a=O,u=5:2,
3160" | \
3161  $at_diff - "$at_stdout" || at_failed=:
3162at_fn_check_status 0 $at_status "$at_srcdir/attfixup.at:13"
3163$at_failed && at_fn_log_failure
3164$at_traceon; }
3165
3166
3167{ set +x
3168$as_echo "$at_srcdir/attfixup.at:30:
3169mbop -m inbox count
3170"
3171at_fn_check_prepare_notrace 'an embedded newline' "attfixup.at:30"
3172( $at_check_trace;
3173mbop -m inbox count
3174
3175) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3176at_status=$? at_failed=false
3177$at_check_filter
3178at_fn_diff_devnull "$at_stderr" || at_failed=:
3179echo >>"$at_stdout"; $as_echo "count: 5
3180" | \
3181  $at_diff - "$at_stdout" || at_failed=:
3182at_fn_check_status 0 $at_status "$at_srcdir/attfixup.at:30"
3183$at_failed && at_fn_log_failure
3184$at_traceon; }
3185
3186
3187{ set +x
3188$as_echo "$at_srcdir/attfixup.at:37:
3189cp saved_mu_prop expout
3190cat inbox/.mu-prop
3191"
3192at_fn_check_prepare_notrace 'an embedded newline' "attfixup.at:37"
3193( $at_check_trace;
3194cp saved_mu_prop expout
3195cat inbox/.mu-prop
3196
3197) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3198at_status=$? at_failed=false
3199$at_check_filter
3200at_fn_diff_devnull "$at_stderr" || at_failed=:
3201$at_diff expout "$at_stdout" || at_failed=:
3202at_fn_check_status 0 $at_status "$at_srcdir/attfixup.at:37"
3203$at_failed && at_fn_log_failure
3204$at_traceon; }
3205
3206
3207  set +x
3208  $at_times_p && times >"$at_times_file"
3209) 5>&1 2>&1 7>&- | eval $at_tee_pipe
3210read at_status <"$at_status_file"
3211#AT_STOP_15
3212#AT_START_16
3213at_fn_group_banner 16 'uidfixup.at:1' \
3214  "uid fixup" "                                      "
3215at_xfail=no
3216(
3217  $as_echo "16. $at_setup_line: testing $at_desc ..."
3218  $at_traceon
3219
3220cat >names <<'_ATEOF'
3221cur/1284628225.M17468P3883Q0.Trurl:2,
3222cur/1284628225.M19181P3883Q1.Trurl:2,S
3223cur/1284628225.M20118P3883Q2.Trurl:2,
3224cur/1284628225.M21284P3883Q3.Trurl:2,
3225cur/1284628225.M22502P3883Q4.Trurl:2,
3226_ATEOF
3227
3228
3229{ set +x
3230$as_echo "$at_srcdir/uidfixup.at:10: mbox2dir -i names -p -v 10 inbox \$spooldir/mbox1"
3231at_fn_check_prepare_dynamic "mbox2dir -i names -p -v 10 inbox $spooldir/mbox1" "uidfixup.at:10"
3232( $at_check_trace; mbox2dir -i names -p -v 10 inbox $spooldir/mbox1
3233) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3234at_status=$? at_failed=false
3235$at_check_filter
3236at_fn_diff_devnull "$at_stderr" || at_failed=:
3237at_fn_diff_devnull "$at_stdout" || at_failed=:
3238at_fn_check_status 0 $at_status "$at_srcdir/uidfixup.at:10"
3239$at_failed && at_fn_log_failure
3240$at_traceon; }
3241
3242
3243{ set +x
3244$as_echo "$at_srcdir/uidfixup.at:12:
3245mbop -m inbox count
3246
3247find inbox/cur -type f | sort
3248
3249# The following pipeline returns 0 if UID fixup has updated the uidvalidity
3250# value:
3251sed -e 's/ *//' inbox/.mu-prop | grep -v '^uid-validity:10\$' | grep uid-validity >/dev/null
3252"
3253at_fn_check_prepare_notrace 'an embedded newline' "uidfixup.at:12"
3254( $at_check_trace;
3255mbop -m inbox count
3256
3257find inbox/cur -type f | sort
3258
3259# The following pipeline returns 0 if UID fixup has updated the uidvalidity
3260# value:
3261sed -e 's/ *//' inbox/.mu-prop | grep -v '^uid-validity:10$' | grep uid-validity >/dev/null
3262
3263) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3264at_status=$? at_failed=false
3265$at_check_filter
3266at_fn_diff_devnull "$at_stderr" || at_failed=:
3267echo >>"$at_stdout"; $as_echo "count: 5
3268inbox/cur/1284628225.M17468P3883Q0.Trurl,u=1:2,
3269inbox/cur/1284628225.M19181P3883Q1.Trurl,u=2:2,S
3270inbox/cur/1284628225.M20118P3883Q2.Trurl,u=3:2,
3271inbox/cur/1284628225.M21284P3883Q3.Trurl,u=4:2,
3272inbox/cur/1284628225.M22502P3883Q4.Trurl,u=5:2,
3273" | \
3274  $at_diff - "$at_stdout" || at_failed=:
3275at_fn_check_status 0 $at_status "$at_srcdir/uidfixup.at:12"
3276$at_failed && at_fn_log_failure
3277$at_traceon; }
3278
3279
3280  set +x
3281  $at_times_p && times >"$at_times_file"
3282) 5>&1 2>&1 7>&- | eval $at_tee_pipe
3283read at_status <"$at_status_file"
3284#AT_STOP_16
3285