Debian Codegraph @

libproto/mh/tests/testsuite

raw
1 #! /bin/sh
2 # Generated from testsuite.at by GNU Autoconf 2.71.
3 #
4 # Copyright (C) 2009-2017, 2020-2021 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
13 DUALCASE=1; export DUALCASE # for MKS sh
14 as_nop=:
15 if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
16 then :
17 emulate sh
18 NULLCMD=:
19 # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
20 # is contrary to our usage. Disable this feature.
21 alias -g '${1+"$@"}'='"$@"'
22 setopt NO_GLOB_SUBST
23 else $as_nop
24 case `(set -o) 2>/dev/null` in #(
25 *posix*) :
26 set -o posix ;; #(
27 *) :
28 ;;
29 esac
30 fi
31
32
33
34 # Reset variables that may have inherited troublesome values from
35 # the environment.
36
37 # IFS needs to be set, to space, tab, and newline, in precisely that order.
38 # (If _AS_PATH_WALK were called with IFS unset, it would have the
39 # side effect of setting IFS to empty, thus disabling word splitting.)
40 # Quoting is to prevent editors from complaining about space-tab.
41 as_nl='
42 '
43 export as_nl
44 IFS=" "" $as_nl"
45
46 PS1='$ '
47 PS2='> '
48 PS4='+ '
49
50 # Ensure predictable behavior from utilities with locale-dependent output.
51 LC_ALL=C
52 export LC_ALL
53 LANGUAGE=C
54 export LANGUAGE
55
56 # We cannot yet rely on "unset" to work, but we need these variables
57 # to be unset--not just set to an empty or harmless value--now, to
58 # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct
59 # also avoids known problems related to "unset" and subshell syntax
60 # in other old shells (e.g. bash 2.01 and pdksh 5.2.14).
61 for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH
62 do eval test \${$as_var+y} \
63 && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
64 done
65
66 # Ensure that fds 0, 1, and 2 are open.
67 if (exec 3>&0) 2>/dev/null; then :; else exec 0</dev/null; fi
68 if (exec 3>&1) 2>/dev/null; then :; else exec 1>/dev/null; fi
69 if (exec 3>&2) ; then :; else exec 2>/dev/null; fi
70
71 # The user is always right.
72 if ${PATH_SEPARATOR+false} :; then
73 PATH_SEPARATOR=:
74 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
75 (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
76 PATH_SEPARATOR=';'
77 }
78 fi
79
80
81 # Find who we are. Look in the path if we contain no directory separator.
82 as_myself=
83 case $0 in #((
84 *[\\/]* ) as_myself=$0 ;;
85 *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
86 for as_dir in $PATH
87 do
88 IFS=$as_save_IFS
89 case $as_dir in #(((
90 '') as_dir=./ ;;
91 */) ;;
92 *) as_dir=$as_dir/ ;;
93 esac
94 test -r "$as_dir$0" && as_myself=$as_dir$0 && break
95 done
96 IFS=$as_save_IFS
97
98 ;;
99 esac
100 # We did not find ourselves, most probably we were run as `sh COMMAND'
101 # in which case we are not to be found in the path.
102 if test "x$as_myself" = x; then
103 as_myself=$0
104 fi
105 if test ! -f "$as_myself"; then
106 printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
107 exit 1
108 fi
109
110
111 if test "x$CONFIG_SHELL" = x; then
112 as_bourne_compatible="as_nop=:
113 if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
114 then :
115 emulate sh
116 NULLCMD=:
117 # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
118 # is contrary to our usage. Disable this feature.
119 alias -g '\${1+\"\$@\"}'='\"\$@\"'
120 setopt NO_GLOB_SUBST
121 else \$as_nop
122 case \`(set -o) 2>/dev/null\` in #(
123 *posix*) :
124 set -o posix ;; #(
125 *) :
126 ;;
127 esac
128 fi
129 "
130 as_required="as_fn_return () { (exit \$1); }
131 as_fn_success () { as_fn_return 0; }
132 as_fn_failure () { as_fn_return 1; }
133 as_fn_ret_success () { return 0; }
134 as_fn_ret_failure () { return 1; }
135
136 exitcode=0
137 as_fn_success || { exitcode=1; echo as_fn_success failed.; }
138 as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
139 as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
140 as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
141 if ( set x; as_fn_ret_success y && test x = \"\$1\" )
142 then :
143
144 else \$as_nop
145 exitcode=1; echo positional parameters were not saved.
146 fi
147 test x\$exitcode = x0 || exit 1
148 blah=\$(echo \$(echo blah))
149 test x\"\$blah\" = xblah || exit 1
150 test -x / || exit 1"
151 as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
152 as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
153 eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
154 test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
155 test \$(( 1 + 1 )) = 2 || exit 1"
156 if (eval "$as_required") 2>/dev/null
157 then :
158 as_have_required=yes
159 else $as_nop
160 as_have_required=no
161 fi
162 if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null
163 then :
164
165 else $as_nop
166 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
167 as_found=false
168 for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
169 do
170 IFS=$as_save_IFS
171 case $as_dir in #(((
172 '') as_dir=./ ;;
173 */) ;;
174 *) as_dir=$as_dir/ ;;
175 esac
176 as_found=:
177 case $as_dir in #(
178 /*)
179 for as_base in sh bash ksh sh5; do
180 # Try only shells that exist, to save several forks.
181 as_shell=$as_dir$as_base
182 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
183 as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null
184 then :
185 CONFIG_SHELL=$as_shell as_have_required=yes
186 if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null
187 then :
188 break 2
189 fi
190 fi
191 done;;
192 esac
193 as_found=false
194 done
195 IFS=$as_save_IFS
196 if $as_found
197 then :
198
199 else $as_nop
200 if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
201 as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null
202 then :
203 CONFIG_SHELL=$SHELL as_have_required=yes
204 fi
205 fi
206
207
208 if test "x$CONFIG_SHELL" != x
209 then :
210 export CONFIG_SHELL
211 # We cannot yet assume a decent shell, so we have to provide a
212 # neutralization value for shells without unset; and this also
213 # works around shells that cannot unset nonexistent variables.
214 # Preserve -v and -x to the replacement shell.
215 BASH_ENV=/dev/null
216 ENV=/dev/null
217 (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
218 case $- in # ((((
219 *v*x* | *x*v* ) as_opts=-vx ;;
220 *v* ) as_opts=-v ;;
221 *x* ) as_opts=-x ;;
222 * ) as_opts= ;;
223 esac
224 exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
225 # Admittedly, this is quite paranoid, since all the known shells bail
226 # out after a failed `exec'.
227 printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2
228 exit 255
229 fi
230
231 if test x$as_have_required = xno
232 then :
233 printf "%s\n" "$0: This script requires a shell more modern than all"
234 printf "%s\n" "$0: the shells that I found on your system."
235 if test ${ZSH_VERSION+y} ; then
236 printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should"
237 printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later."
238 else
239 printf "%s\n" "$0: Please tell [email protected] 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
245 fi
246 fi
247 fi
248 SHELL=${CONFIG_SHELL-/bin/sh}
249 export SHELL
250 # Unset more variables known to interfere with behavior of common tools.
251 CLICOLOR_FORCE= GREP_OPTIONS=
252 unset CLICOLOR_FORCE GREP_OPTIONS
253
254 ## --------------------- ##
255 ## M4sh Shell Functions. ##
256 ## --------------------- ##
257 # as_fn_unset VAR
258 # ---------------
259 # Portably unset VAR.
260 as_fn_unset ()
261 {
262 { eval $1=; unset $1;}
263 }
264 as_unset=as_fn_unset
265
266
267 # as_fn_set_status STATUS
268 # -----------------------
269 # Set $? to STATUS, without forking.
270 as_fn_set_status ()
271 {
272 return $1
273 } # as_fn_set_status
274
275 # as_fn_exit STATUS
276 # -----------------
277 # Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
278 as_fn_exit ()
279 {
280 set +e
281 as_fn_set_status $1
282 exit $1
283 } # as_fn_exit
284 # as_fn_nop
285 # ---------
286 # Do nothing but, unlike ":", preserve the value of $?.
287 as_fn_nop ()
288 {
289 return $?
290 }
291 as_nop=as_fn_nop
292
293 # as_fn_mkdir_p
294 # -------------
295 # Create "$as_dir" as a directory, including parents if necessary.
296 as_fn_mkdir_p ()
297 {
298
299 case $as_dir in #(
300 -*) as_dir=./$as_dir;;
301 esac
302 test -d "$as_dir" || eval $as_mkdir_p || {
303 as_dirs=
304 while :; do
305 case $as_dir in #(
306 *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
307 *) as_qdir=$as_dir;;
308 esac
309 as_dirs="'$as_qdir' $as_dirs"
310 as_dir=`$as_dirname -- "$as_dir" ||
311 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
312 X"$as_dir" : 'X\(//\)[^/]' \| \
313 X"$as_dir" : 'X\(//\)$' \| \
314 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
315 printf "%s\n" X"$as_dir" |
316 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
317 s//\1/
318 q
319 }
320 /^X\(\/\/\)[^/].*/{
321 s//\1/
322 q
323 }
324 /^X\(\/\/\)$/{
325 s//\1/
326 q
327 }
328 /^X\(\/\).*/{
329 s//\1/
330 q
331 }
332 s/.*/./; q'`
333 test -d "$as_dir" && break
334 done
335 test -z "$as_dirs" || eval "mkdir $as_dirs"
336 } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
337
338
339 } # as_fn_mkdir_p
340
341 # as_fn_executable_p FILE
342 # -----------------------
343 # Test if FILE is an executable regular file.
344 as_fn_executable_p ()
345 {
346 test -f "$1" && test -x "$1"
347 } # as_fn_executable_p
348 # as_fn_append VAR VALUE
349 # ----------------------
350 # Append the text in VALUE to the end of the definition contained in VAR. Take
351 # advantage of any shell optimizations that allow amortized linear growth over
352 # repeated appends, instead of the typical quadratic growth present in naive
353 # implementations.
354 if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null
355 then :
356 eval 'as_fn_append ()
357 {
358 eval $1+=\$2
359 }'
360 else $as_nop
361 as_fn_append ()
362 {
363 eval $1=\$$1\$2
364 }
365 fi # as_fn_append
366
367 # as_fn_arith ARG...
368 # ------------------
369 # Perform arithmetic evaluation on the ARGs, and store the result in the
370 # global $as_val. Take advantage of shells that can avoid forks. The arguments
371 # must be portable across $(()) and expr.
372 if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null
373 then :
374 eval 'as_fn_arith ()
375 {
376 as_val=$(( $* ))
377 }'
378 else $as_nop
379 as_fn_arith ()
380 {
381 as_val=`expr "$@" || test $? -eq 1`
382 }
383 fi # as_fn_arith
384
385
386 # as_fn_error STATUS ERROR [LINENO LOG_FD]
387 # ----------------------------------------
388 # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
389 # provided, also output the error to LOG_FD, referencing LINENO. Then exit the
390 # script with STATUS, using 1 if that was 0.
391 as_fn_error ()
392 {
393 as_status=$1; test $as_status -eq 0 && as_status=1
394 if test "$4"; then
395 as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
396 printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
397 fi
398 printf "%s\n" "$as_me: error: $2" >&2
399 as_fn_exit $as_status
400 } # as_fn_error
401
402 if expr a : '\(a\)' >/dev/null 2>&1 &&
403 test "X`expr 00001 : '.*\(...\)'`" = X001; then
404 as_expr=expr
405 else
406 as_expr=false
407 fi
408
409 if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
410 as_basename=basename
411 else
412 as_basename=false
413 fi
414
415 as_me=`$as_basename -- "$0" ||
416 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
417 X"$0" : 'X\(//\)$' \| \
418 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
419 printf "%s\n" X/"$0" |
420 sed '/^.*\/\([^/][^/]*\)\/*$/{
421 s//\1/
422 q
423 }
424 /^X\/\(\/\/\)$/{
425 s//\1/
426 q
427 }
428 /^X\/\(\/\).*/{
429 s//\1/
430 q
431 }
432 s/.*/./; q'`
433
434 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
435 as_dirname=dirname
436 else
437 as_dirname=false
438 fi
439
440 # Avoid depending upon Character Ranges.
441 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
442 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
443 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
444 as_cr_digits='0123456789'
445 as_cr_alnum=$as_cr_Letters$as_cr_digits
446
447
448 as_lineno_1=$LINENO as_lineno_1a=$LINENO
449 as_lineno_2=$LINENO as_lineno_2a=$LINENO
450 eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
451 test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
452 # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
453 sed -n '
454 p
455 /[$]LINENO/=
456 ' <$as_myself |
457 sed '
458 s/[$]LINENO.*/&-/
459 t lineno
460 b
461 :lineno
462 N
463 :loop
464 s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
465 t loop
466 s/-\n.*//
467 ' >$as_me.lineno &&
468 chmod +x "$as_me.lineno" ||
469 { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
470
471 # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
472 # already done that, so ensure we don't try to do so again and fall
473 # in an infinite loop. This has already happened in practice.
474 _as_can_reexec=no; export _as_can_reexec
475 # Don't try to exec as it changes $[0], causing all sort of problems
476 # (the dirname of $[0] is not the place where we might find the
477 # original and so on. Autoconf is especially sensitive to this).
478 . "./$as_me.lineno"
479 # Exit status is that of the last command.
480 exit
481 }
482
483
484 # Determine whether it's possible to make 'echo' print without a newline.
485 # These variables are no longer used directly by Autoconf, but are AC_SUBSTed
486 # for compatibility with existing Makefiles.
487 ECHO_C= ECHO_N= ECHO_T=
488 case `echo -n x` in #(((((
489 -n*)
490 case `echo 'xy\c'` in
491 *c*) ECHO_T=' ';; # ECHO_T is single tab character.
492 xy) ECHO_C='\c';;
493 *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
494 ECHO_T=' ';;
495 esac;;
496 *)
497 ECHO_N='-n';;
498 esac
499
500 # For backward compatibility with old third-party macros, we provide
501 # the shell variables $as_echo and $as_echo_n. New code should use
502 # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively.
503 as_echo='printf %s\n'
504 as_echo_n='printf %s'
505
506
507 rm -f conf$$ conf$$.exe conf$$.file
508 if test -d conf$$.dir; then
509 rm -f conf$$.dir/conf$$.file
510 else
511 rm -f conf$$.dir
512 mkdir conf$$.dir 2>/dev/null
513 fi
514 if (echo >conf$$.file) 2>/dev/null; then
515 if ln -s conf$$.file conf$$ 2>/dev/null; then
516 as_ln_s='ln -s'
517 # ... but there are two gotchas:
518 # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
519 # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
520 # In both cases, we have to default to `cp -pR'.
521 ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
522 as_ln_s='cp -pR'
523 elif ln conf$$.file conf$$ 2>/dev/null; then
524 as_ln_s=ln
525 else
526 as_ln_s='cp -pR'
527 fi
528 else
529 as_ln_s='cp -pR'
530 fi
531 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
532 rmdir conf$$.dir 2>/dev/null
533
534 if mkdir -p . 2>/dev/null; then
535 as_mkdir_p='mkdir -p "$as_dir"'
536 else
537 test -d ./-p && rmdir ./-p
538 as_mkdir_p=false
539 fi
540
541 as_test_x='test -x'
542 as_executable_p=as_fn_executable_p
543
544 # Sed expression to map a string onto a valid CPP name.
545 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
546
547 # Sed expression to map a string onto a valid variable name.
548 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
549
550
551
552
553
554 SHELL=${CONFIG_SHELL-/bin/sh}
555
556 # How were we run?
557 at_cli_args="$@"
558
559
560 # Not all shells have the 'times' builtin; the subshell is needed to make
561 # sure we discard the 'times: not found' message from the shell.
562 at_times_p=false
563 (times) >/dev/null 2>&1 && at_times_p=:
564
565 # CLI Arguments to pass to the debugging scripts.
566 at_debug_args=
567 # -e sets to true
568 at_errexit_p=false
569 # Shall we be verbose? ':' means no, empty means yes.
570 at_verbose=:
571 at_quiet=
572 # Running several jobs in parallel, 0 means as many as test groups.
573 at_jobs=1
574 at_traceon=:
575 at_trace_echo=:
576 at_check_filter_trace=:
577
578 # Shall we keep the debug scripts? Must be `:' when the suite is
579 # run by a debug script, so that the script doesn't remove itself.
580 at_debug_p=false
581 # Display help message?
582 at_help_p=false
583 # Display the version message?
584 at_version_p=false
585 # List test groups?
586 at_list_p=false
587 # --clean
588 at_clean=false
589 # Test groups to run
590 at_groups=
591 # Whether to rerun failed tests.
592 at_recheck=
593 # Whether a write failure occurred
594 at_write_fail=0
595
596 # The directory we run the suite in. Default to . if no -C option.
597 at_dir=`pwd`
598 # An absolute reference to this testsuite script.
599 case $as_myself in
600 [\\/]* | ?:[\\/]* ) at_myself=$as_myself ;;
601 * ) at_myself=$at_dir/$as_myself ;;
602 esac
603 # Whether -C is in effect.
604 at_change_dir=false
605
606 # Whether to enable colored test results.
607 at_color=no
608 # As many question marks as there are digits in the last test group number.
609 # Used to normalize the test group numbers so that `ls' lists them in
610 # numerical order.
611 at_format='??'
612 # Description of all the test groups.
613 at_help_all="1;autodetect.at:16;format detection;autodetect;
614 2;count.at:17;message count;;
615 3;attr.at:17;attributes;;
616 4;envelope.at:17;envelope;;
617 5;header.at:17;header;;
618 6;body.at:17;body;;
619 7;uid.at:17;uid;;
620 8;uidvalidity.at:17;uidvalidity;;
621 9;qget.at:17;qget access;;
622 10;append.at:17;append;;
623 11;notify.at:17;append notification;;
624 12;delete.at:17;delete;;
625 13;uidnext.at:17;UID monotonicity;;
626 14;uidvol.at:17;Volatile UIDs (traditional MH behavior);;
627 "
628 # List of the all the test groups.
629 at_groups_all=`printf "%s\n" "$at_help_all" | sed 's/;.*//'`
630
631 # at_fn_validate_ranges NAME...
632 # -----------------------------
633 # Validate and normalize the test group number contained in each variable
634 # NAME. Leading zeroes are treated as decimal.
635 at_fn_validate_ranges ()
636 {
637 for at_grp
638 do
639 eval at_value=\$$at_grp
640 if test $at_value -lt 1 || test $at_value -gt 14; then
641 printf "%s\n" "invalid test group: $at_value" >&2
642 exit 1
643 fi
644 case $at_value in
645 0*) # We want to treat leading 0 as decimal, like expr and test, but
646 # AS_VAR_ARITH treats it as octal if it uses $(( )).
647 # With XSI shells, ${at_value#${at_value%%[1-9]*}} avoids the
648 # expr fork, but it is not worth the effort to determine if the
649 # shell supports XSI when the user can just avoid leading 0.
650 eval $at_grp='`expr $at_value + 0`' ;;
651 esac
652 done
653 }
654
655 at_prev=
656 for at_option
657 do
658 # If the previous option needs an argument, assign it.
659 if test -n "$at_prev"; then
660 at_option=$at_prev=$at_option
661 at_prev=
662 fi
663
664 case $at_option in
665 *=?*) at_optarg=`expr "X$at_option" : '[^=]*=\(.*\)'` ;;
666 *) at_optarg= ;;
667 esac
668
669 case $at_option in
670 --help | -h )
671 at_help_p=:
672 ;;
673
674 --list | -l )
675 at_list_p=:
676 ;;
677
678 --version | -V )
679 at_version_p=:
680 ;;
681
682 --clean | -c )
683 at_clean=:
684 ;;
685
686 --color )
687 at_color=always
688 ;;
689 --color=* )
690 case $at_optarg in
691 no | never | none) at_color=never ;;
692 auto | tty | if-tty) at_color=auto ;;
693 always | yes | force) at_color=always ;;
694 *) at_optname=`echo " $at_option" | sed 's/^ //; s/=.*//'`
695 as_fn_error $? "unrecognized argument to $at_optname: $at_optarg" ;;
696 esac
697 ;;
698
699 --debug | -d )
700 at_debug_p=:
701 ;;
702
703 --errexit | -e )
704 at_debug_p=:
705 at_errexit_p=:
706 ;;
707
708 --verbose | -v )
709 at_verbose=; at_quiet=:
710 ;;
711
712 --trace | -x )
713 at_traceon='set -x'
714 at_trace_echo=echo
715 at_check_filter_trace=at_fn_filter_trace
716 ;;
717
718 [0-9] | [0-9][0-9] | [0-9][0-9][0-9] | [0-9][0-9][0-9][0-9])
719 at_fn_validate_ranges at_option
720 as_fn_append at_groups "$at_option$as_nl"
721 ;;
722
723 # Ranges
724 [0-9]- | [0-9][0-9]- | [0-9][0-9][0-9]- | [0-9][0-9][0-9][0-9]-)
725 at_range_start=`echo $at_option |tr -d X-`
726 at_fn_validate_ranges at_range_start
727 at_range=`printf "%s\n" "$at_groups_all" | \
728 sed -ne '/^'$at_range_start'$/,$p'`
729 as_fn_append at_groups "$at_range$as_nl"
730 ;;
731
732 -[0-9] | -[0-9][0-9] | -[0-9][0-9][0-9] | -[0-9][0-9][0-9][0-9])
733 at_range_end=`echo $at_option |tr -d X-`
734 at_fn_validate_ranges at_range_end
735 at_range=`printf "%s\n" "$at_groups_all" | \
736 sed -ne '1,/^'$at_range_end'$/p'`
737 as_fn_append at_groups "$at_range$as_nl"
738 ;;
739
740 [0-9]-[0-9] | [0-9]-[0-9][0-9] | [0-9]-[0-9][0-9][0-9] | \
741 [0-9]-[0-9][0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9] | \
742 [0-9][0-9]-[0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9][0-9][0-9] | \
743 [0-9][0-9][0-9]-[0-9][0-9][0-9] | \
744 [0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] | \
745 [0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] )
746 at_range_start=`expr $at_option : '\(.*\)-'`
747 at_range_end=`expr $at_option : '.*-\(.*\)'`
748 if test $at_range_start -gt $at_range_end; then
749 at_tmp=$at_range_end
750 at_range_end=$at_range_start
751 at_range_start=$at_tmp
752 fi
753 at_fn_validate_ranges at_range_start at_range_end
754 at_range=`printf "%s\n" "$at_groups_all" | \
755 sed -ne '/^'$at_range_start'$/,/^'$at_range_end'$/p'`
756 as_fn_append at_groups "$at_range$as_nl"
757 ;;
758
759 # Directory selection.
760 --directory | -C )
761 at_prev=--directory
762 ;;
763 --directory=* )
764 at_change_dir=:
765 at_dir=$at_optarg
766 if test x- = "x$at_dir" ; then
767 at_dir=./-
768 fi
769 ;;
770
771 # Parallel execution.
772 --jobs | -j )
773 at_jobs=0
774 ;;
775 --jobs=* | -j[0-9]* )
776 if test -n "$at_optarg"; then
777 at_jobs=$at_optarg
778 else
779 at_jobs=`expr X$at_option : 'X-j\(.*\)'`
780 fi
781 case $at_jobs in *[!0-9]*)
782 at_optname=`echo " $at_option" | sed 's/^ //; s/[0-9=].*//'`
783 as_fn_error $? "non-numeric argument to $at_optname: $at_jobs" ;;
784 esac
785 ;;
786
787 # Keywords.
788 --keywords | -k )
789 at_prev=--keywords
790 ;;
791 --keywords=* )
792 at_groups_selected=$at_help_all
793 at_save_IFS=$IFS
794 IFS=,
795 set X $at_optarg
796 shift
797 IFS=$at_save_IFS
798 for at_keyword
799 do
800 at_invert=
801 case $at_keyword in
802 '!'*)
803 at_invert="-v"
804 at_keyword=`expr "X$at_keyword" : 'X!\(.*\)'`
805 ;;
806 esac
807 # It is on purpose that we match the test group titles too.
808 at_groups_selected=`printf "%s\n" "$at_groups_selected" |
809 grep -i $at_invert "^[1-9][^;]*;.*[; ]$at_keyword[ ;]"`
810 done
811 # Smash the keywords.
812 at_groups_selected=`printf "%s\n" "$at_groups_selected" | sed 's/;.*//'`
813 as_fn_append at_groups "$at_groups_selected$as_nl"
814 ;;
815 --recheck)
816 at_recheck=:
817 ;;
818
819 *=*)
820 at_envvar=`expr "x$at_option" : 'x\([^=]*\)='`
821 # Reject names that are not valid shell variable names.
822 case $at_envvar in
823 '' | [0-9]* | *[!_$as_cr_alnum]* )
824 as_fn_error $? "invalid variable name: \`$at_envvar'" ;;
825 esac
826 at_value=`printf "%s\n" "$at_optarg" | sed "s/'/'\\\\\\\\''/g"`
827 # Export now, but save eval for later and for debug scripts.
828 export $at_envvar
829 as_fn_append at_debug_args " $at_envvar='$at_value'"
830 ;;
831
832 *) printf "%s\n" "$as_me: invalid option: $at_option" >&2
833 printf "%s\n" "Try \`$0 --help' for more information." >&2
834 exit 1
835 ;;
836 esac
837 done
838
839 # Verify our last option didn't require an argument
840 if test -n "$at_prev"
841 then :
842 as_fn_error $? "\`$at_prev' requires an argument"
843 fi
844
845 # The file containing the suite.
846 at_suite_log=$at_dir/$as_me.log
847
848 # Selected test groups.
849 if test -z "$at_groups$at_recheck"; then
850 at_groups=$at_groups_all
851 else
852 if test -n "$at_recheck" && test -r "$at_suite_log"; then
853 at_oldfails=`sed -n '
854 /^Failed tests:$/,/^Skipped tests:$/{
855 s/^[ ]*\([1-9][0-9]*\):.*/\1/p
856 }
857 /^Unexpected passes:$/,/^## Detailed failed tests/{
858 s/^[ ]*\([1-9][0-9]*\):.*/\1/p
859 }
860 /^## Detailed failed tests/q
861 ' "$at_suite_log"`
862 as_fn_append at_groups "$at_oldfails$as_nl"
863 fi
864 # Sort the tests, removing duplicates.
865 at_groups=`printf "%s\n" "$at_groups" | sort -nu | sed '/^$/d'`
866 fi
867
868 if test x"$at_color" = xalways \
869 || { test x"$at_color" = xauto && test -t 1; }; then
870 at_red=`printf '\033[0;31m'`
871 at_grn=`printf '\033[0;32m'`
872 at_lgn=`printf '\033[1;32m'`
873 at_blu=`printf '\033[1;34m'`
874 at_std=`printf '\033[m'`
875 else
876 at_red= at_grn= at_lgn= at_blu= at_std=
877 fi
878
879 # Help message.
880 if $at_help_p; then
881 cat <<_ATEOF || at_write_fail=1
882 Usage: $0 [OPTION]... [VARIABLE=VALUE]... [TESTS]
883
884 Run all the tests, or the selected TESTS, given by numeric ranges, and
885 save a detailed log file. Upon failure, create debugging scripts.
886
887 Do not change environment variables directly. Instead, set them via
888 command line arguments. Set \`AUTOTEST_PATH' to select the executables
889 to exercise. Each relative directory is expanded as build and source
890 directories relative to the top level of this distribution.
891 E.g., from within the build directory /tmp/foo-1.0, invoking this:
892
893 $ $0 AUTOTEST_PATH=bin
894
895 is equivalent to the following, assuming the source directory is /src/foo-1.0:
896
897 PATH=/tmp/foo-1.0/bin:/src/foo-1.0/bin:\$PATH $0
898 _ATEOF
899 cat <<_ATEOF || at_write_fail=1
900
901 Operation modes:
902 -h, --help print the help message, then exit
903 -V, --version print version number, then exit
904 -c, --clean remove all the files this test suite might create and exit
905 -l, --list describes all the tests, or the selected TESTS
906 _ATEOF
907 cat <<_ATEOF || at_write_fail=1
908
909 Execution tuning:
910 -C, --directory=DIR
911 change to directory DIR before starting
912 --color[=never|auto|always]
913 enable colored test results on terminal, or always
914 -j, --jobs[=N]
915 Allow N jobs at once; infinite jobs with no arg (default 1)
916 -k, --keywords=KEYWORDS
917 select the tests matching all the comma-separated KEYWORDS
918 multiple \`-k' accumulate; prefixed \`!' negates a KEYWORD
919 --recheck select all tests that failed or passed unexpectedly last time
920 -e, --errexit abort as soon as a test fails; implies --debug
921 -v, --verbose force more detailed output
922 default for debugging scripts
923 -d, --debug inhibit clean up and top-level logging
924 default for debugging scripts
925 -x, --trace enable tests shell tracing
926 _ATEOF
927 cat <<_ATEOF || at_write_fail=1
928
929 Report bugs to <[email protected]>.
930 General help using GNU software: <https://www.gnu.org/gethelp/>.
931 _ATEOF
932 exit $at_write_fail
933 fi
934
935 # List of tests.
936 if $at_list_p; then
937 cat <<_ATEOF || at_write_fail=1
938 GNU Mailutils 3.20 test suite test groups:
939
940 NUM: FILE-NAME:LINE TEST-GROUP-NAME
941 KEYWORDS
942
943 _ATEOF
944 # Pass an empty line as separator between selected groups and help.
945 printf "%s\n" "$at_groups$as_nl$as_nl$at_help_all" |
946 awk 'NF == 1 && FS != ";" {
947 selected[$ 1] = 1
948 next
949 }
950 /^$/ { FS = ";" }
951 NF > 0 {
952 if (selected[$ 1]) {
953 printf " %3d: %-18s %s\n", $ 1, $ 2, $ 3
954 if ($ 4) {
955 lmax = 79
956 indent = " "
957 line = indent
958 len = length (line)
959 n = split ($ 4, a, " ")
960 for (i = 1; i <= n; i++) {
961 l = length (a[i]) + 1
962 if (i > 1 && len + l > lmax) {
963 print line
964 line = indent " " a[i]
965 len = length (line)
966 } else {
967 line = line " " a[i]
968 len += l
969 }
970 }
971 if (n)
972 print line
973 }
974 }
975 }' || at_write_fail=1
976 exit $at_write_fail
977 fi
978 if $at_version_p; then
979 printf "%s\n" "$as_me (GNU Mailutils 3.20)" &&
980 cat <<\_ATEOF || at_write_fail=1
981
982 Copyright (C) 2021 Free Software Foundation, Inc.
983 This test suite is free software; the Free Software Foundation gives
984 unlimited permission to copy, distribute and modify it.
985 _ATEOF
986 exit $at_write_fail
987 fi
988
989 # Should we print banners? Yes if more than one test is run.
990 case $at_groups in #(
991 *$as_nl* )
992 at_print_banners=: ;; #(
993 * ) at_print_banners=false ;;
994 esac
995 # Text for banner N, set to a single space once printed.
996
997 # Take any -C into account.
998 if $at_change_dir ; then
999 test x != "x$at_dir" && cd "$at_dir" \
1000 || as_fn_error $? "unable to change directory"
1001 at_dir=`pwd`
1002 fi
1003
1004 # Load the config files for any default variable assignments.
1005 for at_file in atconfig atlocal
1006 do
1007 test -r $at_file || continue
1008 . ./$at_file || as_fn_error $? "invalid content: $at_file"
1009 done
1010
1011 # Autoconf <=2.59b set at_top_builddir instead of at_top_build_prefix:
1012 : "${at_top_build_prefix=$at_top_builddir}"
1013
1014 # Perform any assignments requested during argument parsing.
1015 eval "$at_debug_args"
1016
1017 # atconfig delivers names relative to the directory the test suite is
1018 # in, but the groups themselves are run in testsuite-dir/group-dir.
1019 if test -n "$at_top_srcdir"; then
1020 builddir=../..
1021 for at_dir_var in srcdir top_srcdir top_build_prefix
1022 do
1023 eval at_val=\$at_$at_dir_var
1024 case $at_val in
1025 [\\/$]* | ?:[\\/]* ) at_prefix= ;;
1026 *) at_prefix=../../ ;;
1027 esac
1028 eval "$at_dir_var=\$at_prefix\$at_val"
1029 done
1030 fi
1031
1032 ## -------------------- ##
1033 ## Directory structure. ##
1034 ## -------------------- ##
1035
1036 # This is the set of directories and files used by this script
1037 # (non-literals are capitalized):
1038 #
1039 # TESTSUITE - the testsuite
1040 # TESTSUITE.log - summarizes the complete testsuite run
1041 # TESTSUITE.dir/ - created during a run, remains after -d or failed test
1042 # + at-groups/ - during a run: status of all groups in run
1043 # | + NNN/ - during a run: meta-data about test group NNN
1044 # | | + check-line - location (source file and line) of current AT_CHECK
1045 # | | + status - exit status of current AT_CHECK
1046 # | | + stdout - stdout of current AT_CHECK
1047 # | | + stder1 - stderr, including trace
1048 # | | + stderr - stderr, with trace filtered out
1049 # | | + test-source - portion of testsuite that defines group
1050 # | | + times - timestamps for computing duration
1051 # | | + pass - created if group passed
1052 # | | + xpass - created if group xpassed
1053 # | | + fail - created if group failed
1054 # | | + xfail - created if group xfailed
1055 # | | + skip - created if group skipped
1056 # + at-stop - during a run: end the run if this file exists
1057 # + at-source-lines - during a run: cache of TESTSUITE line numbers for extraction
1058 # + 0..NNN/ - created for each group NNN, remains after -d or failed test
1059 # | + TESTSUITE.log - summarizes the group results
1060 # | + ... - files created during the group
1061
1062 # The directory the whole suite works in.
1063 # Should be absolute to let the user `cd' at will.
1064 at_suite_dir=$at_dir/$as_me.dir
1065 # The file containing the suite ($at_dir might have changed since earlier).
1066 at_suite_log=$at_dir/$as_me.log
1067 # The directory containing helper files per test group.
1068 at_helper_dir=$at_suite_dir/at-groups
1069 # Stop file: if it exists, do not start new jobs.
1070 at_stop_file=$at_suite_dir/at-stop
1071 # The fifo used for the job dispatcher.
1072 at_job_fifo=$at_suite_dir/at-job-fifo
1073
1074 if $at_clean; then
1075 test -d "$at_suite_dir" &&
1076 find "$at_suite_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \;
1077 rm -f -r "$at_suite_dir" "$at_suite_log"
1078 exit $?
1079 fi
1080
1081 # Don't take risks: use only absolute directories in PATH.
1082 #
1083 # For stand-alone test suites (ie. atconfig was not found),
1084 # AUTOTEST_PATH is relative to `.'.
1085 #
1086 # For embedded test suites, AUTOTEST_PATH is relative to the top level
1087 # of the package. Then expand it into build/src parts, since users
1088 # may create executables in both places.
1089 AUTOTEST_PATH=`printf "%s\n" "$AUTOTEST_PATH" | sed "s|:|$PATH_SEPARATOR|g"`
1090 at_path=
1091 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1092 for as_dir in $AUTOTEST_PATH $PATH
1093 do
1094 IFS=$as_save_IFS
1095 case $as_dir in #(((
1096 '') as_dir=./ ;;
1097 */) ;;
1098 *) as_dir=$as_dir/ ;;
1099 esac
1100 test -n "$at_path" && as_fn_append at_path $PATH_SEPARATOR
1101 case $as_dir in
1102 [\\/]* | ?:[\\/]* )
1103 as_fn_append at_path "$as_dir"
1104 ;;
1105 * )
1106 if test -z "$at_top_build_prefix"; then
1107 # Stand-alone test suite.
1108 as_fn_append at_path "$as_dir"
1109 else
1110 # Embedded test suite.
1111 as_fn_append at_path "$at_top_build_prefix$as_dir$PATH_SEPARATOR"
1112 as_fn_append at_path "$at_top_srcdir/$as_dir"
1113 fi
1114 ;;
1115 esac
1116 done
1117 IFS=$as_save_IFS
1118
1119
1120 # Now build and simplify PATH.
1121 #
1122 # There might be directories that don't exist, but don't redirect
1123 # builtins' (eg., cd) stderr directly: Ultrix's sh hates that.
1124 at_new_path=
1125 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1126 for as_dir in $at_path
1127 do
1128 IFS=$as_save_IFS
1129 case $as_dir in #(((
1130 '') as_dir=./ ;;
1131 */) ;;
1132 *) as_dir=$as_dir/ ;;
1133 esac
1134 test -d "$as_dir" || continue
1135 case $as_dir in
1136 [\\/]* | ?:[\\/]* ) ;;
1137 * ) as_dir=`(cd "$as_dir" && pwd) 2>/dev/null` ;;
1138 esac
1139 case $PATH_SEPARATOR$at_new_path$PATH_SEPARATOR in
1140 *$PATH_SEPARATOR$as_dir$PATH_SEPARATOR*) ;;
1141 $PATH_SEPARATOR$PATH_SEPARATOR) at_new_path=$as_dir ;;
1142 *) as_fn_append at_new_path "$PATH_SEPARATOR$as_dir" ;;
1143 esac
1144 done
1145 IFS=$as_save_IFS
1146
1147 PATH=$at_new_path
1148 export PATH
1149
1150 # Setting up the FDs.
1151
1152
1153
1154 # 5 is the log file. Not to be overwritten if `-d'.
1155 if $at_debug_p; then
1156 at_suite_log=/dev/null
1157 else
1158 : >"$at_suite_log"
1159 fi
1160 exec 5>>"$at_suite_log"
1161
1162 # Banners and logs.
1163 printf "%s\n" "## ------------------------------ ##
1164 ## GNU Mailutils 3.20 test suite. ##
1165 ## ------------------------------ ##"
1166 {
1167 printf "%s\n" "## ------------------------------ ##
1168 ## GNU Mailutils 3.20 test suite. ##
1169 ## ------------------------------ ##"
1170 echo
1171
1172 printf "%s\n" "$as_me: command line was:"
1173 printf "%s\n" " \$ $0 $at_cli_args"
1174 echo
1175
1176 # If ChangeLog exists, list a few lines in case it might help determining
1177 # the exact version.
1178 if test -n "$at_top_srcdir" && test -f "$at_top_srcdir/ChangeLog"; then
1179 printf "%s\n" "## ---------- ##
1180 ## ChangeLog. ##
1181 ## ---------- ##"
1182 echo
1183 sed 's/^/| /;10q' "$at_top_srcdir/ChangeLog"
1184 echo
1185 fi
1186
1187 {
1188 cat <<_ASUNAME
1189 ## --------- ##
1190 ## Platform. ##
1191 ## --------- ##
1192
1193 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
1194 uname -m = `(uname -m) 2>/dev/null || echo unknown`
1195 uname -r = `(uname -r) 2>/dev/null || echo unknown`
1196 uname -s = `(uname -s) 2>/dev/null || echo unknown`
1197 uname -v = `(uname -v) 2>/dev/null || echo unknown`
1198
1199 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
1200 /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
1201
1202 /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
1203 /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
1204 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
1205 /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
1206 /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
1207 /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
1208 /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
1209
1210 _ASUNAME
1211
1212 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1213 for as_dir in $PATH
1214 do
1215 IFS=$as_save_IFS
1216 case $as_dir in #(((
1217 '') as_dir=./ ;;
1218 */) ;;
1219 *) as_dir=$as_dir/ ;;
1220 esac
1221 printf "%s\n" "PATH: $as_dir"
1222 done
1223 IFS=$as_save_IFS
1224
1225 }
1226 echo
1227
1228 # Contents of the config files.
1229 for at_file in atconfig atlocal
1230 do
1231 test -r $at_file || continue
1232 printf "%s\n" "$as_me: $at_file:"
1233 sed 's/^/| /' $at_file
1234 echo
1235 done
1236 } >&5
1237
1238 # This setting is needed on FreeBSD to ensure the LD_LIBRARY_PATH overrides
1239 # the DT_RPATH tag in ELF header. See
1240 # https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27510
1241 # for details.
1242 LD_LIBRARY_PATH_RPATH=y
1243 export LD_LIBRARY_PATH_RPATH
1244
1245
1246 ## ------------------------- ##
1247 ## Autotest shell functions. ##
1248 ## ------------------------- ##
1249
1250 # at_fn_banner NUMBER
1251 # -------------------
1252 # Output banner NUMBER, provided the testsuite is running multiple groups and
1253 # this particular banner has not yet been printed.
1254 at_fn_banner ()
1255 {
1256 $at_print_banners || return 0
1257 eval at_banner_text=\$at_banner_text_$1
1258 test "x$at_banner_text" = "x " && return 0
1259 eval "at_banner_text_$1=\" \""
1260 if test -z "$at_banner_text"; then
1261 $at_first || echo
1262 else
1263 printf "%s\n" "$as_nl$at_banner_text$as_nl"
1264 fi
1265 } # at_fn_banner
1266
1267 # at_fn_check_prepare_notrace REASON LINE
1268 # ---------------------------------------
1269 # Perform AT_CHECK preparations for the command at LINE for an untraceable
1270 # command; REASON is the reason for disabling tracing.
1271 at_fn_check_prepare_notrace ()
1272 {
1273 $at_trace_echo "Not enabling shell tracing (command contains $1)"
1274 printf "%s\n" "$2" >"$at_check_line_file"
1275 at_check_trace=: at_check_filter=:
1276 : >"$at_stdout"; : >"$at_stderr"
1277 }
1278
1279 # at_fn_check_prepare_trace LINE
1280 # ------------------------------
1281 # Perform AT_CHECK preparations for the command at LINE for a traceable
1282 # command.
1283 at_fn_check_prepare_trace ()
1284 {
1285 printf "%s\n" "$1" >"$at_check_line_file"
1286 at_check_trace=$at_traceon at_check_filter=$at_check_filter_trace
1287 : >"$at_stdout"; : >"$at_stderr"
1288 }
1289
1290 # at_fn_check_prepare_dynamic COMMAND LINE
1291 # ----------------------------------------
1292 # Decide if COMMAND at LINE is traceable at runtime, and call the appropriate
1293 # preparation function.
1294 at_fn_check_prepare_dynamic ()
1295 {
1296 case $1 in
1297 *$as_nl*)
1298 at_fn_check_prepare_notrace 'an embedded newline' "$2" ;;
1299 *)
1300 at_fn_check_prepare_trace "$2" ;;
1301 esac
1302 }
1303
1304 # at_fn_filter_trace
1305 # ------------------
1306 # Remove the lines in the file "$at_stderr" generated by "set -x" and print
1307 # them to stderr.
1308 at_fn_filter_trace ()
1309 {
1310 mv "$at_stderr" "$at_stder1"
1311 grep '^ *+' "$at_stder1" >&2
1312 grep -v '^ *+' "$at_stder1" >"$at_stderr"
1313 }
1314
1315 # at_fn_log_failure FILE-LIST
1316 # ---------------------------
1317 # Copy the files in the list on stdout with a "> " prefix, and exit the shell
1318 # with a failure exit code.
1319 at_fn_log_failure ()
1320 {
1321 for file
1322 do printf "%s\n" "$file:"; sed 's/^/> /' "$file"; done
1323 echo 1 > "$at_status_file"
1324 exit 1
1325 }
1326
1327 # at_fn_check_skip EXIT-CODE LINE
1328 # -------------------------------
1329 # Check whether EXIT-CODE is a special exit code (77 or 99), and if so exit
1330 # the test group subshell with that same exit code. Use LINE in any report
1331 # about test failure.
1332 at_fn_check_skip ()
1333 {
1334 case $1 in
1335 99) echo 99 > "$at_status_file"; at_failed=:
1336 printf "%s\n" "$2: hard failure"; exit 99;;
1337 77) echo 77 > "$at_status_file"; exit 77;;
1338 esac
1339 }
1340
1341 # at_fn_check_status EXPECTED EXIT-CODE LINE
1342 # ------------------------------------------
1343 # Check whether EXIT-CODE is the EXPECTED exit code, and if so do nothing.
1344 # Otherwise, if it is 77 or 99, exit the test group subshell with that same
1345 # exit code; if it is anything else print an error message referring to LINE,
1346 # and fail the test.
1347 at_fn_check_status ()
1348 {
1349 case $2 in
1350 $1 ) ;;
1351 77) echo 77 > "$at_status_file"; exit 77;;
1352 99) echo 99 > "$at_status_file"; at_failed=:
1353 printf "%s\n" "$3: hard failure"; exit 99;;
1354 *) printf "%s\n" "$3: exit code was $2, expected $1"
1355 at_failed=:;;
1356 esac
1357 }
1358
1359 # at_fn_diff_devnull FILE
1360 # -----------------------
1361 # Emit a diff between /dev/null and FILE. Uses "test -s" to avoid useless diff
1362 # invocations.
1363 at_fn_diff_devnull ()
1364 {
1365 test -s "$1" || return 0
1366 $at_diff "$at_devnull" "$1"
1367 }
1368
1369 # at_fn_test NUMBER
1370 # -----------------
1371 # Parse out test NUMBER from the tail of this file.
1372 at_fn_test ()
1373 {
1374 eval at_sed=\$at_sed$1
1375 sed "$at_sed" "$at_myself" > "$at_test_source"
1376 }
1377
1378 # at_fn_create_debugging_script
1379 # -----------------------------
1380 # Create the debugging script $at_group_dir/run which will reproduce the
1381 # current test group.
1382 at_fn_create_debugging_script ()
1383 {
1384 {
1385 echo "#! /bin/sh" &&
1386 echo 'test ${ZSH_VERSION+y} && alias -g '\''${1+"$@"}'\''='\''"$@"'\''' &&
1387 printf "%s\n" "cd '$at_dir'" &&
1388 printf "%s\n" "exec \${CONFIG_SHELL-$SHELL} \"$at_myself\" -v -d $at_debug_args $at_group \${1+\"\$@\"}" &&
1389 echo 'exit 1'
1390 } >"$at_group_dir/run" &&
1391 chmod +x "$at_group_dir/run"
1392 }
1393
1394 ## -------------------------------- ##
1395 ## End of autotest shell functions. ##
1396 ## -------------------------------- ##
1397 {
1398 printf "%s\n" "## ------------------ ##
1399 ## Running the tests. ##
1400 ## ------------------ ##"
1401 } >&5
1402
1403 at_start_date=`date`
1404 at_start_time=`date +%s 2>/dev/null`
1405 printf "%s\n" "$as_me: starting at: $at_start_date" >&5
1406
1407 # Create the master directory if it doesn't already exist.
1408 as_dir="$at_suite_dir"; as_fn_mkdir_p ||
1409 as_fn_error $? "cannot create \`$at_suite_dir'" "$LINENO" 5
1410
1411 # Can we diff with `/dev/null'? DU 5.0 refuses.
1412 if diff /dev/null /dev/null >/dev/null 2>&1; then
1413 at_devnull=/dev/null
1414 else
1415 at_devnull=$at_suite_dir/devnull
1416 >"$at_devnull"
1417 fi
1418
1419 # Use `diff -u' when possible.
1420 if at_diff=`diff -u "$at_devnull" "$at_devnull" 2>&1` && test -z "$at_diff"
1421 then
1422 at_diff='diff -u'
1423 else
1424 at_diff=diff
1425 fi
1426
1427 # Get the last needed group.
1428 for at_group in : $at_groups; do :; done
1429
1430 # Extract the start and end lines of each test group at the tail
1431 # of this file
1432 awk '
1433 BEGIN { FS="" }
1434 /^#AT_START_/ {
1435 start = NR
1436 }
1437 /^#AT_STOP_/ {
1438 test = substr ($ 0, 10)
1439 print "at_sed" test "=\"1," start "d;" (NR-1) "q\""
1440 if (test == "'"$at_group"'") exit
1441 }' "$at_myself" > "$at_suite_dir/at-source-lines" &&
1442 . "$at_suite_dir/at-source-lines" ||
1443 as_fn_error $? "cannot create test line number cache" "$LINENO" 5
1444 rm -f "$at_suite_dir/at-source-lines"
1445
1446 # Set number of jobs for `-j'; avoid more jobs than test groups.
1447 set X $at_groups; shift; at_max_jobs=$#
1448 if test $at_max_jobs -eq 0; then
1449 at_jobs=1
1450 fi
1451 if test $at_jobs -ne 1 &&
1452 { test $at_jobs -eq 0 || test $at_jobs -gt $at_max_jobs; }; then
1453 at_jobs=$at_max_jobs
1454 fi
1455
1456 # If parallel mode, don't output banners, don't split summary lines.
1457 if test $at_jobs -ne 1; then
1458 at_print_banners=false
1459 at_quiet=:
1460 fi
1461
1462 # Set up helper dirs.
1463 rm -rf "$at_helper_dir" &&
1464 mkdir "$at_helper_dir" &&
1465 cd "$at_helper_dir" &&
1466 { test -z "$at_groups" || mkdir $at_groups; } ||
1467 as_fn_error $? "testsuite directory setup failed" "$LINENO" 5
1468
1469 # Functions for running a test group. We leave the actual
1470 # test group execution outside of a shell function in order
1471 # to avoid hitting zsh 4.x exit status bugs.
1472
1473 # at_fn_group_prepare
1474 # -------------------
1475 # Prepare for running a test group.
1476 at_fn_group_prepare ()
1477 {
1478 # The directory for additional per-group helper files.
1479 at_job_dir=$at_helper_dir/$at_group
1480 # The file containing the location of the last AT_CHECK.
1481 at_check_line_file=$at_job_dir/check-line
1482 # The file containing the exit status of the last command.
1483 at_status_file=$at_job_dir/status
1484 # The files containing the output of the tested commands.
1485 at_stdout=$at_job_dir/stdout
1486 at_stder1=$at_job_dir/stder1
1487 at_stderr=$at_job_dir/stderr
1488 # The file containing the code for a test group.
1489 at_test_source=$at_job_dir/test-source
1490 # The file containing dates.
1491 at_times_file=$at_job_dir/times
1492
1493 # Be sure to come back to the top test directory.
1494 cd "$at_suite_dir"
1495
1496 # Clearly separate the test groups when verbose.
1497 $at_first || $at_verbose echo
1498
1499 at_group_normalized=$at_group
1500
1501 eval 'while :; do
1502 case $at_group_normalized in #(
1503 '"$at_format"'*) break;;
1504 esac
1505 at_group_normalized=0$at_group_normalized
1506 done'
1507
1508
1509 # Create a fresh directory for the next test group, and enter.
1510 # If one already exists, the user may have invoked ./run from
1511 # within that directory; we remove the contents, but not the
1512 # directory itself, so that we aren't pulling the rug out from
1513 # under the shell's notion of the current directory.
1514 at_group_dir=$at_suite_dir/$at_group_normalized
1515 at_group_log=$at_group_dir/$as_me.log
1516 if test -d "$at_group_dir"
1517 then
1518 find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx {} \;
1519 rm -fr "$at_group_dir"/* "$at_group_dir"/.[!.] "$at_group_dir"/.??*
1520 fi ||
1521 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: test directory for $at_group_normalized could not be cleaned" >&5
1522 printf "%s\n" "$as_me: WARNING: test directory for $at_group_normalized could not be cleaned" >&2;}
1523 # Be tolerant if the above `rm' was not able to remove the directory.
1524 as_dir="$at_group_dir"; as_fn_mkdir_p
1525
1526 echo 0 > "$at_status_file"
1527
1528 # In verbose mode, append to the log file *and* show on
1529 # the standard output; in quiet mode only write to the log.
1530 if test -z "$at_verbose"; then
1531 at_tee_pipe='tee -a "$at_group_log"'
1532 else
1533 at_tee_pipe='cat >> "$at_group_log"'
1534 fi
1535 }
1536
1537 # at_fn_group_banner ORDINAL LINE DESC PAD [BANNER]
1538 # -------------------------------------------------
1539 # Declare the test group ORDINAL, located at LINE with group description DESC,
1540 # and residing under BANNER. Use PAD to align the status column.
1541 at_fn_group_banner ()
1542 {
1543 at_setup_line="$2"
1544 test -n "$5" && at_fn_banner $5
1545 at_desc="$3"
1546 case $1 in
1547 [0-9]) at_desc_line=" $1: ";;
1548 [0-9][0-9]) at_desc_line=" $1: " ;;
1549 *) at_desc_line="$1: " ;;
1550 esac
1551 as_fn_append at_desc_line "$3$4"
1552 $at_quiet printf %s "$at_desc_line"
1553 echo "# -*- compilation -*-" >> "$at_group_log"
1554 }
1555
1556 # at_fn_group_postprocess
1557 # -----------------------
1558 # Perform cleanup after running a test group.
1559 at_fn_group_postprocess ()
1560 {
1561 # Be sure to come back to the suite directory, in particular
1562 # since below we might `rm' the group directory we are in currently.
1563 cd "$at_suite_dir"
1564
1565 if test ! -f "$at_check_line_file"; then
1566 sed "s/^ */$as_me: WARNING: /" <<_ATEOF
1567 A failure happened in a test group before any test could be
1568 run. This means that test suite is improperly designed. Please
1569 report this failure to <[email protected]>.
1570 _ATEOF
1571 printf "%s\n" "$at_setup_line" >"$at_check_line_file"
1572 at_status=99
1573 fi
1574 $at_verbose printf %s "$at_group. $at_setup_line: "
1575 printf %s "$at_group. $at_setup_line: " >> "$at_group_log"
1576 case $at_xfail:$at_status in
1577 yes:0)
1578 at_msg="UNEXPECTED PASS"
1579 at_res=xpass
1580 at_errexit=$at_errexit_p
1581 at_color=$at_red
1582 ;;
1583 no:0)
1584 at_msg="ok"
1585 at_res=pass
1586 at_errexit=false
1587 at_color=$at_grn
1588 ;;
1589 *:77)
1590 at_msg='skipped ('`cat "$at_check_line_file"`')'
1591 at_res=skip
1592 at_errexit=false
1593 at_color=$at_blu
1594 ;;
1595 no:* | *:99)
1596 at_msg='FAILED ('`cat "$at_check_line_file"`')'
1597 at_res=fail
1598 at_errexit=$at_errexit_p
1599 at_color=$at_red
1600 ;;
1601 yes:*)
1602 at_msg='expected failure ('`cat "$at_check_line_file"`')'
1603 at_res=xfail
1604 at_errexit=false
1605 at_color=$at_lgn
1606 ;;
1607 esac
1608 echo "$at_res" > "$at_job_dir/$at_res"
1609 # In parallel mode, output the summary line only afterwards.
1610 if test $at_jobs -ne 1 && test -n "$at_verbose"; then
1611 printf "%s\n" "$at_desc_line $at_color$at_msg$at_std"
1612 else
1613 # Make sure there is a separator even with long titles.
1614 printf "%s\n" " $at_color$at_msg$at_std"
1615 fi
1616 at_log_msg="$at_group. $at_desc ($at_setup_line): $at_msg"
1617 case $at_status in
1618 0|77)
1619 # $at_times_file is only available if the group succeeded.
1620 # We're not including the group log, so the success message
1621 # is written in the global log separately. But we also
1622 # write to the group log in case they're using -d.
1623 if test -f "$at_times_file"; then
1624 at_log_msg="$at_log_msg ("`sed 1d "$at_times_file"`')'
1625 rm -f "$at_times_file"
1626 fi
1627 printf "%s\n" "$at_log_msg" >> "$at_group_log"
1628 printf "%s\n" "$at_log_msg" >&5
1629
1630 # Cleanup the group directory, unless the user wants the files
1631 # or the success was unexpected.
1632 if $at_debug_p || test $at_res = xpass; then
1633 at_fn_create_debugging_script
1634 if test $at_res = xpass && $at_errexit; then
1635 echo stop > "$at_stop_file"
1636 fi
1637 else
1638 if test -d "$at_group_dir"; then
1639 find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \;
1640 rm -fr "$at_group_dir"
1641 fi
1642 rm -f "$at_test_source"
1643 fi
1644 ;;
1645 *)
1646 # Upon failure, include the log into the testsuite's global
1647 # log. The failure message is written in the group log. It
1648 # is later included in the global log.
1649 printf "%s\n" "$at_log_msg" >> "$at_group_log"
1650
1651 # Upon failure, keep the group directory for autopsy, and create
1652 # the debugging script. With -e, do not start any further tests.
1653 at_fn_create_debugging_script
1654 if $at_errexit; then
1655 echo stop > "$at_stop_file"
1656 fi
1657 ;;
1658 esac
1659 }
1660
1661
1662 ## ------------ ##
1663 ## Driver loop. ##
1664 ## ------------ ##
1665
1666
1667 if (set -m && set +m && set +b) >/dev/null 2>&1; then
1668 set +b
1669 at_job_control_on='set -m' at_job_control_off='set +m' at_job_group=-
1670 else
1671 at_job_control_on=: at_job_control_off=: at_job_group=
1672 fi
1673
1674 for at_signal in 1 2 15; do
1675 trap 'set +x; set +e
1676 $at_job_control_off
1677 at_signal='"$at_signal"'
1678 echo stop > "$at_stop_file"
1679 trap "" $at_signal
1680 at_pgids=
1681 for at_pgid in `jobs -p 2>/dev/null`; do
1682 at_pgids="$at_pgids $at_job_group$at_pgid"
1683 done
1684 test -z "$at_pgids" || kill -$at_signal $at_pgids 2>/dev/null
1685 wait
1686 if test "$at_jobs" -eq 1 || test -z "$at_verbose"; then
1687 echo >&2
1688 fi
1689 at_signame=`kill -l $at_signal 2>&1 || echo $at_signal`
1690 set x $at_signame
1691 test 0 -gt 2 && at_signame=$at_signal
1692 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: caught signal $at_signame, bailing out" >&5
1693 printf "%s\n" "$as_me: WARNING: caught signal $at_signame, bailing out" >&2;}
1694 as_fn_arith 128 + $at_signal && exit_status=$as_val
1695 as_fn_exit $exit_status' $at_signal
1696 done
1697
1698 rm -f "$at_stop_file"
1699 at_first=:
1700
1701 if test $at_jobs -ne 1 &&
1702 rm -f "$at_job_fifo" &&
1703 test -n "$at_job_group" &&
1704 ( mkfifo "$at_job_fifo" && trap 'exit 1' PIPE STOP TSTP ) 2>/dev/null
1705 then
1706 # FIFO job dispatcher.
1707
1708 trap 'at_pids=
1709 for at_pid in `jobs -p`; do
1710 at_pids="$at_pids $at_job_group$at_pid"
1711 done
1712 if test -n "$at_pids"; then
1713 at_sig=TSTP
1714 test ${TMOUT+y} && at_sig=STOP
1715 kill -$at_sig $at_pids 2>/dev/null
1716 fi
1717 kill -STOP $$
1718 test -z "$at_pids" || kill -CONT $at_pids 2>/dev/null' TSTP
1719
1720 echo
1721 # Turn jobs into a list of numbers, starting from 1.
1722 at_joblist=`printf "%s\n" "$at_groups" | sed -n 1,${at_jobs}p`
1723
1724 set X $at_joblist
1725 shift
1726 for at_group in $at_groups; do
1727 $at_job_control_on 2>/dev/null
1728 (
1729 # Start one test group.
1730 $at_job_control_off
1731 if $at_first; then
1732 exec 7>"$at_job_fifo"
1733 else
1734 exec 6<&-
1735 fi
1736 trap 'set +x; set +e
1737 trap "" PIPE
1738 echo stop > "$at_stop_file"
1739 echo >&7
1740 as_fn_exit 141' PIPE
1741 at_fn_group_prepare
1742 if cd "$at_group_dir" &&
1743 at_fn_test $at_group &&
1744 . "$at_test_source"
1745 then :; else
1746 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5
1747 printf "%s\n" "$as_me: WARNING: unable to parse test group: $at_group" >&2;}
1748 at_failed=:
1749 fi
1750 at_fn_group_postprocess
1751 echo >&7
1752 ) &
1753 $at_job_control_off
1754 if $at_first; then
1755 at_first=false
1756 exec 6<"$at_job_fifo" 7>"$at_job_fifo"
1757 fi
1758 shift # Consume one token.
1759 if test $# -gt 0; then :; else
1760 read at_token <&6 || break
1761 set x $*
1762 fi
1763 test -f "$at_stop_file" && break
1764 done
1765 exec 7>&-
1766 # Read back the remaining ($at_jobs - 1) tokens.
1767 set X $at_joblist
1768 shift
1769 if test $# -gt 0; then
1770 shift
1771 for at_job
1772 do
1773 read at_token
1774 done <&6
1775 fi
1776 exec 6<&-
1777 wait
1778 else
1779 # Run serially, avoid forks and other potential surprises.
1780 for at_group in $at_groups; do
1781 at_fn_group_prepare
1782 if cd "$at_group_dir" &&
1783 at_fn_test $at_group &&
1784 . "$at_test_source"; then :; else
1785 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5
1786 printf "%s\n" "$as_me: WARNING: unable to parse test group: $at_group" >&2;}
1787 at_failed=:
1788 fi
1789 at_fn_group_postprocess
1790 test -f "$at_stop_file" && break
1791 at_first=false
1792 done
1793 fi
1794
1795 # Wrap up the test suite with summary statistics.
1796 cd "$at_helper_dir"
1797
1798 # Use ?..???? when the list must remain sorted, the faster * otherwise.
1799 at_pass_list=`for f in */pass; do echo $f; done | sed '/\*/d; s,/pass,,'`
1800 at_skip_list=`for f in */skip; do echo $f; done | sed '/\*/d; s,/skip,,'`
1801 at_xfail_list=`for f in */xfail; do echo $f; done | sed '/\*/d; s,/xfail,,'`
1802 at_xpass_list=`for f in ?/xpass ??/xpass ???/xpass ????/xpass; do
1803 echo $f; done | sed '/?/d; s,/xpass,,'`
1804 at_fail_list=`for f in ?/fail ??/fail ???/fail ????/fail; do
1805 echo $f; done | sed '/?/d; s,/fail,,'`
1806
1807 set X $at_pass_list $at_xpass_list $at_xfail_list $at_fail_list $at_skip_list
1808 shift; at_group_count=$#
1809 set X $at_xpass_list; shift; at_xpass_count=$#; at_xpass_list=$*
1810 set X $at_xfail_list; shift; at_xfail_count=$#
1811 set X $at_fail_list; shift; at_fail_count=$#; at_fail_list=$*
1812 set X $at_skip_list; shift; at_skip_count=$#
1813
1814 as_fn_arith $at_group_count - $at_skip_count && at_run_count=$as_val
1815 as_fn_arith $at_xpass_count + $at_fail_count && at_unexpected_count=$as_val
1816 as_fn_arith $at_xfail_count + $at_fail_count && at_total_fail_count=$as_val
1817
1818 # Back to the top directory.
1819 cd "$at_dir"
1820 rm -rf "$at_helper_dir"
1821
1822 # Compute the duration of the suite.
1823 at_stop_date=`date`
1824 at_stop_time=`date +%s 2>/dev/null`
1825 printf "%s\n" "$as_me: ending at: $at_stop_date" >&5
1826 case $at_start_time,$at_stop_time in
1827 [0-9]*,[0-9]*)
1828 as_fn_arith $at_stop_time - $at_start_time && at_duration_s=$as_val
1829 as_fn_arith $at_duration_s / 60 && at_duration_m=$as_val
1830 as_fn_arith $at_duration_m / 60 && at_duration_h=$as_val
1831 as_fn_arith $at_duration_s % 60 && at_duration_s=$as_val
1832 as_fn_arith $at_duration_m % 60 && at_duration_m=$as_val
1833 at_duration="${at_duration_h}h ${at_duration_m}m ${at_duration_s}s"
1834 printf "%s\n" "$as_me: test suite duration: $at_duration" >&5
1835 ;;
1836 esac
1837
1838 echo
1839 printf "%s\n" "## ------------- ##
1840 ## Test results. ##
1841 ## ------------- ##"
1842 echo
1843 {
1844 echo
1845 printf "%s\n" "## ------------- ##
1846 ## Test results. ##
1847 ## ------------- ##"
1848 echo
1849 } >&5
1850
1851 if test $at_run_count = 1; then
1852 at_result="1 test"
1853 at_were=was
1854 else
1855 at_result="$at_run_count tests"
1856 at_were=were
1857 fi
1858 if $at_errexit_p && test $at_unexpected_count != 0; then
1859 if test $at_xpass_count = 1; then
1860 at_result="$at_result $at_were run, one passed"
1861 else
1862 at_result="$at_result $at_were run, one failed"
1863 fi
1864 at_result="$at_result unexpectedly and inhibited subsequent tests."
1865 at_color=$at_red
1866 else
1867 # Don't you just love exponential explosion of the number of cases?
1868 at_color=$at_red
1869 case $at_xpass_count:$at_fail_count:$at_xfail_count in
1870 # So far, so good.
1871 0:0:0) at_result="$at_result $at_were successful." at_color=$at_grn ;;
1872 0:0:*) at_result="$at_result behaved as expected." at_color=$at_lgn ;;
1873
1874 # Some unexpected failures
1875 0:*:0) at_result="$at_result $at_were run,
1876 $at_fail_count failed unexpectedly." ;;
1877
1878 # Some failures, both expected and unexpected
1879 0:*:1) at_result="$at_result $at_were run,
1880 $at_total_fail_count failed ($at_xfail_count expected failure)." ;;
1881 0:*:*) at_result="$at_result $at_were run,
1882 $at_total_fail_count failed ($at_xfail_count expected failures)." ;;
1883
1884 # No unexpected failures, but some xpasses
1885 *:0:*) at_result="$at_result $at_were run,
1886 $at_xpass_count passed unexpectedly." ;;
1887
1888 # No expected failures, but failures and xpasses
1889 *:1:0) at_result="$at_result $at_were run,
1890 $at_unexpected_count did not behave as expected ($at_fail_count unexpected failure)." ;;
1891 *:*:0) at_result="$at_result $at_were run,
1892 $at_unexpected_count did not behave as expected ($at_fail_count unexpected failures)." ;;
1893
1894 # All of them.
1895 *:*:1) at_result="$at_result $at_were run,
1896 $at_xpass_count passed unexpectedly,
1897 $at_total_fail_count failed ($at_xfail_count expected failure)." ;;
1898 *:*:*) at_result="$at_result $at_were run,
1899 $at_xpass_count passed unexpectedly,
1900 $at_total_fail_count failed ($at_xfail_count expected failures)." ;;
1901 esac
1902
1903 if test $at_skip_count = 0 && test $at_run_count -gt 1; then
1904 at_result="All $at_result"
1905 fi
1906 fi
1907
1908 # Now put skips in the mix.
1909 case $at_skip_count in
1910 0) ;;
1911 1) at_result="$at_result
1912 1 test was skipped." ;;
1913 *) at_result="$at_result
1914 $at_skip_count tests were skipped." ;;
1915 esac
1916
1917 if test $at_unexpected_count = 0; then
1918 echo "$at_color$at_result$at_std"
1919 echo "$at_result" >&5
1920 else
1921 echo "${at_color}ERROR: $at_result$at_std" >&2
1922 echo "ERROR: $at_result" >&5
1923 {
1924 echo
1925 printf "%s\n" "## ------------------------ ##
1926 ## Summary of the failures. ##
1927 ## ------------------------ ##"
1928
1929 # Summary of failed and skipped tests.
1930 if test $at_fail_count != 0; then
1931 echo "Failed tests:"
1932 $SHELL "$at_myself" $at_fail_list --list
1933 echo
1934 fi
1935 if test $at_skip_count != 0; then
1936 echo "Skipped tests:"
1937 $SHELL "$at_myself" $at_skip_list --list
1938 echo
1939 fi
1940 if test $at_xpass_count != 0; then
1941 echo "Unexpected passes:"
1942 $SHELL "$at_myself" $at_xpass_list --list
1943 echo
1944 fi
1945 if test $at_fail_count != 0; then
1946 printf "%s\n" "## ---------------------- ##
1947 ## Detailed failed tests. ##
1948 ## ---------------------- ##"
1949 echo
1950 for at_group in $at_fail_list
1951 do
1952 at_group_normalized=$at_group
1953
1954 eval 'while :; do
1955 case $at_group_normalized in #(
1956 '"$at_format"'*) break;;
1957 esac
1958 at_group_normalized=0$at_group_normalized
1959 done'
1960
1961 cat "$at_suite_dir/$at_group_normalized/$as_me.log"
1962 echo
1963 done
1964 echo
1965 fi
1966 if test -n "$at_top_srcdir"; then
1967 sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
1968 ## ${at_top_build_prefix}config.log ##
1969 _ASBOX
1970 sed 's/^/| /' ${at_top_build_prefix}config.log
1971 echo
1972 fi
1973 } >&5
1974
1975 sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
1976 ## $as_me.log was created. ##
1977 _ASBOX
1978
1979 echo
1980 if $at_debug_p; then
1981 at_msg='per-test log files'
1982 else
1983 at_msg="\`${at_testdir+${at_testdir}/}$as_me.log'"
1984 fi
1985 at_msg1a=${at_xpass_list:+', '}
1986 at_msg1=$at_fail_list${at_fail_list:+" failed$at_msg1a"}
1987 at_msg2=$at_xpass_list${at_xpass_list:+" passed unexpectedly"}
1988
1989 printf "%s\n" "Please send $at_msg and all information you think might help:
1990
1991 To: <[email protected]>
1992 Subject: [GNU Mailutils 3.20] $as_me: $at_msg1$at_msg2
1993
1994 You may investigate any problem if you feel able to do so, in which
1995 case the test suite provides a good starting point. Its output may
1996 be found below \`${at_testdir+${at_testdir}/}$as_me.dir'.
1997 "
1998 exit 1
1999 fi
2000
2001 exit 0
2002
2003 ## ------------- ##
2004 ## Actual tests. ##
2005 ## ------------- ##
2006 #AT_START_1
2007 at_fn_group_banner 1 'autodetect.at:16' \
2008 "format detection" " "
2009 at_xfail=no
2010 (
2011 printf "%s\n" "1. $at_setup_line: testing $at_desc ..."
2012 $at_traceon
2013
2014
2015 { set +x
2016 printf "%s\n" "$at_srcdir/autodetect.at:18:
2017 mkdir inbox
2018 mbop -m inbox --detect
2019 "
2020 at_fn_check_prepare_notrace 'an embedded newline' "autodetect.at:18"
2021 ( $at_check_trace;
2022 mkdir inbox
2023 mbop -m inbox --detect
2024
2025 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2026 at_status=$? at_failed=false
2027 $at_check_filter
2028 at_fn_diff_devnull "$at_stderr" || at_failed=:
2029 echo >>"$at_stdout"; printf "%s\n" "inbox: 0
2030 " | \
2031 $at_diff - "$at_stdout" || at_failed=:
2032 at_fn_check_status 1 $at_status "$at_srcdir/autodetect.at:18"
2033 $at_failed && at_fn_log_failure
2034 $at_traceon; }
2035
2036 { set +x
2037 printf "%s\n" "$at_srcdir/autodetect.at:25:
2038 touch inbox/.mh_sequences
2039 mbop -m inbox --detect
2040 "
2041 at_fn_check_prepare_notrace 'an embedded newline' "autodetect.at:25"
2042 ( $at_check_trace;
2043 touch inbox/.mh_sequences
2044 mbop -m inbox --detect
2045
2046 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2047 at_status=$? at_failed=false
2048 $at_check_filter
2049 at_fn_diff_devnull "$at_stderr" || at_failed=:
2050 echo >>"$at_stdout"; printf "%s\n" "inbox: 2
2051 " | \
2052 $at_diff - "$at_stdout" || at_failed=:
2053 at_fn_check_status 0 $at_status "$at_srcdir/autodetect.at:25"
2054 $at_failed && at_fn_log_failure
2055 $at_traceon; }
2056
2057 { set +x
2058 printf "%s\n" "$at_srcdir/autodetect.at:32:
2059 rm inbox/.mh_sequences
2060 touch inbox/1
2061 mbop -m inbox --detect
2062 "
2063 at_fn_check_prepare_notrace 'an embedded newline' "autodetect.at:32"
2064 ( $at_check_trace;
2065 rm inbox/.mh_sequences
2066 touch inbox/1
2067 mbop -m inbox --detect
2068
2069 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2070 at_status=$? at_failed=false
2071 $at_check_filter
2072 at_fn_diff_devnull "$at_stderr" || at_failed=:
2073 echo >>"$at_stdout"; printf "%s\n" "inbox: 2
2074 " | \
2075 $at_diff - "$at_stdout" || at_failed=:
2076 at_fn_check_status 0 $at_status "$at_srcdir/autodetect.at:32"
2077 $at_failed && at_fn_log_failure
2078 $at_traceon; }
2079
2080 { set +x
2081 printf "%s\n" "$at_srcdir/autodetect.at:40:
2082 mv inbox/1 inbox/,1
2083 mbop -m inbox --detect
2084 "
2085 at_fn_check_prepare_notrace 'an embedded newline' "autodetect.at:40"
2086 ( $at_check_trace;
2087 mv inbox/1 inbox/,1
2088 mbop -m inbox --detect
2089
2090 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2091 at_status=$? at_failed=false
2092 $at_check_filter
2093 at_fn_diff_devnull "$at_stderr" || at_failed=:
2094 echo >>"$at_stdout"; printf "%s\n" "inbox: 2
2095 " | \
2096 $at_diff - "$at_stdout" || at_failed=:
2097 at_fn_check_status 0 $at_status "$at_srcdir/autodetect.at:40"
2098 $at_failed && at_fn_log_failure
2099 $at_traceon; }
2100
2101
2102 set +x
2103 $at_times_p && times >"$at_times_file"
2104 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2105 read at_status <"$at_status_file"
2106 #AT_STOP_1
2107 #AT_START_2
2108 at_fn_group_banner 2 'count.at:17' \
2109 "message count" " "
2110 at_xfail=no
2111 (
2112 printf "%s\n" "2. $at_setup_line: testing $at_desc ..."
2113 $at_traceon
2114
2115 { set +x
2116 printf "%s\n" "$at_srcdir/count.at:18: mbox2dir -m inbox \$spooldir/mbox1"
2117 at_fn_check_prepare_dynamic "mbox2dir -m inbox $spooldir/mbox1" "count.at:18"
2118 ( $at_check_trace; mbox2dir -m inbox $spooldir/mbox1
2119 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2120 at_status=$? at_failed=false
2121 $at_check_filter
2122 at_fn_diff_devnull "$at_stderr" || at_failed=:
2123 at_fn_diff_devnull "$at_stdout" || at_failed=:
2124 at_fn_check_status 0 $at_status "$at_srcdir/count.at:18"
2125 $at_failed && at_fn_log_failure
2126 $at_traceon; }
2127
2128
2129 { set +x
2130 printf "%s\n" "$at_srcdir/count.at:20:
2131 mbop -m inbox count
2132 "
2133 at_fn_check_prepare_notrace 'an embedded newline' "count.at:20"
2134 ( $at_check_trace;
2135 mbop -m inbox count
2136
2137 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2138 at_status=$? at_failed=false
2139 $at_check_filter
2140 at_fn_diff_devnull "$at_stderr" || at_failed=:
2141 echo >>"$at_stdout"; printf "%s\n" "count: 5
2142 " | \
2143 $at_diff - "$at_stdout" || at_failed=:
2144 at_fn_check_status 0 $at_status "$at_srcdir/count.at:20"
2145 $at_failed && at_fn_log_failure
2146 $at_traceon; }
2147
2148 set +x
2149 $at_times_p && times >"$at_times_file"
2150 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2151 read at_status <"$at_status_file"
2152 #AT_STOP_2
2153 #AT_START_3
2154 at_fn_group_banner 3 'attr.at:17' \
2155 "attributes" " "
2156 at_xfail=no
2157 (
2158 printf "%s\n" "3. $at_setup_line: testing $at_desc ..."
2159 $at_traceon
2160
2161 { set +x
2162 printf "%s\n" "$at_srcdir/attr.at:18: mbox2dir -m inbox \$spooldir/mbox1"
2163 at_fn_check_prepare_dynamic "mbox2dir -m inbox $spooldir/mbox1" "attr.at:18"
2164 ( $at_check_trace; mbox2dir -m inbox $spooldir/mbox1
2165 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2166 at_status=$? at_failed=false
2167 $at_check_filter
2168 at_fn_diff_devnull "$at_stderr" || at_failed=:
2169 at_fn_diff_devnull "$at_stdout" || at_failed=:
2170 at_fn_check_status 0 $at_status "$at_srcdir/attr.at:18"
2171 $at_failed && at_fn_log_failure
2172 $at_traceon; }
2173
2174
2175 { set +x
2176 printf "%s\n" "$at_srcdir/attr.at:20:
2177 mbop -m inbox 1 \\; attr \\; 2 \\; attr
2178 "
2179 at_fn_check_prepare_notrace 'an embedded newline' "attr.at:20"
2180 ( $at_check_trace;
2181 mbop -m inbox 1 \; attr \; 2 \; attr
2182
2183 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2184 at_status=$? at_failed=false
2185 $at_check_filter
2186 at_fn_diff_devnull "$at_stderr" || at_failed=:
2187 echo >>"$at_stdout"; printf "%s\n" "1 current message
2188 1 attr: -
2189 2 current message
2190 2 attr: -
2191 " | \
2192 $at_diff - "$at_stdout" || at_failed=:
2193 at_fn_check_status 0 $at_status "$at_srcdir/attr.at:20"
2194 $at_failed && at_fn_log_failure
2195 $at_traceon; }
2196
2197 { set +x
2198 printf "%s\n" "$at_srcdir/attr.at:29:
2199 cat >commands <<'_ATEOF'
2200 # Select 3rd message
2201 3
2202 # Set the read attribute
2203 set_read
2204 # Set the draft attribute
2205 set_draft
2206 # Select 5th message
2207 5
2208 # Set the answered attribute
2209 set_answered
2210 set_seen
2211 # Synchronize with the disk storage
2212 sync
2213 _ATEOF
2214
2215 mbop -m inbox < commands
2216 "
2217 at_fn_check_prepare_notrace 'an embedded newline' "attr.at:29"
2218 ( $at_check_trace;
2219 cat >commands <<'_ATEOF'
2220 # Select 3rd message
2221 3
2222 # Set the read attribute
2223 set_read
2224 # Set the draft attribute
2225 set_draft
2226 # Select 5th message
2227 5
2228 # Set the answered attribute
2229 set_answered
2230 set_seen
2231 # Synchronize with the disk storage
2232 sync
2233 _ATEOF
2234
2235 mbop -m inbox < commands
2236
2237 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2238 at_status=$? at_failed=false
2239 $at_check_filter
2240 at_fn_diff_devnull "$at_stderr" || at_failed=:
2241 echo >>"$at_stdout"; printf "%s\n" "3 current message
2242 3 set_read: OK
2243 3 set_draft: OK
2244 5 current message
2245 5 set_answered: OK
2246 5 set_seen: OK
2247 sync: OK
2248 " | \
2249 $at_diff - "$at_stdout" || at_failed=:
2250 at_fn_check_status 0 $at_status "$at_srcdir/attr.at:29"
2251 $at_failed && at_fn_log_failure
2252 $at_traceon; }
2253
2254 { set +x
2255 printf "%s\n" "$at_srcdir/attr.at:56:
2256 mbop -m inbox 3 \\; attr \\; 5 \\; attr
2257 "
2258 at_fn_check_prepare_notrace 'an embedded newline' "attr.at:56"
2259 ( $at_check_trace;
2260 mbop -m inbox 3 \; attr \; 5 \; attr
2261
2262 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2263 at_status=$? at_failed=false
2264 $at_check_filter
2265 at_fn_diff_devnull "$at_stderr" || at_failed=:
2266 echo >>"$at_stdout"; printf "%s\n" "3 current message
2267 3 attr: dR
2268 5 current message
2269 5 attr: AO
2270 " | \
2271 $at_diff - "$at_stdout" || at_failed=:
2272 at_fn_check_status 0 $at_status "$at_srcdir/attr.at:56"
2273 $at_failed && at_fn_log_failure
2274 $at_traceon; }
2275
2276 set +x
2277 $at_times_p && times >"$at_times_file"
2278 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2279 read at_status <"$at_status_file"
2280 #AT_STOP_3
2281 #AT_START_4
2282 at_fn_group_banner 4 'envelope.at:17' \
2283 "envelope" " "
2284 at_xfail=no
2285 (
2286 printf "%s\n" "4. $at_setup_line: testing $at_desc ..."
2287 $at_traceon
2288
2289 { set +x
2290 printf "%s\n" "$at_srcdir/envelope.at:18: mbox2dir -m inbox \$spooldir/mbox1"
2291 at_fn_check_prepare_dynamic "mbox2dir -m inbox $spooldir/mbox1" "envelope.at:18"
2292 ( $at_check_trace; mbox2dir -m inbox $spooldir/mbox1
2293 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2294 at_status=$? at_failed=false
2295 $at_check_filter
2296 at_fn_diff_devnull "$at_stderr" || at_failed=:
2297 at_fn_diff_devnull "$at_stdout" || at_failed=:
2298 at_fn_check_status 0 $at_status "$at_srcdir/envelope.at:18"
2299 $at_failed && at_fn_log_failure
2300 $at_traceon; }
2301
2302 { set +x
2303 printf "%s\n" "$at_srcdir/envelope.at:19: mbop -m inbox 2 \\; env_date \\; env_sender"
2304 at_fn_check_prepare_trace "envelope.at:19"
2305 ( $at_check_trace; mbop -m inbox 2 \; env_date \; env_sender
2306 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2307 at_status=$? at_failed=false
2308 $at_check_filter
2309 at_fn_diff_devnull "$at_stderr" || at_failed=:
2310 echo >>"$at_stdout"; printf "%s\n" "2 current message
2311 2 env_date: Fri Dec 28 20:18:08 2001
2312 2 env_sender: [email protected]
2313 " | \
2314 $at_diff - "$at_stdout" || at_failed=:
2315 at_fn_check_status 0 $at_status "$at_srcdir/envelope.at:19"
2316 $at_failed && at_fn_log_failure
2317 $at_traceon; }
2318
2319 set +x
2320 $at_times_p && times >"$at_times_file"
2321 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2322 read at_status <"$at_status_file"
2323 #AT_STOP_4
2324 #AT_START_5
2325 at_fn_group_banner 5 'header.at:17' \
2326 "header" " "
2327 at_xfail=no
2328 (
2329 printf "%s\n" "5. $at_setup_line: testing $at_desc ..."
2330 $at_traceon
2331
2332 cat >commands <<'_ATEOF'
2333 1
2334 header_lines
2335 header_size
2336 header_count
2337 headers
2338 2
2339 header_lines
2340 header_size
2341 header_count
2342 headers
2343 _ATEOF
2344
2345 { set +x
2346 printf "%s\n" "$at_srcdir/header.at:30: mbox2dir -m inbox \$spooldir/mbox1"
2347 at_fn_check_prepare_dynamic "mbox2dir -m inbox $spooldir/mbox1" "header.at:30"
2348 ( $at_check_trace; mbox2dir -m inbox $spooldir/mbox1
2349 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2350 at_status=$? at_failed=false
2351 $at_check_filter
2352 at_fn_diff_devnull "$at_stderr" || at_failed=:
2353 at_fn_diff_devnull "$at_stdout" || at_failed=:
2354 at_fn_check_status 0 $at_status "$at_srcdir/header.at:30"
2355 $at_failed && at_fn_log_failure
2356 $at_traceon; }
2357
2358 { set +x
2359 printf "%s\n" "$at_srcdir/header.at:31:
2360 mbop -m inbox < commands
2361 "
2362 at_fn_check_prepare_notrace 'an embedded newline' "header.at:31"
2363 ( $at_check_trace;
2364 mbop -m inbox < commands
2365
2366 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2367 at_status=$? at_failed=false
2368 $at_check_filter
2369 at_fn_diff_devnull "$at_stderr" || at_failed=:
2370 echo >>"$at_stdout"; printf "%s\n" "1 current message
2371 1 header_lines: 9
2372 1 header_size: 317
2373 1 header_count: 6
2374 1 headers: Received:(from [email protected]) by nonexistent.net id fBSKI8N04906 for [email protected]; Fri, 28 Dec 2001 22:18:08 +0200
2375 Date:Fri, 28 Dec 2001 22:18:08 +0200
2376 From:Foo Bar <[email protected]>
2377 Message-Id:<[email protected]>
2378 To:Bar <[email protected]>
2379 Subject:Jabberwocky
2380
2381 2 current message
2382 2 header_lines: 9
2383 2 header_size: 319
2384 2 header_count: 6
2385 2 headers: Received:(from [email protected]) by dontmailme.org id fERKR9N16790 for [email protected]; Fri, 28 Dec 2001 22:18:08 +0200
2386 Date:Fri, 28 Dec 2001 23:28:08 +0200
2387 From:Bar <[email protected]>
2388 To:Foo Bar <[email protected]>
2389 Message-Id:<[email protected]>
2390 Subject:Re: Jabberwocky
2391
2392 " | \
2393 $at_diff - "$at_stdout" || at_failed=:
2394 at_fn_check_status 0 $at_status "$at_srcdir/header.at:31"
2395 $at_failed && at_fn_log_failure
2396 $at_traceon; }
2397
2398 set +x
2399 $at_times_p && times >"$at_times_file"
2400 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2401 read at_status <"$at_status_file"
2402 #AT_STOP_5
2403 #AT_START_6
2404 at_fn_group_banner 6 'body.at:17' \
2405 "body" " "
2406 at_xfail=no
2407 (
2408 printf "%s\n" "6. $at_setup_line: testing $at_desc ..."
2409 $at_traceon
2410
2411 cat >commands <<'_ATEOF'
2412 1
2413 body_lines
2414 body_size
2415 body_text
2416 2
2417 body_lines
2418 body_size
2419 body_text
2420 _ATEOF
2421
2422 { set +x
2423 printf "%s\n" "$at_srcdir/body.at:28: mbox2dir -m inbox \$spooldir/mbox1"
2424 at_fn_check_prepare_dynamic "mbox2dir -m inbox $spooldir/mbox1" "body.at:28"
2425 ( $at_check_trace; mbox2dir -m inbox $spooldir/mbox1
2426 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2427 at_status=$? at_failed=false
2428 $at_check_filter
2429 at_fn_diff_devnull "$at_stderr" || at_failed=:
2430 at_fn_diff_devnull "$at_stdout" || at_failed=:
2431 at_fn_check_status 0 $at_status "$at_srcdir/body.at:28"
2432 $at_failed && at_fn_log_failure
2433 $at_traceon; }
2434
2435
2436 { set +x
2437 printf "%s\n" "$at_srcdir/body.at:30:
2438 mbop -m inbox < commands
2439 "
2440 at_fn_check_prepare_notrace 'an embedded newline' "body.at:30"
2441 ( $at_check_trace;
2442 mbop -m inbox < commands
2443
2444 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2445 at_status=$? at_failed=false
2446 $at_check_filter
2447 at_fn_diff_devnull "$at_stderr" || at_failed=:
2448 echo >>"$at_stdout"; printf "%s\n" "1 current message
2449 1 body_lines: 35
2450 1 body_size: 937
2451 1 body_text: \`Twas brillig, and the slithy toves
2452 Did gyre and gimble in the wabe;
2453 All mimsy were the borogoves,
2454 And the mome raths outgrabe.
2455
2456 \`Beware the Jabberwock, my son!
2457 The jaws that bite, the claws that catch!
2458 Beware the Jujub bird, and shun
2459 The frumious Bandersnatch!'
2460
2461 He took his vorpal sword in hand:
2462 Long time the manxome foe he sought --
2463 So rested he by the Tumtum gree,
2464 And stood awhile in thought.
2465
2466 And as in uffish thought he stood,
2467 The Jabberwock, with eyes of flame,
2468 Came whiffling through the tulgey wook,
2469 And burbled as it came!
2470
2471 One, two! One, two! And through and through
2472 The vorpal blade went snicker-snack!
2473 He left it dead, and with its head
2474 He went galumphing back.
2475
2476 \`And has thou slain the Jabberwock?
2477 Come to my arms, my beamish boy!
2478 O frabjous day! Calloh! Callay!
2479 He chortled in his joy.
2480
2481 \`Twas brillig, and the slithy toves
2482 Did gyre and gimble in the wabe;
2483 All mimsy were the borogoves,
2484 And the mome raths outgrabe.
2485
2486
2487 2 current message
2488 2 body_lines: 4
2489 2 body_size: 215
2490 2 body_text: It seems very pretty, but it's *rather* hard to understand!'
2491 Somehow it seems to fill my head with ideas -- only I don't
2492 exactly know what they are! However, SOMEBODY killed SOMETHING:
2493 that's clear, at any rate...
2494
2495 " | \
2496 $at_diff - "$at_stdout" || at_failed=:
2497 at_fn_check_status 0 $at_status "$at_srcdir/body.at:30"
2498 $at_failed && at_fn_log_failure
2499 $at_traceon; }
2500
2501 set +x
2502 $at_times_p && times >"$at_times_file"
2503 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2504 read at_status <"$at_status_file"
2505 #AT_STOP_6
2506 #AT_START_7
2507 at_fn_group_banner 7 'uid.at:17' \
2508 "uid" " "
2509 at_xfail=no
2510 (
2511 printf "%s\n" "7. $at_setup_line: testing $at_desc ..."
2512 $at_traceon
2513
2514 cat >names <<'_ATEOF'
2515 1
2516 20
2517 22
2518 43
2519 50
2520 _ATEOF
2521
2522 { set +x
2523 printf "%s\n" "$at_srcdir/uid.at:25: mbox2dir -m -i names inbox \$spooldir/mbox1"
2524 at_fn_check_prepare_dynamic "mbox2dir -m -i names inbox $spooldir/mbox1" "uid.at:25"
2525 ( $at_check_trace; mbox2dir -m -i names inbox $spooldir/mbox1
2526 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2527 at_status=$? at_failed=false
2528 $at_check_filter
2529 at_fn_diff_devnull "$at_stderr" || at_failed=:
2530 at_fn_diff_devnull "$at_stdout" || at_failed=:
2531 at_fn_check_status 0 $at_status "$at_srcdir/uid.at:25"
2532 $at_failed && at_fn_log_failure
2533 $at_traceon; }
2534
2535 { set +x
2536 printf "%s\n" "$at_srcdir/uid.at:26:
2537 mbop -m inbox 1 \\; uid \\; 2 \\; uid \\; 3 \\; uid \\; 4 \\; uid \\; 5 \\; uid
2538 "
2539 at_fn_check_prepare_notrace 'an embedded newline' "uid.at:26"
2540 ( $at_check_trace;
2541 mbop -m inbox 1 \; uid \; 2 \; uid \; 3 \; uid \; 4 \; uid \; 5 \; uid
2542
2543 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2544 at_status=$? at_failed=false
2545 $at_check_filter
2546 at_fn_diff_devnull "$at_stderr" || at_failed=:
2547 echo >>"$at_stdout"; printf "%s\n" "1 current message
2548 1 uid: 1
2549 2 current message
2550 2 uid: 20
2551 3 current message
2552 3 uid: 22
2553 4 current message
2554 4 uid: 43
2555 5 current message
2556 5 uid: 50
2557 " | \
2558 $at_diff - "$at_stdout" || at_failed=:
2559 at_fn_check_status 0 $at_status "$at_srcdir/uid.at:26"
2560 $at_failed && at_fn_log_failure
2561 $at_traceon; }
2562
2563 set +x
2564 $at_times_p && times >"$at_times_file"
2565 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2566 read at_status <"$at_status_file"
2567 #AT_STOP_7
2568 #AT_START_8
2569 at_fn_group_banner 8 'uidvalidity.at:17' \
2570 "uidvalidity" " "
2571 at_xfail=no
2572 (
2573 printf "%s\n" "8. $at_setup_line: testing $at_desc ..."
2574 $at_traceon
2575
2576 cat >names <<'_ATEOF'
2577 1
2578 20
2579 22
2580 43
2581 50
2582 _ATEOF
2583
2584 { set +x
2585 printf "%s\n" "$at_srcdir/uidvalidity.at:25: mbox2dir -m -i names -p -v 10 inbox \$spooldir/mbox1"
2586 at_fn_check_prepare_dynamic "mbox2dir -m -i names -p -v 10 inbox $spooldir/mbox1" "uidvalidity.at:25"
2587 ( $at_check_trace; mbox2dir -m -i names -p -v 10 inbox $spooldir/mbox1
2588 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2589 at_status=$? at_failed=false
2590 $at_check_filter
2591 at_fn_diff_devnull "$at_stderr" || at_failed=:
2592 at_fn_diff_devnull "$at_stdout" || at_failed=:
2593 at_fn_check_status 0 $at_status "$at_srcdir/uidvalidity.at:25"
2594 $at_failed && at_fn_log_failure
2595 $at_traceon; }
2596
2597 { set +x
2598 printf "%s\n" "$at_srcdir/uidvalidity.at:26:
2599 mbop -m inbox uidvalidity \\; uidnext
2600 "
2601 at_fn_check_prepare_notrace 'an embedded newline' "uidvalidity.at:26"
2602 ( $at_check_trace;
2603 mbop -m inbox uidvalidity \; uidnext
2604
2605 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2606 at_status=$? at_failed=false
2607 $at_check_filter
2608 at_fn_diff_devnull "$at_stderr" || at_failed=:
2609 echo >>"$at_stdout"; printf "%s\n" "uidvalidity: 10
2610 uidnext: 51
2611 " | \
2612 $at_diff - "$at_stdout" || at_failed=:
2613 at_fn_check_status 0 $at_status "$at_srcdir/uidvalidity.at:26"
2614 $at_failed && at_fn_log_failure
2615 $at_traceon; }
2616
2617 set +x
2618 $at_times_p && times >"$at_times_file"
2619 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2620 read at_status <"$at_status_file"
2621 #AT_STOP_8
2622 #AT_START_9
2623 at_fn_group_banner 9 'qget.at:17' \
2624 "qget access" " "
2625 at_xfail=no
2626 (
2627 printf "%s\n" "9. $at_setup_line: testing $at_desc ..."
2628 $at_traceon
2629
2630 { set +x
2631 printf "%s\n" "$at_srcdir/qget.at:18: mbox2dir -m -p -v 10 inbox \$spooldir/mbox1"
2632 at_fn_check_prepare_dynamic "mbox2dir -m -p -v 10 inbox $spooldir/mbox1" "qget.at:18"
2633 ( $at_check_trace; mbox2dir -m -p -v 10 inbox $spooldir/mbox1
2634 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2635 at_status=$? at_failed=false
2636 $at_check_filter
2637 at_fn_diff_devnull "$at_stderr" || at_failed=:
2638 at_fn_diff_devnull "$at_stdout" || at_failed=:
2639 at_fn_check_status 0 $at_status "$at_srcdir/qget.at:18"
2640 $at_failed && at_fn_log_failure
2641 $at_traceon; }
2642
2643 { set +x
2644 printf "%s\n" "$at_srcdir/qget.at:19:
2645 mbop -m inbox qget 2
2646 "
2647 at_fn_check_prepare_notrace 'an embedded newline' "qget.at:19"
2648 ( $at_check_trace;
2649 mbop -m inbox qget 2
2650
2651 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2652 at_status=$? at_failed=false
2653 $at_check_filter
2654 at_fn_diff_devnull "$at_stderr" || at_failed=:
2655 echo >>"$at_stdout"; printf "%s\n" "qget: Received: (from [email protected])
2656 by dontmailme.org id fERKR9N16790
2657 for [email protected]; Fri, 28 Dec 2001 22:18:08 +0200
2658 Date: Fri, 28 Dec 2001 23:28:08 +0200
2659 From: Bar <[email protected]>
2660 To: Foo Bar <[email protected]>
2661 Message-Id: <[email protected]>
2662 Subject: Re: Jabberwocky
2663
2664 It seems very pretty, but it's *rather* hard to understand!'
2665 Somehow it seems to fill my head with ideas -- only I don't
2666 exactly know what they are! However, SOMEBODY killed SOMETHING:
2667 that's clear, at any rate...
2668
2669 " | \
2670 $at_diff - "$at_stdout" || at_failed=:
2671 at_fn_check_status 0 $at_status "$at_srcdir/qget.at:19"
2672 $at_failed && at_fn_log_failure
2673 $at_traceon; }
2674
2675 set +x
2676 $at_times_p && times >"$at_times_file"
2677 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2678 read at_status <"$at_status_file"
2679 #AT_STOP_9
2680 #AT_START_10
2681 at_fn_group_banner 10 'append.at:17' \
2682 "append" " "
2683 at_xfail=no
2684 (
2685 printf "%s\n" "10. $at_setup_line: testing $at_desc ..."
2686 $at_traceon
2687
2688 { set +x
2689 printf "%s\n" "$at_srcdir/append.at:18: mbox2dir -m -p -v 10 -u inbox \$spooldir/mbox1"
2690 at_fn_check_prepare_dynamic "mbox2dir -m -p -v 10 -u inbox $spooldir/mbox1" "append.at:18"
2691 ( $at_check_trace; mbox2dir -m -p -v 10 -u inbox $spooldir/mbox1
2692 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2693 at_status=$? at_failed=false
2694 $at_check_filter
2695 at_fn_diff_devnull "$at_stderr" || at_failed=:
2696 at_fn_diff_devnull "$at_stdout" || at_failed=:
2697 at_fn_check_status 0 $at_status "$at_srcdir/append.at:18"
2698 $at_failed && at_fn_log_failure
2699 $at_traceon; }
2700
2701 cat >msg <<'_ATEOF'
2702 Received: (from [email protected])
2703 by wonder.land id 3304
2704 for [email protected]; Mon, 29 Jul 2002 22:00:09 +0100
2705 Date: Mon, 29 Jul 2002 22:00:04 +0100
2706 From: Alice <[email protected]>
2707 Message-Id: <[email protected]>
2708 To: March Hare <[email protected]>
2709 Subject: Re: Invitation
2710 Status: P
2711
2712 Then it wasn't very civil of you to offer it
2713 _ATEOF
2714
2715 cat >commands <<'_ATEOF'
2716 append msg
2717 count
2718 6
2719 uid
2720 env_date
2721 env_sender
2722 attr
2723 headers
2724 body_text
2725 _ATEOF
2726
2727 { set +x
2728 printf "%s\n" "$at_srcdir/append.at:43:
2729 mbop -m inbox < commands
2730 "
2731 at_fn_check_prepare_notrace 'an embedded newline' "append.at:43"
2732 ( $at_check_trace;
2733 mbop -m inbox < commands
2734
2735 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2736 at_status=$? at_failed=false
2737 $at_check_filter
2738 at_fn_diff_devnull "$at_stderr" || at_failed=:
2739 echo >>"$at_stdout"; printf "%s\n" "append: OK
2740 count: 6
2741 6 current message
2742 6 uid: 6
2743 6 env_date: Mon Jul 29 21:00:09 2002
2744 6 env_sender: [email protected]
2745 6 attr: -
2746 6 headers: Received:(from [email protected]) by wonder.land id 3304 for [email protected]; Mon, 29 Jul 2002 22:00:09 +0100
2747 Date:Mon, 29 Jul 2002 22:00:04 +0100
2748 From:Alice <[email protected]>
2749 Message-Id:<[email protected]>
2750 To:March Hare <[email protected]>
2751 Subject:Re: Invitation
2752
2753 6 body_text: Then it wasn't very civil of you to offer it
2754
2755 " | \
2756 $at_diff - "$at_stdout" || at_failed=:
2757 at_fn_check_status 0 $at_status "$at_srcdir/append.at:43"
2758 $at_failed && at_fn_log_failure
2759 $at_traceon; }
2760
2761
2762 cat >commands.atr <<'_ATEOF'
2763 append -attr FRP msg
2764 count
2765 7
2766 uid
2767 env_date
2768 env_sender
2769 attr
2770 headers
2771 body_text
2772 _ATEOF
2773
2774 { set +x
2775 printf "%s\n" "$at_srcdir/append.at:76:
2776 mbop -m inbox < commands.atr
2777 "
2778 at_fn_check_prepare_notrace 'an embedded newline' "append.at:76"
2779 ( $at_check_trace;
2780 mbop -m inbox < commands.atr
2781
2782 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2783 at_status=$? at_failed=false
2784 $at_check_filter
2785 at_fn_diff_devnull "$at_stderr" || at_failed=:
2786 echo >>"$at_stdout"; printf "%s\n" "append: OK
2787 count: 7
2788 7 current message
2789 7 uid: 7
2790 7 env_date: Mon Jul 29 21:00:09 2002
2791 7 env_sender: [email protected]
2792 7 attr: FPR
2793 7 headers: Received:(from [email protected]) by wonder.land id 3304 for [email protected]; Mon, 29 Jul 2002 22:00:09 +0100
2794 Date:Mon, 29 Jul 2002 22:00:04 +0100
2795 From:Alice <[email protected]>
2796 Message-Id:<[email protected]>
2797 To:March Hare <[email protected]>
2798 Subject:Re: Invitation
2799 Status:FPR
2800
2801 7 body_text: Then it wasn't very civil of you to offer it
2802
2803 " | \
2804 $at_diff - "$at_stdout" || at_failed=:
2805 at_fn_check_status 0 $at_status "$at_srcdir/append.at:76"
2806 $at_failed && at_fn_log_failure
2807 $at_traceon; }
2808
2809
2810 cat >commands.ae <<'_ATEOF'
2811 append -sender [email protected] -date 'Sat Dec 4 08:00:00 2021' -attr FRP msg
2812 count
2813 8
2814 uid
2815 env_date
2816 env_sender
2817 attr
2818 headers
2819 body_text
2820 _ATEOF
2821
2822
2823 { set +x
2824 printf "%s\n" "$at_srcdir/append.at:111: TZ=0 mbop -m inbox < commands.ae"
2825 at_fn_check_prepare_trace "append.at:111"
2826 ( $at_check_trace; TZ=0 mbop -m inbox < commands.ae
2827 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2828 at_status=$? at_failed=false
2829 $at_check_filter
2830 at_fn_diff_devnull "$at_stderr" || at_failed=:
2831 echo >>"$at_stdout"; printf "%s\n" "append: OK
2832 count: 8
2833 8 current message
2834 8 uid: 8
2835 8 env_date: Sat Dec 4 08:00:00 2021
2836 8 env_sender: [email protected]
2837 8 attr: FPR
2838 8 headers: Return-Path:[email protected]
2839 Received:from localhost by localhost; Sat, 4 Dec 2021 08:00:00 +0000
2840 Received:(from [email protected]) by wonder.land id 3304 for [email protected]; Mon, 29 Jul 2002 22:00:09 +0100
2841 Date:Mon, 29 Jul 2002 22:00:04 +0100
2842 From:Alice <[email protected]>
2843 Message-Id:<[email protected]>
2844 To:March Hare <[email protected]>
2845 Subject:Re: Invitation
2846 Status:FPR
2847
2848 8 body_text: Then it wasn't very civil of you to offer it
2849
2850 " | \
2851 $at_diff - "$at_stdout" || at_failed=:
2852 at_fn_check_status 0 $at_status "$at_srcdir/append.at:111"
2853 $at_failed && at_fn_log_failure
2854 $at_traceon; }
2855
2856
2857 { set +x
2858 printf "%s\n" "$at_srcdir/append.at:134:
2859 mbop -m inbox uidvalidity
2860 "
2861 at_fn_check_prepare_notrace 'an embedded newline' "append.at:134"
2862 ( $at_check_trace;
2863 mbop -m inbox uidvalidity
2864
2865 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2866 at_status=$? at_failed=false
2867 $at_check_filter
2868 at_fn_diff_devnull "$at_stderr" || at_failed=:
2869 echo >>"$at_stdout"; printf "%s\n" "uidvalidity: 10
2870 " | \
2871 $at_diff - "$at_stdout" || at_failed=:
2872 at_fn_check_status 0 $at_status "$at_srcdir/append.at:134"
2873 $at_failed && at_fn_log_failure
2874 $at_traceon; }
2875
2876 set +x
2877 $at_times_p && times >"$at_times_file"
2878 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2879 read at_status <"$at_status_file"
2880 #AT_STOP_10
2881 #AT_START_11
2882 at_fn_group_banner 11 'notify.at:17' \
2883 "append notification" " "
2884 at_xfail=no
2885 (
2886 printf "%s\n" "11. $at_setup_line: testing $at_desc ..."
2887 $at_traceon
2888
2889 { set +x
2890 printf "%s\n" "$at_srcdir/notify.at:18: mbox2dir -m -p -v 10 -u inbox \$spooldir/mbox1"
2891 at_fn_check_prepare_dynamic "mbox2dir -m -p -v 10 -u inbox $spooldir/mbox1" "notify.at:18"
2892 ( $at_check_trace; mbox2dir -m -p -v 10 -u inbox $spooldir/mbox1
2893 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2894 at_status=$? at_failed=false
2895 $at_check_filter
2896 at_fn_diff_devnull "$at_stderr" || at_failed=:
2897 at_fn_diff_devnull "$at_stdout" || at_failed=:
2898 at_fn_check_status 0 $at_status "$at_srcdir/notify.at:18"
2899 $at_failed && at_fn_log_failure
2900 $at_traceon; }
2901
2902 cat >msg <<'_ATEOF'
2903 Received: (from [email protected])
2904 by wonder.land id 3304
2905 for [email protected]; Mon, 29 Jul 2002 22:00:09 +0100
2906 Date: Mon, 29 Jul 2002 22:00:04 +0100
2907 From: Alice <[email protected]>
2908 Message-Id: <[email protected]>
2909 To: March Hare <[email protected]>
2910 Subject: Re: Invitation
2911 Return-Path: [email protected]
2912
2913 Then it wasn't very civil of you to offer it
2914 _ATEOF
2915
2916 { set +x
2917 printf "%s\n" "$at_srcdir/notify.at:32:
2918 mbop -m inbox --notify append msg
2919 "
2920 at_fn_check_prepare_notrace 'an embedded newline' "notify.at:32"
2921 ( $at_check_trace;
2922 mbop -m inbox --notify append msg
2923
2924 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2925 at_status=$? at_failed=false
2926 $at_check_filter
2927 echo >>"$at_stderr"; printf "%s\n" "mbop: new message: Alice <[email protected]> Re: Invitation
2928 " | \
2929 $at_diff - "$at_stderr" || at_failed=:
2930 echo >>"$at_stdout"; printf "%s\n" "append: OK
2931 " | \
2932 $at_diff - "$at_stdout" || at_failed=:
2933 at_fn_check_status 0 $at_status "$at_srcdir/notify.at:32"
2934 $at_failed && at_fn_log_failure
2935 $at_traceon; }
2936
2937 set +x
2938 $at_times_p && times >"$at_times_file"
2939 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2940 read at_status <"$at_status_file"
2941 #AT_STOP_11
2942 #AT_START_12
2943 at_fn_group_banner 12 'delete.at:17' \
2944 "delete" " "
2945 at_xfail=no
2946 (
2947 printf "%s\n" "12. $at_setup_line: testing $at_desc ..."
2948 $at_traceon
2949
2950 { set +x
2951 printf "%s\n" "$at_srcdir/delete.at:18: mbox2dir -m -p -v 10 -u inbox \$spooldir/mbox1"
2952 at_fn_check_prepare_dynamic "mbox2dir -m -p -v 10 -u inbox $spooldir/mbox1" "delete.at:18"
2953 ( $at_check_trace; mbox2dir -m -p -v 10 -u inbox $spooldir/mbox1
2954 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2955 at_status=$? at_failed=false
2956 $at_check_filter
2957 at_fn_diff_devnull "$at_stderr" || at_failed=:
2958 at_fn_diff_devnull "$at_stdout" || at_failed=:
2959 at_fn_check_status 0 $at_status "$at_srcdir/delete.at:18"
2960 $at_failed && at_fn_log_failure
2961 $at_traceon; }
2962
2963 cat >commands <<'_ATEOF'
2964 3
2965 set_deleted
2966 expunge
2967 # Message 4 becomes 3 after expunge. Re-select it.
2968 3
2969 uid
2970 headers
2971 _ATEOF
2972
2973 { set +x
2974 printf "%s\n" "$at_srcdir/delete.at:28:
2975 mbop -m inbox < commands
2976 "
2977 at_fn_check_prepare_notrace 'an embedded newline' "delete.at:28"
2978 ( $at_check_trace;
2979 mbop -m inbox < commands
2980
2981 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2982 at_status=$? at_failed=false
2983 $at_check_filter
2984 at_fn_diff_devnull "$at_stderr" || at_failed=:
2985 echo >>"$at_stdout"; printf "%s\n" "3 current message
2986 3 set_deleted: OK
2987 expunge: OK
2988 3 current message
2989 3 uid: 4
2990 3 headers: Organization:Mailutils-tests
2991 Received:from example.net (localhost [127.0.0.1]) by example.net with ESMTP id g6CLowb05126 for <[email protected]>; Sat, 13 Jul 2002 00:50:58 +0300
2992 Message-Id:<[email protected]>
2993 To:Foo Bar <[email protected]>
2994 Subject:Nested MIME
2995 MIME-Version:1.0
2996 Content-Type:multipart/mixed; boundary=\"----- =_aaaaaaaaaa0\"
2997 Content-ID:<[email protected]>
2998 Date:Sat, 13 Jul 2002 00:50:58 +0300
2999 From:Sergey Poznyakoff <[email protected]>
3000
3001 " | \
3002 $at_diff - "$at_stdout" || at_failed=:
3003 at_fn_check_status 0 $at_status "$at_srcdir/delete.at:28"
3004 $at_failed && at_fn_log_failure
3005 $at_traceon; }
3006
3007 set +x
3008 $at_times_p && times >"$at_times_file"
3009 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
3010 read at_status <"$at_status_file"
3011 #AT_STOP_12
3012 #AT_START_13
3013 at_fn_group_banner 13 'uidnext.at:17' \
3014 "UID monotonicity" " "
3015 at_xfail=no
3016 (
3017 printf "%s\n" "13. $at_setup_line: testing $at_desc ..."
3018 $at_traceon
3019
3020 { set +x
3021 printf "%s\n" "$at_srcdir/uidnext.at:18: mbox2dir -m -p -v 10 -u inbox \$spooldir/mbox1"
3022 at_fn_check_prepare_dynamic "mbox2dir -m -p -v 10 -u inbox $spooldir/mbox1" "uidnext.at:18"
3023 ( $at_check_trace; mbox2dir -m -p -v 10 -u inbox $spooldir/mbox1
3024 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3025 at_status=$? at_failed=false
3026 $at_check_filter
3027 at_fn_diff_devnull "$at_stderr" || at_failed=:
3028 at_fn_diff_devnull "$at_stdout" || at_failed=:
3029 at_fn_check_status 0 $at_status "$at_srcdir/uidnext.at:18"
3030 $at_failed && at_fn_log_failure
3031 $at_traceon; }
3032
3033
3034 { set +x
3035 printf "%s\n" "$at_srcdir/uidnext.at:20: mbop -m inbox uidnext \\; uidvalidity"
3036 at_fn_check_prepare_trace "uidnext.at:20"
3037 ( $at_check_trace; mbop -m inbox uidnext \; uidvalidity
3038 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3039 at_status=$? at_failed=false
3040 $at_check_filter
3041 at_fn_diff_devnull "$at_stderr" || at_failed=:
3042 echo >>"$at_stdout"; printf "%s\n" "uidnext: 6
3043 uidvalidity: 10
3044 " | \
3045 $at_diff - "$at_stdout" || at_failed=:
3046 at_fn_check_status 0 $at_status "$at_srcdir/uidnext.at:20"
3047 $at_failed && at_fn_log_failure
3048 $at_traceon; }
3049
3050
3051 { set +x
3052 printf "%s\n" "$at_srcdir/uidnext.at:26: mbop -m inbox 5 \\; set_deleted \\; expunge"
3053 at_fn_check_prepare_trace "uidnext.at:26"
3054 ( $at_check_trace; mbop -m inbox 5 \; set_deleted \; expunge
3055 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3056 at_status=$? at_failed=false
3057 $at_check_filter
3058 at_fn_diff_devnull "$at_stderr" || at_failed=:
3059 echo >>"$at_stdout"; printf "%s\n" "5 current message
3060 5 set_deleted: OK
3061 expunge: OK
3062 " | \
3063 $at_diff - "$at_stdout" || at_failed=:
3064 at_fn_check_status 0 $at_status "$at_srcdir/uidnext.at:26"
3065 $at_failed && at_fn_log_failure
3066 $at_traceon; }
3067
3068
3069 { set +x
3070 printf "%s\n" "$at_srcdir/uidnext.at:33: mbop -m inbox uidnext \\; uidvalidity"
3071 at_fn_check_prepare_trace "uidnext.at:33"
3072 ( $at_check_trace; mbop -m inbox uidnext \; uidvalidity
3073 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3074 at_status=$? at_failed=false
3075 $at_check_filter
3076 at_fn_diff_devnull "$at_stderr" || at_failed=:
3077 echo >>"$at_stdout"; printf "%s\n" "uidnext: 6
3078 uidvalidity: 10
3079 " | \
3080 $at_diff - "$at_stdout" || at_failed=:
3081 at_fn_check_status 0 $at_status "$at_srcdir/uidnext.at:33"
3082 $at_failed && at_fn_log_failure
3083 $at_traceon; }
3084
3085
3086 cat >msg <<'_ATEOF'
3087 Received: (from [email protected])
3088 by wonder.land id 3304
3089 for [email protected]; Mon, 29 Jul 2002 22:00:09 +0100
3090 Date: Mon, 29 Jul 2002 22:00:04 +0100
3091 From: Alice <[email protected]>
3092 Message-Id: <[email protected]>
3093 To: March Hare <[email protected]>
3094 Subject: Re: Invitation
3095 Return-Path: [email protected]
3096
3097 Then it wasn't very civil of you to offer it
3098 _ATEOF
3099
3100
3101 { set +x
3102 printf "%s\n" "$at_srcdir/uidnext.at:53: mbop -m inbox append msg \\; count \\; 5 \\; uid \\; uidnext"
3103 at_fn_check_prepare_trace "uidnext.at:53"
3104 ( $at_check_trace; mbop -m inbox append msg \; count \; 5 \; uid \; uidnext
3105 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3106 at_status=$? at_failed=false
3107 $at_check_filter
3108 at_fn_diff_devnull "$at_stderr" || at_failed=:
3109 echo >>"$at_stdout"; printf "%s\n" "append: OK
3110 count: 5
3111 5 current message
3112 5 uid: 6
3113 uidnext: 7
3114 " | \
3115 $at_diff - "$at_stdout" || at_failed=:
3116 at_fn_check_status 0 $at_status "$at_srcdir/uidnext.at:53"
3117 $at_failed && at_fn_log_failure
3118 $at_traceon; }
3119
3120
3121 { set +x
3122 printf "%s\n" "$at_srcdir/uidnext.at:62: mbop -m inbox uidnext \\; uidvalidity"
3123 at_fn_check_prepare_trace "uidnext.at:62"
3124 ( $at_check_trace; mbop -m inbox uidnext \; uidvalidity
3125 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3126 at_status=$? at_failed=false
3127 $at_check_filter
3128 at_fn_diff_devnull "$at_stderr" || at_failed=:
3129 echo >>"$at_stdout"; printf "%s\n" "uidnext: 7
3130 uidvalidity: 10
3131 " | \
3132 $at_diff - "$at_stdout" || at_failed=:
3133 at_fn_check_status 0 $at_status "$at_srcdir/uidnext.at:62"
3134 $at_failed && at_fn_log_failure
3135 $at_traceon; }
3136
3137
3138 set +x
3139 $at_times_p && times >"$at_times_file"
3140 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
3141 read at_status <"$at_status_file"
3142 #AT_STOP_13
3143 #AT_START_14
3144 at_fn_group_banner 14 'uidvol.at:17' \
3145 "Volatile UIDs (traditional MH behavior)" " "
3146 at_xfail=no
3147 (
3148 printf "%s\n" "14. $at_setup_line: testing $at_desc ..."
3149 $at_traceon
3150
3151
3152 # Create the test MH mailbox
3153 { set +x
3154 printf "%s\n" "$at_srcdir/uidvol.at:20: mbox2dir -m -p -v 10 -u inbox \$spooldir/mbox1"
3155 at_fn_check_prepare_dynamic "mbox2dir -m -p -v 10 -u inbox $spooldir/mbox1" "uidvol.at:20"
3156 ( $at_check_trace; mbox2dir -m -p -v 10 -u inbox $spooldir/mbox1
3157 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3158 at_status=$? at_failed=false
3159 $at_check_filter
3160 at_fn_diff_devnull "$at_stderr" || at_failed=:
3161 at_fn_diff_devnull "$at_stdout" || at_failed=:
3162 at_fn_check_status 0 $at_status "$at_srcdir/uidvol.at:20"
3163 $at_failed && at_fn_log_failure
3164 $at_traceon; }
3165
3166
3167 # Check its current UID settings
3168 { set +x
3169 printf "%s\n" "$at_srcdir/uidvol.at:23: mbop -m inbox uidnext \\; uidvalidity"
3170 at_fn_check_prepare_trace "uidvol.at:23"
3171 ( $at_check_trace; mbop -m inbox uidnext \; uidvalidity
3172 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3173 at_status=$? at_failed=false
3174 $at_check_filter
3175 at_fn_diff_devnull "$at_stderr" || at_failed=:
3176 echo >>"$at_stdout"; printf "%s\n" "uidnext: 6
3177 uidvalidity: 10
3178 " | \
3179 $at_diff - "$at_stdout" || at_failed=:
3180 at_fn_check_status 0 $at_status "$at_srcdir/uidvol.at:23"
3181 $at_failed && at_fn_log_failure
3182 $at_traceon; }
3183
3184
3185 # Request traditional MH behavior.
3186 cat >mh_profile <<'_ATEOF'
3187 Volatile-uidnext: true
3188 _ATEOF
3189
3190
3191 # Remove the penultimate message. This should not affect uidvalidity.
3192 { set +x
3193 printf "%s\n" "$at_srcdir/uidvol.at:35: MH=mh_profile mbop -m inbox 4 \\; set_deleted \\; expunge"
3194 at_fn_check_prepare_trace "uidvol.at:35"
3195 ( $at_check_trace; MH=mh_profile mbop -m inbox 4 \; set_deleted \; expunge
3196 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3197 at_status=$? at_failed=false
3198 $at_check_filter
3199 at_fn_diff_devnull "$at_stderr" || at_failed=:
3200 echo >>"$at_stdout"; printf "%s\n" "4 current message
3201 4 set_deleted: OK
3202 expunge: OK
3203 " | \
3204 $at_diff - "$at_stdout" || at_failed=:
3205 at_fn_check_status 0 $at_status "$at_srcdir/uidvol.at:35"
3206 $at_failed && at_fn_log_failure
3207 $at_traceon; }
3208
3209
3210 # Check if uidnext and uidvalidity remain the same.
3211 { set +x
3212 printf "%s\n" "$at_srcdir/uidvol.at:43: mbop -m inbox uidnext \\; uidvalidity"
3213 at_fn_check_prepare_trace "uidvol.at:43"
3214 ( $at_check_trace; mbop -m inbox uidnext \; uidvalidity
3215 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3216 at_status=$? at_failed=false
3217 $at_check_filter
3218 at_fn_diff_devnull "$at_stderr" || at_failed=:
3219 echo >>"$at_stdout"; printf "%s\n" "uidnext: 6
3220 uidvalidity: 10
3221 " | \
3222 $at_diff - "$at_stdout" || at_failed=:
3223 at_fn_check_status 0 $at_status "$at_srcdir/uidvol.at:43"
3224 $at_failed && at_fn_log_failure
3225 $at_traceon; }
3226
3227
3228 # Remove the last message. With Volatile-uidnext on, this will reset
3229 # uidnext to 4 (sequence number of the last message plus one) and
3230 # increase uidvalidity,
3231 { set +x
3232 printf "%s\n" "$at_srcdir/uidvol.at:52: MH=mh_profile mbop -m inbox 4 \\; set_deleted \\; expunge"
3233 at_fn_check_prepare_trace "uidvol.at:52"
3234 ( $at_check_trace; MH=mh_profile mbop -m inbox 4 \; set_deleted \; expunge
3235 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3236 at_status=$? at_failed=false
3237 $at_check_filter
3238 at_fn_diff_devnull "$at_stderr" || at_failed=:
3239 echo >>"$at_stdout"; printf "%s\n" "4 current message
3240 4 set_deleted: OK
3241 expunge: OK
3242 " | \
3243 $at_diff - "$at_stdout" || at_failed=:
3244 at_fn_check_status 0 $at_status "$at_srcdir/uidvol.at:52"
3245 $at_failed && at_fn_log_failure
3246 $at_traceon; }
3247
3248
3249 # Check if uidnext is computed correctly.
3250 { set +x
3251 printf "%s\n" "$at_srcdir/uidvol.at:60: MH=mh_profile mbop -m inbox uidnext"
3252 at_fn_check_prepare_trace "uidvol.at:60"
3253 ( $at_check_trace; MH=mh_profile mbop -m inbox uidnext
3254 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3255 at_status=$? at_failed=false
3256 $at_check_filter
3257 at_fn_diff_devnull "$at_stderr" || at_failed=:
3258 echo >>"$at_stdout"; printf "%s\n" "uidnext: 4
3259 " | \
3260 $at_diff - "$at_stdout" || at_failed=:
3261 at_fn_check_status 0 $at_status "$at_srcdir/uidvol.at:60"
3262 $at_failed && at_fn_log_failure
3263 $at_traceon; }
3264
3265
3266 # Check that uidvalidity has changed.
3267 # FIXME: Better check that it has *increased*.
3268 { set +x
3269 printf "%s\n" "$at_srcdir/uidvol.at:67: MH=mh_profile mbop -m inbox uidvalidity | grep -v '^uid-validity:10\$' | grep uid-validity || true"
3270 at_fn_check_prepare_notrace 'a shell pipeline' "uidvol.at:67"
3271 ( $at_check_trace; MH=mh_profile mbop -m inbox uidvalidity | grep -v '^uid-validity:10$' | grep uid-validity || true
3272 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3273 at_status=$? at_failed=false
3274 $at_check_filter
3275 at_fn_diff_devnull "$at_stderr" || at_failed=:
3276 at_fn_diff_devnull "$at_stdout" || at_failed=:
3277 at_fn_check_status 0 $at_status "$at_srcdir/uidvol.at:67"
3278 $at_failed && at_fn_log_failure
3279 $at_traceon; }
3280
3281
3282 set +x
3283 $at_times_p && times >"$at_times_file"
3284 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
3285 read at_status <"$at_status_file"
3286 #AT_STOP_14