Debian Codegraph @

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