Debian Codegraph @

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