Debian Codegraph @

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