Debian Codegraph @

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