Debian Codegraph @

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