Imported Upstream version 1.10
[platform/upstream/gdbm.git] / tests / testsuite
1 #! /bin/sh
2 # Generated from testsuite.at by GNU Autoconf 2.63.
3 #
4 # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
5 # Free Software Foundation, Inc.
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 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
15   emulate sh
16   NULLCMD=:
17   # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
18   # is contrary to our usage.  Disable this feature.
19   alias -g '${1+"$@"}'='"$@"'
20   setopt NO_GLOB_SUBST
21 else
22   case `(set -o) 2>/dev/null` in
23   *posix*) set -o posix ;;
24 esac
25
26 fi
27
28
29
30
31 # PATH needs CR
32 # Avoid depending upon Character Ranges.
33 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
34 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
35 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
36 as_cr_digits='0123456789'
37 as_cr_alnum=$as_cr_Letters$as_cr_digits
38
39 as_nl='
40 '
41 export as_nl
42 # Printing a long string crashes Solaris 7 /usr/bin/printf.
43 as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
44 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
45 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
46 if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
47   as_echo='printf %s\n'
48   as_echo_n='printf %s'
49 else
50   if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
51     as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
52     as_echo_n='/usr/ucb/echo -n'
53   else
54     as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
55     as_echo_n_body='eval
56       arg=$1;
57       case $arg in
58       *"$as_nl"*)
59         expr "X$arg" : "X\\(.*\\)$as_nl";
60         arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
61       esac;
62       expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
63     '
64     export as_echo_n_body
65     as_echo_n='sh -c $as_echo_n_body as_echo'
66   fi
67   export as_echo_body
68   as_echo='sh -c $as_echo_body as_echo'
69 fi
70
71 # The user is always right.
72 if test "${PATH_SEPARATOR+set}" != set; 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 # Support unset when possible.
81 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
82   as_unset=unset
83 else
84   as_unset=false
85 fi
86
87
88 # IFS
89 # We need space, tab and new line, in precisely that order.  Quoting is
90 # there to prevent editors from complaining about space-tab.
91 # (If _AS_PATH_WALK were called with IFS unset, it would disable word
92 # splitting by setting IFS to empty value.)
93 IFS=" ""        $as_nl"
94
95 # Find who we are.  Look in the path if we contain no directory separator.
96 case $0 in
97   *[\\/]* ) as_myself=$0 ;;
98   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
99 for as_dir in $PATH
100 do
101   IFS=$as_save_IFS
102   test -z "$as_dir" && as_dir=.
103   test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
104 done
105 IFS=$as_save_IFS
106
107      ;;
108 esac
109 # We did not find ourselves, most probably we were run as `sh COMMAND'
110 # in which case we are not to be found in the path.
111 if test "x$as_myself" = x; then
112   as_myself=$0
113 fi
114 if test ! -f "$as_myself"; then
115   $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
116   { (exit 1); exit 1; }
117 fi
118
119 # Work around bugs in pre-3.0 UWIN ksh.
120 for as_var in ENV MAIL MAILPATH
121 do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
122 done
123 PS1='$ '
124 PS2='> '
125 PS4='+ '
126
127 # NLS nuisances.
128 LC_ALL=C
129 export LC_ALL
130 LANGUAGE=C
131 export LANGUAGE
132
133 # Required to use basename.
134 if expr a : '\(a\)' >/dev/null 2>&1 &&
135    test "X`expr 00001 : '.*\(...\)'`" = X001; then
136   as_expr=expr
137 else
138   as_expr=false
139 fi
140
141 if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
142   as_basename=basename
143 else
144   as_basename=false
145 fi
146
147
148 # Name of the executable.
149 as_me=`$as_basename -- "$0" ||
150 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
151          X"$0" : 'X\(//\)$' \| \
152          X"$0" : 'X\(/\)' \| . 2>/dev/null ||
153 $as_echo X/"$0" |
154     sed '/^.*\/\([^/][^/]*\)\/*$/{
155             s//\1/
156             q
157           }
158           /^X\/\(\/\/\)$/{
159             s//\1/
160             q
161           }
162           /^X\/\(\/\).*/{
163             s//\1/
164             q
165           }
166           s/.*/./; q'`
167
168 # CDPATH.
169 $as_unset CDPATH
170
171
172 if test "x$CONFIG_SHELL" = x; then
173   if (eval ":") 2>/dev/null; then
174   as_have_required=yes
175 else
176   as_have_required=no
177 fi
178
179   if test $as_have_required = yes &&     (eval ":
180 (as_func_return () {
181   (exit \$1)
182 }
183 as_func_success () {
184   as_func_return 0
185 }
186 as_func_failure () {
187   as_func_return 1
188 }
189 as_func_ret_success () {
190   return 0
191 }
192 as_func_ret_failure () {
193   return 1
194 }
195
196 exitcode=0
197 if as_func_success; then
198   :
199 else
200   exitcode=1
201   echo as_func_success failed.
202 fi
203
204 if as_func_failure; then
205   exitcode=1
206   echo as_func_failure succeeded.
207 fi
208
209 if as_func_ret_success; then
210   :
211 else
212   exitcode=1
213   echo as_func_ret_success failed.
214 fi
215
216 if as_func_ret_failure; then
217   exitcode=1
218   echo as_func_ret_failure succeeded.
219 fi
220
221 if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
222   :
223 else
224   exitcode=1
225   echo positional parameters were not saved.
226 fi
227
228 test \$exitcode = 0) || { (exit 1); exit 1; }
229
230 (
231   as_lineno_1=\$LINENO
232   as_lineno_2=\$LINENO
233   test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
234   test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
235 ") 2> /dev/null; then
236   :
237 else
238   as_candidate_shells=
239     as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
240 for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
241 do
242   IFS=$as_save_IFS
243   test -z "$as_dir" && as_dir=.
244   case $as_dir in
245          /*)
246            for as_base in sh bash ksh sh5; do
247              as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
248            done;;
249        esac
250 done
251 IFS=$as_save_IFS
252
253
254       for as_shell in $as_candidate_shells $SHELL; do
255          # Try only shells that exist, to save several forks.
256          if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
257                 { ("$as_shell") 2> /dev/null <<\_ASEOF
258 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
259   emulate sh
260   NULLCMD=:
261   # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
262   # is contrary to our usage.  Disable this feature.
263   alias -g '${1+"$@"}'='"$@"'
264   setopt NO_GLOB_SUBST
265 else
266   case `(set -o) 2>/dev/null` in
267   *posix*) set -o posix ;;
268 esac
269
270 fi
271
272
273 :
274 _ASEOF
275 }; then
276   CONFIG_SHELL=$as_shell
277                as_have_required=yes
278                if { "$as_shell" 2> /dev/null <<\_ASEOF
279 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
280   emulate sh
281   NULLCMD=:
282   # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
283   # is contrary to our usage.  Disable this feature.
284   alias -g '${1+"$@"}'='"$@"'
285   setopt NO_GLOB_SUBST
286 else
287   case `(set -o) 2>/dev/null` in
288   *posix*) set -o posix ;;
289 esac
290
291 fi
292
293
294 :
295 (as_func_return () {
296   (exit $1)
297 }
298 as_func_success () {
299   as_func_return 0
300 }
301 as_func_failure () {
302   as_func_return 1
303 }
304 as_func_ret_success () {
305   return 0
306 }
307 as_func_ret_failure () {
308   return 1
309 }
310
311 exitcode=0
312 if as_func_success; then
313   :
314 else
315   exitcode=1
316   echo as_func_success failed.
317 fi
318
319 if as_func_failure; then
320   exitcode=1
321   echo as_func_failure succeeded.
322 fi
323
324 if as_func_ret_success; then
325   :
326 else
327   exitcode=1
328   echo as_func_ret_success failed.
329 fi
330
331 if as_func_ret_failure; then
332   exitcode=1
333   echo as_func_ret_failure succeeded.
334 fi
335
336 if ( set x; as_func_ret_success y && test x = "$1" ); then
337   :
338 else
339   exitcode=1
340   echo positional parameters were not saved.
341 fi
342
343 test $exitcode = 0) || { (exit 1); exit 1; }
344
345 (
346   as_lineno_1=$LINENO
347   as_lineno_2=$LINENO
348   test "x$as_lineno_1" != "x$as_lineno_2" &&
349   test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
350
351 _ASEOF
352 }; then
353   break
354 fi
355
356 fi
357
358       done
359
360       if test "x$CONFIG_SHELL" != x; then
361   for as_var in BASH_ENV ENV
362         do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
363         done
364         export CONFIG_SHELL
365         exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
366 fi
367
368
369     if test $as_have_required = no; then
370   echo This script requires a shell more modern than all the
371       echo shells that I found on your system.  Please install a
372       echo modern shell, or manually run the script under such a
373       echo shell if you do have one.
374       { (exit 1); exit 1; }
375 fi
376
377
378 fi
379
380 fi
381
382
383
384 (eval "as_func_return () {
385   (exit \$1)
386 }
387 as_func_success () {
388   as_func_return 0
389 }
390 as_func_failure () {
391   as_func_return 1
392 }
393 as_func_ret_success () {
394   return 0
395 }
396 as_func_ret_failure () {
397   return 1
398 }
399
400 exitcode=0
401 if as_func_success; then
402   :
403 else
404   exitcode=1
405   echo as_func_success failed.
406 fi
407
408 if as_func_failure; then
409   exitcode=1
410   echo as_func_failure succeeded.
411 fi
412
413 if as_func_ret_success; then
414   :
415 else
416   exitcode=1
417   echo as_func_ret_success failed.
418 fi
419
420 if as_func_ret_failure; then
421   exitcode=1
422   echo as_func_ret_failure succeeded.
423 fi
424
425 if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
426   :
427 else
428   exitcode=1
429   echo positional parameters were not saved.
430 fi
431
432 test \$exitcode = 0") || {
433   echo No shell found that supports shell functions.
434   echo Please tell bug-autoconf@gnu.org about your system,
435   echo including any error possibly output before this message.
436   echo This can help us improve future autoconf versions.
437   echo Configuration will now proceed without shell functions.
438 }
439
440
441
442   as_lineno_1=$LINENO
443   as_lineno_2=$LINENO
444   test "x$as_lineno_1" != "x$as_lineno_2" &&
445   test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
446
447   # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
448   # uniformly replaced by the line number.  The first 'sed' inserts a
449   # line-number line after each line using $LINENO; the second 'sed'
450   # does the real work.  The second script uses 'N' to pair each
451   # line-number line with the line containing $LINENO, and appends
452   # trailing '-' during substitution so that $LINENO is not a special
453   # case at line end.
454   # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
455   # scripts with optimization help from Paolo Bonzini.  Blame Lee
456   # E. McMahon (1931-1989) for sed's syntax.  :-)
457   sed -n '
458     p
459     /[$]LINENO/=
460   ' <$as_myself |
461     sed '
462       s/[$]LINENO.*/&-/
463       t lineno
464       b
465       :lineno
466       N
467       :loop
468       s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
469       t loop
470       s/-\n.*//
471     ' >$as_me.lineno &&
472   chmod +x "$as_me.lineno" ||
473     { { $as_echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
474 $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
475    { (exit 1); exit 1; }; }
476
477   # Don't try to exec as it changes $[0], causing all sort of problems
478   # (the dirname of $[0] is not the place where we might find the
479   # original and so on.  Autoconf is especially sensitive to this).
480   . "./$as_me.lineno"
481   # Exit status is that of the last command.
482   exit
483 }
484
485
486 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
487   as_dirname=dirname
488 else
489   as_dirname=false
490 fi
491
492 ECHO_C= ECHO_N= ECHO_T=
493 case `echo -n x` in
494 -n*)
495   case `echo 'x\c'` in
496   *c*) ECHO_T=' ';;     # ECHO_T is single tab character.
497   *)   ECHO_C='\c';;
498   esac;;
499 *)
500   ECHO_N='-n';;
501 esac
502 if expr a : '\(a\)' >/dev/null 2>&1 &&
503    test "X`expr 00001 : '.*\(...\)'`" = X001; then
504   as_expr=expr
505 else
506   as_expr=false
507 fi
508
509 rm -f conf$$ conf$$.exe conf$$.file
510 if test -d conf$$.dir; then
511   rm -f conf$$.dir/conf$$.file
512 else
513   rm -f conf$$.dir
514   mkdir conf$$.dir 2>/dev/null
515 fi
516 if (echo >conf$$.file) 2>/dev/null; then
517   if ln -s conf$$.file conf$$ 2>/dev/null; then
518     as_ln_s='ln -s'
519     # ... but there are two gotchas:
520     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
521     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
522     # In both cases, we have to default to `cp -p'.
523     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
524       as_ln_s='cp -p'
525   elif ln conf$$.file conf$$ 2>/dev/null; then
526     as_ln_s=ln
527   else
528     as_ln_s='cp -p'
529   fi
530 else
531   as_ln_s='cp -p'
532 fi
533 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
534 rmdir conf$$.dir 2>/dev/null
535
536 if mkdir -p . 2>/dev/null; then
537   as_mkdir_p=:
538 else
539   test -d ./-p && rmdir ./-p
540   as_mkdir_p=false
541 fi
542
543 if test -x / >/dev/null 2>&1; then
544   as_test_x='test -x'
545 else
546   if ls -dL / >/dev/null 2>&1; then
547     as_ls_L_option=L
548   else
549     as_ls_L_option=
550   fi
551   as_test_x='
552     eval sh -c '\''
553       if test -d "$1"; then
554         test -d "$1/.";
555       else
556         case $1 in
557         -*)set "./$1";;
558         esac;
559         case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
560         ???[sx]*):;;*)false;;esac;fi
561     '\'' sh
562   '
563 fi
564 as_executable_p=$as_test_x
565
566 # Sed expression to map a string onto a valid CPP name.
567 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
568
569 # Sed expression to map a string onto a valid variable name.
570 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
571
572
573
574
575
576 SHELL=${CONFIG_SHELL-/bin/sh}
577
578 # How were we run?
579 at_cli_args="$@"
580
581
582 # Not all shells have the 'times' builtin; the subshell is needed to make
583 # sure we discard the 'times: not found' message from the shell.
584 at_times_p=false
585 (times) >/dev/null 2>&1 && at_times_p=:
586
587 # CLI Arguments to pass to the debugging scripts.
588 at_debug_args=
589 # -e sets to true
590 at_errexit_p=false
591 # Shall we be verbose?  ':' means no, empty means yes.
592 at_verbose=:
593 at_quiet=
594
595 # Shall we keep the debug scripts?  Must be `:' when the suite is
596 # run by a debug script, so that the script doesn't remove itself.
597 at_debug_p=false
598 # Display help message?
599 at_help_p=false
600 # Display the version message?
601 at_version_p=false
602 # List test groups?
603 at_list_p=false
604 # --clean
605 at_clean=false
606 # Test groups to run
607 at_groups=
608 # Whether a write failure occurred
609 at_write_fail=0
610
611 # The directory we run the suite in.  Default to . if no -C option.
612 at_dir=`pwd`
613 # An absolute reference to this testsuite script.
614 case $as_myself in
615   [\\/]* | ?:[\\/]* ) at_myself=$as_myself ;;
616   * ) at_myself=$at_dir/$as_myself ;;
617 esac
618 # Whether -C is in effect.
619 at_change_dir=false
620
621 # List of the tested programs.
622 at_tested=''
623 # List of the all the test groups.
624 at_groups_all=' 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22'
625 # As many question marks as there are digits in the last test group number.
626 # Used to normalize the test group numbers so that `ls' lists them in
627 # numerical order.
628 at_format='??'
629 # Description of all the test groups.
630 at_help_all="1;version.at:17;gdbm version;;
631 2;create00.at:17;create database;gdbm create create00;
632 3;fetch00.at:17;fetch a record;gdbm fetch fetch00;
633 4;fetch01.at:17;fetch: nonexisting record;gdbm fetch fetch01;
634 5;delete00.at:17;delete a record;gdbm delete delete00;
635 6;delete01.at:17;delete: non existing record;gdbm delete delete01;
636 7;delete02.at:17;delete: all records;gdbm delete delete02;
637 8;dbmcreate00.at:17;create database;dbm create create00 dbmcreate00;
638 9;dbmcvt.at:17;converting a 1.8-style database;dbm fetch cvt;
639 10;dbmfetch00.at:17;fetch a record;dbm fetch fetch00 dbmfetch00;
640 11;dbmfetch01.at:17;fetch: nonexisting record;dbm fetch fetch01 dbmfetch01;
641 12;dbmfetch02.at:17;fetch from a read-only database;dbm fetch fetch02 dbmfetch02;
642 13;dbmfetch03.at:17;fetch from a read-only 1.8-style database;dbm fetch fetch03 dbmfetch03;
643 14;dbmdel00.at:17;delete a record;dbm delete delete00 dbmdel00;
644 15;dbmdel01.at:17;delete: non existing record;dbm delete delete01 dbmdel01;
645 16;dbmdel02.at:17;delete: all records;dbm delete delete02 dbmdel02;
646 17;setopt00.at:17;setopt;setopt setopt00;
647 18;setopt01.at:17;setopt: mmap options;setopt setopt01 mmap;
648 19;cloexec00.at:17;cloexec: gdbm_open;gdbm gdbm_open cloexec cloexec00;
649 20;cloexec01.at:17;cloexec: gdbm_reorganize;gdbm gdbm_reorganize cloexec cloexec01;
650 21;cloexec02.at:17;cloexec: dbm_open;ndbm dbm_open cloexec cloexec02;
651 22;cloexec03.at:17;cloexec: dbm_open -creat;ndbm dbm_open cloexec cloexec03;
652 "
653
654 # at_func_validate_ranges [NAME...]
655 # ---------------------------------
656 # Validate and normalize the test group number contained in each
657 # variable NAME.  Leading zeroes are treated as decimal.
658 at_func_validate_ranges ()
659 {
660   for at_grp
661   do
662     eval at_value=\$$at_grp
663     if test $at_value -lt 1 || test $at_value -gt 22; then
664       $as_echo "invalid test group: $at_value" >&2
665       exit 1
666     fi
667     case $at_value in
668       0*) # We want to treat leading 0 as decimal, like expr and test, but
669           # at_func_arith treats it as octal if it uses $(( )).
670           # With XSI shells, ${at_value#${at_value%%[1-9]*}} avoids the
671           # expr fork, but it is not worth the effort to determine if the
672           # shell supports XSI when the user can just avoid leading 0.
673           eval $at_grp='`expr $at_value + 0`' ;;
674     esac
675   done
676 }
677
678 at_prev=
679 for at_option
680 do
681   # If the previous option needs an argument, assign it.
682   if test -n "$at_prev"; then
683     at_option=$at_prev=$at_option
684     at_prev=
685   fi
686
687   case $at_option in
688   *=*) at_optarg=`expr "x$at_option" : 'x[^=]*=\(.*\)'` ;;
689   *)   at_optarg= ;;
690   esac
691
692   # Accept the important Cygnus configure options, so we can diagnose typos.
693
694   case $at_option in
695     --help | -h )
696         at_help_p=:
697         ;;
698
699     --list | -l )
700         at_list_p=:
701         ;;
702
703     --version | -V )
704         at_version_p=:
705         ;;
706
707     --clean | -c )
708         at_clean=:
709         ;;
710
711     --debug | -d )
712         at_debug_p=:
713         ;;
714
715     --errexit | -e )
716         at_debug_p=:
717         at_errexit_p=:
718         ;;
719
720     --verbose | -v )
721         at_verbose=; at_quiet=:
722         ;;
723
724     --trace | -x )
725         at_traceon='set -x'; at_traceoff='set +x'
726         ;;
727
728     [0-9] | [0-9][0-9] | [0-9][0-9][0-9] | [0-9][0-9][0-9][0-9])
729         at_func_validate_ranges at_option
730         at_groups="$at_groups$at_option "
731         ;;
732
733     # Ranges
734     [0-9]- | [0-9][0-9]- | [0-9][0-9][0-9]- | [0-9][0-9][0-9][0-9]-)
735         at_range_start=`echo $at_option |tr -d X-`
736         at_func_validate_ranges at_range_start
737         at_range=`$as_echo " $at_groups_all " | \
738           sed -e 's/^.* \('$at_range_start' \)/\1/'`
739         at_groups="$at_groups$at_range "
740         ;;
741
742     -[0-9] | -[0-9][0-9] | -[0-9][0-9][0-9] | -[0-9][0-9][0-9][0-9])
743         at_range_end=`echo $at_option |tr -d X-`
744         at_func_validate_ranges at_range_end
745         at_range=`$as_echo " $at_groups_all " | \
746           sed -e 's/\( '$at_range_end'\) .*$/\1/'`
747         at_groups="$at_groups$at_range "
748         ;;
749
750     [0-9]-[0-9] | [0-9]-[0-9][0-9] | [0-9]-[0-9][0-9][0-9] | \
751     [0-9]-[0-9][0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9] | \
752     [0-9][0-9]-[0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9][0-9][0-9] | \
753     [0-9][0-9][0-9]-[0-9][0-9][0-9] | \
754     [0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] | \
755     [0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] )
756         at_range_start=`expr $at_option : '\(.*\)-'`
757         at_range_end=`expr $at_option : '.*-\(.*\)'`
758         if test $at_range_start -gt $at_range_end; then
759           at_tmp=$at_range_end
760           at_range_end=$at_range_start
761           at_range_start=$at_tmp
762         fi
763         at_func_validate_ranges at_range_start at_range_end
764         at_range=`$as_echo " $at_groups_all " | \
765           sed -e 's/^.*\( '$at_range_start' \)/\1/' \
766               -e 's/\( '$at_range_end'\) .*$/\1/'`
767         at_groups="$at_groups$at_range "
768         ;;
769
770     # Directory selection.
771     --directory | -C )
772         at_prev=--directory
773         ;;
774     --directory=* )
775         at_change_dir=:
776         at_dir=$at_optarg
777         ;;
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=`$as_echo "$at_groups_selected" |
801               grep -i $at_invert "^[1-9][^;]*;.*[; ]$at_keyword[ ;]"`
802         done
803         # Smash the newlines.
804         at_groups_selected=`$as_echo "$at_groups_selected" | sed 's/;.*//' |
805           tr "$as_nl" ' '
806         `
807         at_groups="$at_groups$at_groups_selected "
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_echo "$as_me:$LINENO: error: invalid variable name: $at_envvar" >&5
816 $as_echo "$as_me: error: invalid variable name: $at_envvar" >&2;}
817    { (exit 1); exit 1; }; } ;;
818         esac
819         at_value=`$as_echo "$at_optarg" | sed "s/'/'\\\\\\\\''/g"`
820         # Export now, but save eval for later and for debug scripts.
821         export $at_envvar
822         at_debug_args="$at_debug_args $at_envvar='$at_value'"
823         ;;
824
825      *) $as_echo "$as_me: invalid option: $at_option" >&2
826         $as_echo "Try \`$0 --help' for more information." >&2
827         exit 1
828         ;;
829   esac
830 done
831
832 # Verify our last option didn't require an argument
833 if test -n "$at_prev"; then
834   { { $as_echo "$as_me:$LINENO: error: \`$at_prev' requires an argument." >&5
835 $as_echo "$as_me: error: \`$at_prev' requires an argument." >&2;}
836    { (exit 1); exit 1; }; }
837 fi
838
839
840 # Selected test groups.
841 if test -z "$at_groups"; then
842   at_groups=$at_groups_all
843 else
844   # Sort the tests, removing duplicates.
845   at_groups=`$as_echo "$at_groups" | tr ' ' "$as_nl" | sort -nu`
846 fi
847
848 # Help message.
849 if $at_help_p; then
850   cat <<_ATEOF || at_write_fail=1
851 Usage: $0 [OPTION]... [VARIABLE=VALUE]... [TESTS]
852
853 Run all the tests, or the selected TESTS, given by numeric ranges, and
854 save a detailed log file.  Upon failure, create debugging scripts.
855
856 You should not change environment variables unless explicitly passed
857 as command line arguments.  Set \`AUTOTEST_PATH' to select the executables
858 to exercise.  Each relative directory is expanded as build and source
859 directories relatively to the top level of this distribution.  E.g.,
860
861   $ $0 AUTOTEST_PATH=bin
862
863 possibly amounts into
864
865   PATH=/tmp/foo-1.0/bin:/src/foo-1.0/bin:\$PATH
866 _ATEOF
867 cat <<_ATEOF || at_write_fail=1
868
869 Operation modes:
870   -h, --help     print the help message, then exit
871   -V, --version  print version number, then exit
872   -c, --clean    remove all the files this test suite might create and exit
873   -l, --list     describes all the tests, or the selected TESTS
874 _ATEOF
875 cat <<_ATEOF || at_write_fail=1
876
877 Execution tuning:
878   -C, --directory=DIR
879                  change to directory DIR before starting
880   -k, --keywords=KEYWORDS
881                  select the tests matching all the comma-separated KEYWORDS
882                  multiple \`-k' accumulate; prefixed \`!' negates a KEYWORD
883   -e, --errexit  abort as soon as a test fails; implies --debug
884   -v, --verbose  force more detailed output
885                  default for debugging scripts
886   -d, --debug    inhibit clean up and top-level logging
887                  default for debugging scripts
888   -x, --trace    enable tests shell tracing
889 _ATEOF
890 cat <<_ATEOF || at_write_fail=1
891
892 Report bugs to <bug-gdbm@gnu.org>.
893 _ATEOF
894   exit $at_write_fail
895 fi
896
897 # List of tests.
898 if $at_list_p; then
899   cat <<_ATEOF || at_write_fail=1
900 gdbm 1.10 test suite test groups:
901
902  NUM: FILE-NAME:LINE     TEST-GROUP-NAME
903       KEYWORDS
904
905 _ATEOF
906   # Passing at_groups is tricky.  We cannot use it to form a literal string
907   # or regexp because of the limitation of AIX awk.  And Solaris' awk
908   # doesn't grok more than 99 fields in a record, so we have to use `split'.
909   # at_groups needs to be space-separated for this script to work.
910   case $at_groups in
911     *"$as_nl"* )
912       at_groups=`$as_echo "$at_groups" | tr "$as_nl" ' '` ;;
913   esac
914   $as_echo "$at_groups$as_nl$at_help_all" |
915     awk 'BEGIN { FS = ";" }
916          NR == 1 {
917            for (n = split($ 0, a, " "); n; n--) selected[a[n]] = 1
918            next
919          }
920          {
921            if (selected[$ 1]) {
922              printf " %3d: %-18s %s\n", $ 1, $ 2, $ 3
923              if ($ 4) printf "      %s\n", $ 4
924            }
925          }' || at_write_fail=1
926   exit $at_write_fail
927 fi
928 if $at_version_p; then
929   $as_echo "$as_me (gdbm 1.10)" &&
930   cat <<\_ACEOF || at_write_fail=1
931
932 Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
933 Free Software Foundation, Inc.
934 This test suite is free software; the Free Software Foundation gives
935 unlimited permission to copy, distribute and modify it.
936 _ACEOF
937   exit $at_write_fail
938 fi
939
940 # Should we print banners?  at_groups is space-separated for entire test,
941 # newline-separated if only a subset of the testsuite is run.
942 case $at_groups in
943   *' '*' '* | *"$as_nl"*"$as_nl"* )
944       at_print_banners=: ;;
945   * ) at_print_banners=false ;;
946 esac
947 # Text for banner N, set to empty once printed.
948 # Banner 1. testsuite.at:35
949 # Category starts at test group 2.
950 at_banner_text_1="GDBM interface"
951 # Banner 2. testsuite.at:46
952 # Category starts at test group 8.
953 at_banner_text_2="Compatibility library (dbm/ndbm)"
954 # Banner 3. testsuite.at:61
955 # Category starts at test group 17.
956 at_banner_text_3="DB options"
957 # Banner 4. testsuite.at:66
958 # Category starts at test group 19.
959 at_banner_text_4="Cloexec"
960
961 # Take any -C into account.
962 if $at_change_dir ; then
963   if test x- = "x$at_dir" ; then
964     at_dir=./-
965   fi
966   test x != "x$at_dir" && cd "$at_dir" \
967     || { { $as_echo "$as_me:$LINENO: error: unable to change directory" >&5
968 $as_echo "$as_me: error: unable to change directory" >&2;}
969    { (exit 1); exit 1; }; }
970   at_dir=`pwd`
971 fi
972
973 # Load the config files for any default variable assignments.
974 for at_file in atconfig atlocal
975 do
976   test -r $at_file || continue
977   . ./$at_file || { { $as_echo "$as_me:$LINENO: error: invalid content: $at_file" >&5
978 $as_echo "$as_me: error: invalid content: $at_file" >&2;}
979    { (exit 1); exit 1; }; }
980 done
981
982 # Autoconf <=2.59b set at_top_builddir instead of at_top_build_prefix:
983 : ${at_top_build_prefix=$at_top_builddir}
984
985 # Perform any assignments requested during argument parsing.
986 eval "$at_debug_args"
987
988 # atconfig delivers names relative to the directory the test suite is
989 # in, but the groups themselves are run in testsuite-dir/group-dir.
990 if test -n "$at_top_srcdir"; then
991   builddir=../..
992   for at_dir_var in srcdir top_srcdir top_build_prefix
993   do
994     at_val=`eval 'as_val=${'at_$at_dir_var'}
995                  $as_echo "$as_val"'`
996     case $at_val in
997       [\\/$]* | ?:[\\/]* ) at_prefix= ;;
998       *) at_prefix=../../ ;;
999     esac
1000     eval "$at_dir_var=\$at_prefix\$at_val"
1001   done
1002 fi
1003
1004 ## ------------------- ##
1005 ## Directory structure ##
1006 ## ------------------- ##
1007
1008 # This is the set of directories and files used by this script
1009 # (non-literals are capitalized):
1010 #
1011 # TESTSUITE         - the testsuite
1012 # TESTSUITE.log     - summarizes the complete testsuite run
1013 # TESTSUITE.dir/    - created during a run, remains after -d or failed test
1014 # + at-groups/      - during a run: status of all groups in run
1015 # | + NNN/          - during a run: meta-data about test group NNN
1016 # | | + check-line  - location (source file and line) of current AT_CHECK
1017 # | | + status      - exit status of current AT_CHECK
1018 # | | + stdout      - stdout of current AT_CHECK
1019 # | | + stder1      - stderr, including trace
1020 # | | + stderr      - stderr, with trace filtered out
1021 # | | + test-source - portion of testsuite that defines group
1022 # | | + times       - timestamps for computing duration
1023 # | | + pass        - created if group passed
1024 # | | + xpass       - created if group xpassed
1025 # | | + fail        - created if group failed
1026 # | | + xfail       - created if group xfailed
1027 # | | + skip        - created if group skipped
1028 # + at-stop         - during a run: end the run if this file exists
1029 # + at-source-lines - during a run: cache of TESTSUITE line numbers for extraction
1030 # + 0..NNN/         - created for each group NNN, remains after -d or failed test
1031 # | + TESTSUITE.log - summarizes the group results
1032 # | + ...           - files created during the group
1033
1034 # The directory the whole suite works in.
1035 # Should be absolute to let the user `cd' at will.
1036 at_suite_dir=$at_dir/$as_me.dir
1037 # The file containing the suite.
1038 at_suite_log=$at_dir/$as_me.log
1039 # The directory containing helper files per test group.
1040 at_helper_dir=$at_suite_dir/at-groups
1041 # Stop file: if it exists, do not start new jobs.
1042 at_stop_file=$at_suite_dir/at-stop
1043
1044 if $at_clean; then
1045   test -d "$at_suite_dir" &&
1046     find "$at_suite_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \;
1047   rm -f -r "$at_suite_dir" "$at_suite_log"
1048   exit $?
1049 fi
1050
1051 # Don't take risks: use only absolute directories in PATH.
1052 #
1053 # For stand-alone test suites (ie. atconfig was not found),
1054 # AUTOTEST_PATH is relative to `.'.
1055 #
1056 # For embedded test suites, AUTOTEST_PATH is relative to the top level
1057 # of the package.  Then expand it into build/src parts, since users
1058 # may create executables in both places.
1059 AUTOTEST_PATH=`$as_echo "$AUTOTEST_PATH" | sed "s|:|$PATH_SEPARATOR|g"`
1060 at_path=
1061 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1062 for as_dir in $AUTOTEST_PATH $PATH
1063 do
1064   IFS=$as_save_IFS
1065   test -z "$as_dir" && as_dir=.
1066   test -n "$at_path" && at_path=$at_path$PATH_SEPARATOR
1067 case $as_dir in
1068   [\\/]* | ?:[\\/]* )
1069     at_path=$at_path$as_dir
1070     ;;
1071   * )
1072     if test -z "$at_top_build_prefix"; then
1073       # Stand-alone test suite.
1074       at_path=$at_path$as_dir
1075     else
1076       # Embedded test suite.
1077       at_path=$at_path$at_top_build_prefix$as_dir$PATH_SEPARATOR
1078       at_path=$at_path$at_top_srcdir/$as_dir
1079     fi
1080     ;;
1081 esac
1082 done
1083 IFS=$as_save_IFS
1084
1085
1086 # Now build and simplify PATH.
1087 #
1088 # There might be directories that don't exist, but don't redirect
1089 # builtins' (eg., cd) stderr directly: Ultrix's sh hates that.
1090 at_new_path=
1091 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1092 for as_dir in $at_path
1093 do
1094   IFS=$as_save_IFS
1095   test -z "$as_dir" && as_dir=.
1096   test -d "$as_dir" || continue
1097 case $as_dir in
1098   [\\/]* | ?:[\\/]* ) ;;
1099   * ) as_dir=`(cd "$as_dir" && pwd) 2>/dev/null` ;;
1100 esac
1101 case $PATH_SEPARATOR$at_new_path$PATH_SEPARATOR in
1102   *$PATH_SEPARATOR$as_dir$PATH_SEPARATOR*) ;;
1103   $PATH_SEPARATOR$PATH_SEPARATOR) at_new_path=$as_dir ;;
1104   *) at_new_path=$at_new_path$PATH_SEPARATOR$as_dir ;;
1105 esac
1106 done
1107 IFS=$as_save_IFS
1108
1109 PATH=$at_new_path
1110 export PATH
1111
1112 # Setting up the FDs.
1113 # 5 is the log file.  Not to be overwritten if `-d'.
1114 if $at_debug_p; then
1115   at_suite_log=/dev/null
1116 else
1117   : >"$at_suite_log"
1118 fi
1119 exec 5>>"$at_suite_log"
1120
1121 # Banners and logs.
1122 cat <<\_ASBOX
1123 ## --------------------- ##
1124 ## gdbm 1.10 test suite. ##
1125 ## --------------------- ##
1126 _ASBOX
1127 {
1128   cat <<\_ASBOX
1129 ## --------------------- ##
1130 ## gdbm 1.10 test suite. ##
1131 ## --------------------- ##
1132 _ASBOX
1133   echo
1134
1135   $as_echo "$as_me: command line was:"
1136   $as_echo "  \$ $0 $at_cli_args"
1137   echo
1138
1139   # Try to find a few ChangeLogs in case it might help determining the
1140   # exact version.  Use the relative dir: if the top dir is a symlink,
1141   # find will not follow it (and options to follow the links are not
1142   # portable), which would result in no output here.  Prune directories
1143   # matching the package tarname, since they tend to be leftovers from
1144   # `make dist' or `make distcheck' and contain redundant or stale logs.
1145   if test -n "$at_top_srcdir"; then
1146     cat <<\_ASBOX
1147 ## ----------- ##
1148 ## ChangeLogs. ##
1149 ## ----------- ##
1150 _ASBOX
1151     echo
1152     for at_file in `find "$at_top_srcdir" -name "gdbm-*" -prune -o -name ChangeLog -print`
1153     do
1154       $as_echo "$as_me: $at_file:"
1155       sed 's/^/| /;10q' $at_file
1156       echo
1157     done
1158
1159   fi
1160
1161   {
1162 cat <<_ASUNAME
1163 ## --------- ##
1164 ## Platform. ##
1165 ## --------- ##
1166
1167 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
1168 uname -m = `(uname -m) 2>/dev/null || echo unknown`
1169 uname -r = `(uname -r) 2>/dev/null || echo unknown`
1170 uname -s = `(uname -s) 2>/dev/null || echo unknown`
1171 uname -v = `(uname -v) 2>/dev/null || echo unknown`
1172
1173 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
1174 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
1175
1176 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
1177 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
1178 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
1179 /usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
1180 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
1181 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
1182 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
1183
1184 _ASUNAME
1185
1186 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1187 for as_dir in $PATH
1188 do
1189   IFS=$as_save_IFS
1190   test -z "$as_dir" && as_dir=.
1191   $as_echo "PATH: $as_dir"
1192 done
1193 IFS=$as_save_IFS
1194
1195 }
1196   echo
1197
1198   # Contents of the config files.
1199   for at_file in atconfig atlocal
1200   do
1201     test -r $at_file || continue
1202     $as_echo "$as_me: $at_file:"
1203     sed 's/^/| /' $at_file
1204     echo
1205   done
1206 } >&5
1207
1208
1209 ## --------------- ##
1210 ## Shell functions ##
1211 ## --------------- ##
1212
1213 # at_func_banner NUMBER
1214 # ---------------------
1215 # Output banner NUMBER, provided the testsuite is running multiple groups
1216 # and this particular banner has not yet been printed.
1217 at_func_banner ()
1218 {
1219   $at_print_banners || return 0
1220   eval at_banner_text=\$at_banner_text_$1
1221   test "x$at_banner_text" = x && return 0
1222   eval at_banner_text_$1=
1223   $as_echo "$as_nl$at_banner_text$as_nl"
1224 } # at_func_banner
1225
1226 # at_func_check_newline COMMAND
1227 # -----------------------------
1228 # Test if COMMAND includes a newline and, if so, print a message and return
1229 # exit code 1
1230 at_func_check_newline ()
1231 {
1232   case "$1" in
1233  *'
1234 '*) echo 'Not enabling shell tracing (command contains an embedded newline)'
1235     return 1 ;;
1236  *) return 0 ;;
1237   esac
1238 }
1239
1240 # at_func_filter_trace EXIT-CODE
1241 # ------------------------------
1242 # Split the contents of file "$at_stder1" into the "set -x" trace (on stderr)
1243 # and the other lines (on file "$at_stderr").  Return the exit code EXIT-CODE.
1244 at_func_filter_trace ()
1245 {
1246   grep '^ *+' "$at_stder1" >&2
1247   grep -v '^ *+' "$at_stder1" >"$at_stderr"
1248   return $1
1249 }
1250
1251 # at_func_log_failure FILE-LIST
1252 # -----------------------------
1253 # Copy the files in the list on stdout with a "> " prefix, and exit the shell
1254 # with a failure exit code.
1255 at_func_log_failure ()
1256 {
1257   for file
1258     do $as_echo "$file:"; sed 's/^/> /' "$file"; done
1259   echo 1 > "$at_status_file"
1260   exit 1
1261 }
1262
1263 # at_func_check_skip EXIT-CODE
1264 # ----------------------------
1265 # Check whether EXIT-CODE is the special exit code 77, and if so exit the shell
1266 # with that same exit code.
1267 at_func_check_skip ()
1268 {
1269   case $1 in
1270     77) echo 77 > "$at_status_file"; exit 77;;
1271   esac
1272 }
1273
1274 # at_func_check_status EXPECTED EXIT-CODE LINE
1275 # --------------------------------------------
1276 # Check whether EXIT-CODE is the expected exit code, and if so do nothing.
1277 # Otherwise, if it is 77 exit the shell with that same exit code; if it is
1278 # anything else print an error message and fail the test.
1279 at_func_check_status ()
1280 {
1281   case $2 in
1282     $1 ) ;;
1283     77) echo 77 > "$at_status_file"; exit 77;;
1284     *) $as_echo "$3: exit code was $2, expected $1"
1285       at_failed=:;;
1286   esac
1287 }
1288
1289 # at_func_diff_devnull FILE
1290 # -------------------------
1291 # Emit a diff between /dev/null and FILE.  Uses "test -s" to avoid useless
1292 # diff invocations.
1293 at_func_diff_devnull ()
1294 {
1295   test -s "$1" || return 0
1296   $at_diff "$at_devnull" "$1"
1297 }
1298
1299 # at_func_test NUMBER
1300 # -------------------
1301 # Parse out test NUMBER from the tail of this file.
1302 at_func_test ()
1303 {
1304   eval at_sed=\$at_sed$1
1305   sed "$at_sed" "$at_myself" > "$at_test_source"
1306 }
1307
1308 # at_func_create_debugging_script
1309 # -------------------------------
1310 # Create the debugging script $at_group_dir/run which will reproduce the
1311 # current test group.
1312 at_func_create_debugging_script ()
1313 {
1314   {
1315     echo "#! /bin/sh" &&
1316     echo 'test "${ZSH_VERSION+set}" = set && alias -g '\''${1+"$@"}'\''='\''"$@"'\''' &&
1317     $as_echo "cd '$at_dir'" &&
1318     $as_echo "exec \${CONFIG_SHELL-$SHELL} \"$at_myself\" -v -d $at_debug_args $at_group \${1+\"\$@\"}" &&
1319     echo 'exit 1'
1320   } >"$at_group_dir/run" &&
1321   chmod +x "$at_group_dir/run"
1322 }
1323
1324 # at_func_arith
1325 # -------------
1326 # Arithmetic evaluation, avoids expr if the shell is sane.  The
1327 # interpretation of leading zeroes is unspecified.
1328 #
1329 # subshell and eval are needed to keep Solaris sh from bailing out:
1330 if ( eval 'test $(( 1 + 1 )) = 2' ) 2>/dev/null; then
1331   # With "$@", bash does not split positional parameters:
1332   eval 'at_func_arith ()
1333   {
1334     at_func_arith_result=$(( $* ))
1335   }'
1336 else
1337   at_func_arith ()
1338   {
1339     at_func_arith_result=`expr "$@"`
1340   }
1341 fi
1342
1343 ## ---------------------- ##
1344 ## End of shell functions ##
1345 ## ---------------------- ##
1346 {
1347   cat <<\_ASBOX
1348 ## ---------------- ##
1349 ## Tested programs. ##
1350 ## ---------------- ##
1351 _ASBOX
1352   echo
1353 } >&5
1354
1355 # Report what programs are being tested.
1356 for at_program in : $at_tested
1357 do
1358   test "$at_program" = : && continue
1359   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1360 for as_dir in $PATH
1361 do
1362   IFS=$as_save_IFS
1363   test -z "$as_dir" && as_dir=.
1364   test -f "$as_dir/$at_program" && break
1365 done
1366 IFS=$as_save_IFS
1367
1368   if test -f "$as_dir/$at_program"; then
1369     {
1370       $as_echo "$at_srcdir/testsuite.at:32: $as_dir/$at_program --version"
1371       "$as_dir/$at_program" --version </dev/null
1372       echo
1373     } >&5 2>&1
1374   else
1375     { { $as_echo "$as_me:$LINENO: error: cannot find $at_program" >&5
1376 $as_echo "$as_me: error: cannot find $at_program" >&2;}
1377    { (exit 1); exit 1; }; }
1378   fi
1379 done
1380
1381 {
1382   cat <<\_ASBOX
1383 ## ------------------ ##
1384 ## Running the tests. ##
1385 ## ------------------ ##
1386 _ASBOX
1387 } >&5
1388
1389 at_start_date=`date`
1390 at_start_time=`date +%s 2>/dev/null`
1391 $as_echo "$as_me: starting at: $at_start_date" >&5
1392
1393 # Create the master directory if it doesn't already exist.
1394 test -d "$at_suite_dir" ||
1395   mkdir "$at_suite_dir" ||
1396   { { $as_echo "$as_me:$LINENO: error: cannot create '$at_suite_dir'" >&5
1397 $as_echo "$as_me: error: cannot create '$at_suite_dir'" >&2;}
1398    { (exit 1); exit 1; }; }
1399
1400 # Can we diff with `/dev/null'?  DU 5.0 refuses.
1401 if diff /dev/null /dev/null >/dev/null 2>&1; then
1402   at_devnull=/dev/null
1403 else
1404   at_devnull=$at_suite_dir/devnull
1405   >"$at_devnull"
1406 fi
1407
1408 # Use `diff -u' when possible.
1409 if at_diff=`diff -u "$at_devnull" "$at_devnull" 2>&1` && test -z "$at_diff"
1410 then
1411   at_diff='diff -u'
1412 else
1413   at_diff=diff
1414 fi
1415
1416 # Get the last needed group.
1417 for at_group in : $at_groups; do :; done
1418
1419 # Extract the start and end lines of each test group at the tail
1420 # of this file
1421 awk '
1422 BEGIN { FS="\a" }
1423 /^#AT_START_/ {
1424   start = NR
1425 }
1426 /^#AT_STOP_/ {
1427   test = substr ($ 0, 10)
1428   print "at_sed" test "=\"1," start "d;" (NR-1) "q\""
1429   if (test == "'"$at_group"'") exit
1430 }' "$at_myself" > "$at_suite_dir/at-source-lines" &&
1431 . "$at_suite_dir/at-source-lines" ||
1432   { { $as_echo "$as_me:$LINENO: error: cannot create test line number cache" >&5
1433 $as_echo "$as_me: error: cannot create test line number cache" >&2;}
1434    { (exit 1); exit 1; }; }
1435 rm -f "$at_suite_dir/at-source-lines"
1436
1437 # Set up helper dirs.
1438 rm -rf "$at_helper_dir" &&
1439 mkdir "$at_helper_dir" &&
1440 cd "$at_helper_dir" &&
1441 { test -z "$at_groups" || mkdir $at_groups; } ||
1442 { { $as_echo "$as_me:$LINENO: error: testsuite directory setup failed" >&5
1443 $as_echo "$as_me: error: testsuite directory setup failed" >&2;}
1444    { (exit 1); exit 1; }; }
1445
1446 # Functions for running a test group.  We leave the actual
1447 # test group execution outside of a shell function in order
1448 # to avoid hitting zsh 4.x exit status bugs.
1449
1450 # at_func_group_prepare
1451 # ---------------------
1452 # Prepare running a test group
1453 at_func_group_prepare ()
1454 {
1455   # The directory for additional per-group helper files.
1456   at_job_dir=$at_helper_dir/$at_group
1457   # The file containing the location of the last AT_CHECK.
1458   at_check_line_file=$at_job_dir/check-line
1459   # The file containing the exit status of the last command.
1460   at_status_file=$at_job_dir/status
1461   # The files containing the output of the tested commands.
1462   at_stdout=$at_job_dir/stdout
1463   at_stder1=$at_job_dir/stder1
1464   at_stderr=$at_job_dir/stderr
1465   # The file containing the code for a test group.
1466   at_test_source=$at_job_dir/test-source
1467   # The file containing dates.
1468   at_times_file=$at_job_dir/times
1469
1470   # Be sure to come back to the top test directory.
1471   cd "$at_suite_dir"
1472
1473   # Clearly separate the test groups when verbose.
1474   $at_first || $at_verbose echo
1475
1476   at_group_normalized=$at_group
1477
1478   eval 'while :; do
1479     case $at_group_normalized in #(
1480     '"$at_format"'*) break;;
1481     esac
1482     at_group_normalized=0$at_group_normalized
1483   done'
1484
1485
1486   # Create a fresh directory for the next test group, and enter.
1487   at_group_dir=$at_suite_dir/$at_group_normalized
1488   at_group_log=$at_group_dir/$as_me.log
1489   if test -d "$at_group_dir"; then
1490     find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \;
1491     rm -fr "$at_group_dir" ||
1492     { $as_echo "$as_me:$LINENO: WARNING: test directory for $at_group_normalized could not be cleaned." >&5
1493 $as_echo "$as_me: WARNING: test directory for $at_group_normalized could not be cleaned." >&2;}
1494   fi
1495   # Be tolerant if the above `rm' was not able to remove the directory.
1496   { as_dir="$at_group_dir"
1497   case $as_dir in #(
1498   -*) as_dir=./$as_dir;;
1499   esac
1500   test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
1501     as_dirs=
1502     while :; do
1503       case $as_dir in #(
1504       *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
1505       *) as_qdir=$as_dir;;
1506       esac
1507       as_dirs="'$as_qdir' $as_dirs"
1508       as_dir=`$as_dirname -- "$as_dir" ||
1509 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
1510          X"$as_dir" : 'X\(//\)[^/]' \| \
1511          X"$as_dir" : 'X\(//\)$' \| \
1512          X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
1513 $as_echo X"$as_dir" |
1514     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
1515             s//\1/
1516             q
1517           }
1518           /^X\(\/\/\)[^/].*/{
1519             s//\1/
1520             q
1521           }
1522           /^X\(\/\/\)$/{
1523             s//\1/
1524             q
1525           }
1526           /^X\(\/\).*/{
1527             s//\1/
1528             q
1529           }
1530           s/.*/./; q'`
1531       test -d "$as_dir" && break
1532     done
1533     test -z "$as_dirs" || eval "mkdir $as_dirs"
1534   } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
1535 $as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
1536    { (exit 1); exit 1; }; }; }
1537
1538   echo 0 > "$at_status_file"
1539
1540   # In verbose mode, append to the log file *and* show on
1541   # the standard output; in quiet mode only write to the log.
1542   if test -z "$at_verbose"; then
1543     at_tee_pipe='tee -a "$at_group_log"'
1544   else
1545     at_tee_pipe='cat >> "$at_group_log"'
1546   fi
1547 }
1548
1549 # at_func_group_postprocess
1550 # -------------------------
1551 at_func_group_postprocess ()
1552 {
1553   # Be sure to come back to the suite directory, in particular
1554   # since below we might `rm' the group directory we are in currently.
1555   cd "$at_suite_dir"
1556
1557   if test ! -f "$at_check_line_file"; then
1558     sed "s/^ */$as_me: WARNING: /" <<_ATEOF
1559       A failure happened in a test group before any test could be
1560       run. This means that test suite is improperly designed.  Please
1561       report this failure to <bug-gdbm@gnu.org>.
1562 _ATEOF
1563     $as_echo "$at_setup_line" >"$at_check_line_file"
1564   fi
1565   $at_verbose $as_echo_n "$at_group. $at_setup_line: "
1566   $as_echo_n "$at_group. $at_setup_line: " >> "$at_group_log"
1567   case $at_xfail:$at_status in
1568     yes:0)
1569         at_msg="UNEXPECTED PASS"
1570         at_res=xpass
1571         at_errexit=$at_errexit_p
1572         ;;
1573     no:0)
1574         at_msg="ok"
1575         at_res=pass
1576         at_errexit=false
1577         ;;
1578     *:77)
1579         at_msg='skipped ('`cat "$at_check_line_file"`')'
1580         at_res=skip
1581         at_errexit=false
1582         ;;
1583     yes:*)
1584         at_msg='expected failure ('`cat "$at_check_line_file"`')'
1585         at_res=xfail
1586         at_errexit=false
1587         ;;
1588     no:*)
1589         at_msg='FAILED ('`cat "$at_check_line_file"`')'
1590         at_res=fail
1591         at_errexit=$at_errexit_p
1592         ;;
1593   esac
1594   echo "$at_res" > "$at_job_dir/$at_res"
1595   # Make sure there is a separator even with long titles.
1596   $as_echo " $at_msg"
1597   at_log_msg="$at_group. $at_desc ($at_setup_line): $at_msg"
1598   case $at_status in
1599     0|77)
1600       # $at_times_file is only available if the group succeeded.
1601       # We're not including the group log, so the success message
1602       # is written in the global log separately.  But we also
1603       # write to the group log in case they're using -d.
1604       if test -f "$at_times_file"; then
1605         at_log_msg="$at_log_msg     ("`sed 1d "$at_times_file"`')'
1606         rm -f "$at_times_file"
1607       fi
1608       $as_echo "$at_log_msg" >> "$at_group_log"
1609       $as_echo "$at_log_msg" >&5
1610
1611       # Cleanup the group directory, unless the user wants the files.
1612       if $at_debug_p; then
1613         at_func_create_debugging_script
1614       else
1615         if test -d "$at_group_dir"; then
1616           find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \;
1617           rm -fr "$at_group_dir"
1618         fi
1619         rm -f "$at_test_source"
1620       fi
1621       ;;
1622     *)
1623       # Upon failure, include the log into the testsuite's global
1624       # log.  The failure message is written in the group log.  It
1625       # is later included in the global log.
1626       $as_echo "$at_log_msg" >> "$at_group_log"
1627
1628       # Upon failure, keep the group directory for autopsy, and create
1629       # the debugging script.  With -e, do not start any further tests.
1630       at_func_create_debugging_script
1631       if $at_errexit; then
1632         echo stop > "$at_stop_file"
1633       fi
1634       ;;
1635   esac
1636 }
1637
1638
1639 ## ------------ ##
1640 ## Driver loop. ##
1641 ## ------------ ##
1642
1643 rm -f "$at_stop_file"
1644 at_first=:
1645
1646 for at_group in $at_groups; do
1647   at_func_group_prepare
1648   if cd "$at_group_dir" &&
1649      at_func_test $at_group &&
1650      . "$at_test_source"; then :; else
1651     { $as_echo "$as_me:$LINENO: WARNING: unable to parse test group: $at_group" >&5
1652 $as_echo "$as_me: WARNING: unable to parse test group: $at_group" >&2;}
1653     at_failed=:
1654   fi
1655   at_func_group_postprocess
1656   test -f "$at_stop_file" && break
1657   at_first=false
1658 done
1659
1660 # Wrap up the test suite with summary statistics.
1661 cd "$at_helper_dir"
1662
1663 # Use ?..???? when the list must remain sorted, the faster * otherwise.
1664 at_pass_list=`for f in */pass; do echo $f; done | sed '/\*/d; s,/pass,,'`
1665 at_skip_list=`for f in */skip; do echo $f; done | sed '/\*/d; s,/skip,,'`
1666 at_xfail_list=`for f in */xfail; do echo $f; done | sed '/\*/d; s,/xfail,,'`
1667 at_xpass_list=`for f in ?/xpass ??/xpass ???/xpass ????/xpass; do
1668                  echo $f; done | sed '/?/d; s,/xpass,,'`
1669 at_fail_list=`for f in ?/fail ??/fail ???/fail ????/fail; do
1670                 echo $f; done | sed '/?/d; s,/fail,,'`
1671
1672 set X $at_pass_list $at_xpass_list $at_xfail_list $at_fail_list $at_skip_list
1673 shift; at_group_count=$#
1674 set X $at_xpass_list; shift; at_xpass_count=$#; at_xpass_list=$*
1675 set X $at_xfail_list; shift; at_xfail_count=$#
1676 set X $at_fail_list; shift; at_fail_count=$#; at_fail_list=$*
1677 set X $at_skip_list; shift; at_skip_count=$#
1678
1679 at_func_arith $at_group_count - $at_skip_count
1680 at_run_count=$at_func_arith_result
1681 at_func_arith $at_xpass_count + $at_fail_count
1682 at_unexpected_count=$at_func_arith_result
1683 at_func_arith $at_xfail_count + $at_fail_count
1684 at_total_fail_count=$at_func_arith_result
1685
1686 # Back to the top directory.
1687 cd "$at_dir"
1688 rm -rf "$at_helper_dir"
1689
1690 # Compute the duration of the suite.
1691 at_stop_date=`date`
1692 at_stop_time=`date +%s 2>/dev/null`
1693 $as_echo "$as_me: ending at: $at_stop_date" >&5
1694 case $at_start_time,$at_stop_time in
1695   [0-9]*,[0-9]*)
1696     at_func_arith $at_stop_time - $at_start_time
1697     at_duration_s=$at_func_arith_result
1698     at_func_arith $at_duration_s / 60
1699     at_duration_m=$at_func_arith_result
1700     at_func_arith $at_duration_m / 60
1701     at_duration_h=$at_func_arith_result
1702     at_func_arith $at_duration_s % 60
1703     at_duration_s=$at_func_arith_result
1704     at_func_arith $at_duration_m % 60
1705     at_duration_m=$at_func_arith_result
1706     at_duration="${at_duration_h}h ${at_duration_m}m ${at_duration_s}s"
1707     $as_echo "$as_me: test suite duration: $at_duration" >&5
1708     ;;
1709 esac
1710
1711 echo
1712 cat <<\_ASBOX
1713 ## ------------- ##
1714 ## Test results. ##
1715 ## ------------- ##
1716 _ASBOX
1717 echo
1718 {
1719   echo
1720   cat <<\_ASBOX
1721 ## ------------- ##
1722 ## Test results. ##
1723 ## ------------- ##
1724 _ASBOX
1725   echo
1726 } >&5
1727
1728 if test $at_run_count = 1; then
1729   at_result="1 test"
1730   at_were=was
1731 else
1732   at_result="$at_run_count tests"
1733   at_were=were
1734 fi
1735 if $at_errexit_p && test $at_unexpected_count != 0; then
1736   if test $at_xpass_count = 1; then
1737     at_result="$at_result $at_were run, one passed"
1738   else
1739     at_result="$at_result $at_were run, one failed"
1740   fi
1741   at_result="$at_result unexpectedly and inhibited subsequent tests."
1742 else
1743   # Don't you just love exponential explosion of the number of cases?
1744   case $at_xpass_count:$at_fail_count:$at_xfail_count in
1745     # So far, so good.
1746     0:0:0) at_result="$at_result $at_were successful." ;;
1747     0:0:*) at_result="$at_result behaved as expected." ;;
1748
1749     # Some unexpected failures
1750     0:*:0) at_result="$at_result $at_were run,
1751 $at_fail_count failed unexpectedly." ;;
1752
1753     # Some failures, both expected and unexpected
1754     0:*:1) at_result="$at_result $at_were run,
1755 $at_total_fail_count failed ($at_xfail_count expected failure)." ;;
1756     0:*:*) at_result="$at_result $at_were run,
1757 $at_total_fail_count failed ($at_xfail_count expected failures)." ;;
1758
1759     # No unexpected failures, but some xpasses
1760     *:0:*) at_result="$at_result $at_were run,
1761 $at_xpass_count passed unexpectedly." ;;
1762
1763     # No expected failures, but failures and xpasses
1764     *:1:0) at_result="$at_result $at_were run,
1765 $at_unexpected_count did not behave as expected ($at_fail_count unexpected failure)." ;;
1766     *:*:0) at_result="$at_result $at_were run,
1767 $at_unexpected_count did not behave as expected ($at_fail_count unexpected failures)." ;;
1768
1769     # All of them.
1770     *:*:1) at_result="$at_result $at_were run,
1771 $at_xpass_count passed unexpectedly,
1772 $at_total_fail_count failed ($at_xfail_count expected failure)." ;;
1773     *:*:*) at_result="$at_result $at_were run,
1774 $at_xpass_count passed unexpectedly,
1775 $at_total_fail_count failed ($at_xfail_count expected failures)." ;;
1776   esac
1777
1778   if test $at_skip_count = 0 && test $at_run_count -gt 1; then
1779     at_result="All $at_result"
1780   fi
1781 fi
1782
1783 # Now put skips in the mix.
1784 case $at_skip_count in
1785   0) ;;
1786   1) at_result="$at_result
1787 1 test was skipped." ;;
1788   *) at_result="$at_result
1789 $at_skip_count tests were skipped." ;;
1790 esac
1791
1792 if test $at_unexpected_count = 0; then
1793   echo "$at_result"
1794   echo "$at_result" >&5
1795 else
1796   echo "ERROR: $at_result" >&2
1797   echo "ERROR: $at_result" >&5
1798   {
1799     echo
1800     cat <<\_ASBOX
1801 ## ------------------------ ##
1802 ## Summary of the failures. ##
1803 ## ------------------------ ##
1804 _ASBOX
1805
1806     # Summary of failed and skipped tests.
1807     if test $at_fail_count != 0; then
1808       echo "Failed tests:"
1809       $SHELL "$at_myself" $at_fail_list --list
1810       echo
1811     fi
1812     if test $at_skip_count != 0; then
1813       echo "Skipped tests:"
1814       $SHELL "$at_myself" $at_skip_list --list
1815       echo
1816     fi
1817     if test $at_xpass_count != 0; then
1818       echo "Unexpected passes:"
1819       $SHELL "$at_myself" $at_xpass_list --list
1820       echo
1821     fi
1822     if test $at_fail_count != 0; then
1823       cat <<\_ASBOX
1824 ## ---------------------- ##
1825 ## Detailed failed tests. ##
1826 ## ---------------------- ##
1827 _ASBOX
1828       echo
1829       for at_group in $at_fail_list
1830       do
1831         at_group_normalized=$at_group
1832
1833   eval 'while :; do
1834     case $at_group_normalized in #(
1835     '"$at_format"'*) break;;
1836     esac
1837     at_group_normalized=0$at_group_normalized
1838   done'
1839
1840         cat "$at_suite_dir/$at_group_normalized/$as_me.log"
1841         echo
1842       done
1843       echo
1844     fi
1845     if test -n "$at_top_srcdir"; then
1846       sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
1847 ## ${at_top_build_prefix}config.log ##
1848 _ASBOX
1849       sed 's/^/| /' ${at_top_build_prefix}config.log
1850       echo
1851     fi
1852   } >&5
1853
1854   sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
1855 ## $as_me.log was created. ##
1856 _ASBOX
1857
1858   echo
1859   $as_echo "Please send \`${at_testdir+${at_testdir}/}$as_me.log' and all information you think might help:
1860
1861    To: <bug-gdbm@gnu.org>
1862    Subject: [gdbm 1.10] $as_me: $at_fail_list${at_fail_list:+ failed${at_xpass_list:+, }}$at_xpass_list${at_xpass_list:+ passed unexpectedly}
1863 "
1864   if test $at_debug_p = false; then
1865     echo
1866     echo 'You may investigate any problem if you feel able to do so, in which'
1867     echo 'case the test suite provides a good starting point.  Its output may'
1868     $as_echo "be found below \`${at_testdir+${at_testdir}/}$as_me.dir'."
1869     echo
1870   fi
1871     exit 1
1872 fi
1873
1874 exit 0
1875
1876 ## ------------- ##
1877 ## Actual tests. ##
1878 ## ------------- ##
1879 #AT_START_1
1880 # 1. version.at:17: gdbm version
1881 at_setup_line='version.at:17'
1882 at_desc="gdbm version"
1883 $at_quiet $as_echo_n "  1: $at_desc                                   "
1884 at_xfail=no
1885 echo "#                             -*- compilation -*-" >> "$at_group_log"
1886 (
1887   $as_echo "1. version.at:17: testing ..."
1888   $at_traceon
1889
1890
1891 { $at_traceoff
1892 $as_echo "$at_srcdir/version.at:19: gtver -lib -full -header -full"
1893 echo version.at:19 >"$at_check_line_file"
1894
1895 if test -n "$at_traceon"; then
1896   ( $at_traceon; gtver -lib -full -header -full ) >"$at_stdout" 2>"$at_stder1"
1897   at_func_filter_trace $?
1898 else
1899   ( :; gtver -lib -full -header -full ) >"$at_stdout" 2>"$at_stderr"
1900 fi
1901 at_status=$?
1902 at_failed=false
1903 at_func_diff_devnull "$at_stderr" || at_failed=:
1904 echo >>"$at_stdout"; $as_echo "1.10.0
1905 1.10.0
1906 " | \
1907   $at_diff - "$at_stdout" || at_failed=:
1908 at_func_check_status 0 $at_status "$at_srcdir/version.at:19"
1909
1910 $at_failed && at_func_log_failure
1911 $at_traceon; }
1912
1913
1914   $at_traceoff
1915   $at_times_p && times >"$at_times_file"
1916 ) 5>&1 2>&1 | eval $at_tee_pipe
1917 at_status=`cat "$at_status_file"`
1918 #AT_STOP_1
1919 #AT_START_2
1920 # 2. create00.at:17: create database
1921 at_setup_line='create00.at:17'
1922 at_func_banner 1
1923 at_desc="create database"
1924 $at_quiet $as_echo_n "  2: $at_desc                                "
1925 at_xfail=no
1926 echo "#                             -*- compilation -*-" >> "$at_group_log"
1927 (
1928   $as_echo "2. create00.at:17: testing ..."
1929   $at_traceon
1930
1931
1932
1933 { $at_traceoff
1934 $as_echo "$at_srcdir/create00.at:20:
1935
1936 test -z "`sort < /dev/null 2>&1`" || exit 77
1937
1938 num2word 1:1000 > input
1939 gtload test.db < input
1940 gtdump test.db | sort -k1,2 -n > output
1941 diff -u input output
1942 "
1943 echo create00.at:20 >"$at_check_line_file"
1944
1945 if { echo 'Not enabling shell tracing (command contains an embedded newline)'
1946    false; }; then
1947   ( $at_traceon;
1948
1949 test -z "`sort < /dev/null 2>&1`" || exit 77
1950
1951 num2word 1:1000 > input
1952 gtload test.db < input
1953 gtdump test.db | sort -k1,2 -n > output
1954 diff -u input output
1955  ) >"$at_stdout" 2>"$at_stder1"
1956   at_func_filter_trace $?
1957 else
1958   ( :;
1959
1960 test -z "`sort < /dev/null 2>&1`" || exit 77
1961
1962 num2word 1:1000 > input
1963 gtload test.db < input
1964 gtdump test.db | sort -k1,2 -n > output
1965 diff -u input output
1966  ) >"$at_stdout" 2>"$at_stderr"
1967 fi
1968 at_status=$?
1969 at_failed=false
1970 at_func_diff_devnull "$at_stderr" || at_failed=:
1971 at_func_diff_devnull "$at_stdout" || at_failed=:
1972 at_func_check_status 0 $at_status "$at_srcdir/create00.at:20"
1973
1974 $at_failed && at_func_log_failure
1975 $at_traceon; }
1976
1977
1978   $at_traceoff
1979   $at_times_p && times >"$at_times_file"
1980 ) 5>&1 2>&1 | eval $at_tee_pipe
1981 at_status=`cat "$at_status_file"`
1982 #AT_STOP_2
1983 #AT_START_3
1984 # 3. fetch00.at:17: fetch a record
1985 at_setup_line='fetch00.at:17'
1986 at_func_banner 1
1987 at_desc="fetch a record"
1988 $at_quiet $as_echo_n "  3: $at_desc                                 "
1989 at_xfail=no
1990 echo "#                             -*- compilation -*-" >> "$at_group_log"
1991 (
1992   $as_echo "3. fetch00.at:17: testing ..."
1993   $at_traceon
1994
1995
1996
1997 { $at_traceoff
1998 $as_echo "$at_srcdir/fetch00.at:20:
1999 num2word 1:10000 | gtload test.db
2000 gtfetch test.db 1 2745 9999
2001 "
2002 echo fetch00.at:20 >"$at_check_line_file"
2003
2004 if { echo 'Not enabling shell tracing (command contains an embedded newline)'
2005    false; }; then
2006   ( $at_traceon;
2007 num2word 1:10000 | gtload test.db
2008 gtfetch test.db 1 2745 9999
2009  ) >"$at_stdout" 2>"$at_stder1"
2010   at_func_filter_trace $?
2011 else
2012   ( :;
2013 num2word 1:10000 | gtload test.db
2014 gtfetch test.db 1 2745 9999
2015  ) >"$at_stdout" 2>"$at_stderr"
2016 fi
2017 at_status=$?
2018 at_failed=false
2019 at_func_diff_devnull "$at_stderr" || at_failed=:
2020 echo >>"$at_stdout"; $as_echo "one
2021 two thousand seven hundred and fourty-five
2022 nine thousand nine hundred and ninety-nine
2023 " | \
2024   $at_diff - "$at_stdout" || at_failed=:
2025 at_func_check_status 0 $at_status "$at_srcdir/fetch00.at:20"
2026
2027 $at_failed && at_func_log_failure
2028 $at_traceon; }
2029
2030
2031   $at_traceoff
2032   $at_times_p && times >"$at_times_file"
2033 ) 5>&1 2>&1 | eval $at_tee_pipe
2034 at_status=`cat "$at_status_file"`
2035 #AT_STOP_3
2036 #AT_START_4
2037 # 4. fetch01.at:17: fetch: nonexisting record
2038 at_setup_line='fetch01.at:17'
2039 at_func_banner 1
2040 at_desc="fetch: nonexisting record"
2041 $at_quiet $as_echo_n "  4: $at_desc                      "
2042 at_xfail=no
2043 echo "#                             -*- compilation -*-" >> "$at_group_log"
2044 (
2045   $as_echo "4. fetch01.at:17: testing ..."
2046   $at_traceon
2047
2048
2049
2050 { $at_traceoff
2051 $as_echo "$at_srcdir/fetch01.at:20:
2052 num2word 1:10000 | gtload test.db
2053 gtfetch test.db 0
2054 "
2055 echo fetch01.at:20 >"$at_check_line_file"
2056
2057 if { echo 'Not enabling shell tracing (command contains an embedded newline)'
2058    false; }; then
2059   ( $at_traceon;
2060 num2word 1:10000 | gtload test.db
2061 gtfetch test.db 0
2062  ) >"$at_stdout" 2>"$at_stder1"
2063   at_func_filter_trace $?
2064 else
2065   ( :;
2066 num2word 1:10000 | gtload test.db
2067 gtfetch test.db 0
2068  ) >"$at_stdout" 2>"$at_stderr"
2069 fi
2070 at_status=$?
2071 at_failed=false
2072 echo >>"$at_stderr"; $as_echo "gtfetch: 0: not found
2073 " | \
2074   $at_diff - "$at_stderr" || at_failed=:
2075 at_func_diff_devnull "$at_stdout" || at_failed=:
2076 at_func_check_status 2 $at_status "$at_srcdir/fetch01.at:20"
2077
2078 $at_failed && at_func_log_failure
2079 $at_traceon; }
2080
2081
2082   $at_traceoff
2083   $at_times_p && times >"$at_times_file"
2084 ) 5>&1 2>&1 | eval $at_tee_pipe
2085 at_status=`cat "$at_status_file"`
2086 #AT_STOP_4
2087 #AT_START_5
2088 # 5. delete00.at:17: delete a record
2089 at_setup_line='delete00.at:17'
2090 at_func_banner 1
2091 at_desc="delete a record"
2092 $at_quiet $as_echo_n "  5: $at_desc                                "
2093 at_xfail=no
2094 echo "#                             -*- compilation -*-" >> "$at_group_log"
2095 (
2096   $as_echo "5. delete00.at:17: testing ..."
2097   $at_traceon
2098
2099
2100
2101 { $at_traceoff
2102 $as_echo "$at_srcdir/delete00.at:20:
2103
2104 test -z "`sort < /dev/null 2>&1`" || exit 77
2105
2106 num2word 1:10 | gtload test.db
2107 gtdel test.db 8
2108 gtdump test.db | sort -k1,2 -n
2109 "
2110 echo delete00.at:20 >"$at_check_line_file"
2111
2112 if { echo 'Not enabling shell tracing (command contains an embedded newline)'
2113    false; }; then
2114   ( $at_traceon;
2115
2116 test -z "`sort < /dev/null 2>&1`" || exit 77
2117
2118 num2word 1:10 | gtload test.db
2119 gtdel test.db 8
2120 gtdump test.db | sort -k1,2 -n
2121  ) >"$at_stdout" 2>"$at_stder1"
2122   at_func_filter_trace $?
2123 else
2124   ( :;
2125
2126 test -z "`sort < /dev/null 2>&1`" || exit 77
2127
2128 num2word 1:10 | gtload test.db
2129 gtdel test.db 8
2130 gtdump test.db | sort -k1,2 -n
2131  ) >"$at_stdout" 2>"$at_stderr"
2132 fi
2133 at_status=$?
2134 at_failed=false
2135 at_func_diff_devnull "$at_stderr" || at_failed=:
2136 echo >>"$at_stdout"; $as_echo "1        one
2137 2       two
2138 3       three
2139 4       four
2140 5       five
2141 6       six
2142 7       seven
2143 9       nine
2144 10      ten
2145 " | \
2146   $at_diff - "$at_stdout" || at_failed=:
2147 at_func_check_status 0 $at_status "$at_srcdir/delete00.at:20"
2148
2149 $at_failed && at_func_log_failure
2150 $at_traceon; }
2151
2152
2153   $at_traceoff
2154   $at_times_p && times >"$at_times_file"
2155 ) 5>&1 2>&1 | eval $at_tee_pipe
2156 at_status=`cat "$at_status_file"`
2157 #AT_STOP_5
2158 #AT_START_6
2159 # 6. delete01.at:17: delete: non existing record
2160 at_setup_line='delete01.at:17'
2161 at_func_banner 1
2162 at_desc="delete: non existing record"
2163 $at_quiet $as_echo_n "  6: $at_desc                    "
2164 at_xfail=no
2165 echo "#                             -*- compilation -*-" >> "$at_group_log"
2166 (
2167   $as_echo "6. delete01.at:17: testing ..."
2168   $at_traceon
2169
2170
2171
2172 { $at_traceoff
2173 $as_echo "$at_srcdir/delete01.at:20:
2174
2175 test -z "`sort < /dev/null 2>&1`" || exit 77
2176
2177 num2word 1:10 | gtload test.db
2178 gtdel test.db 11
2179 "
2180 echo delete01.at:20 >"$at_check_line_file"
2181
2182 if { echo 'Not enabling shell tracing (command contains an embedded newline)'
2183    false; }; then
2184   ( $at_traceon;
2185
2186 test -z "`sort < /dev/null 2>&1`" || exit 77
2187
2188 num2word 1:10 | gtload test.db
2189 gtdel test.db 11
2190  ) >"$at_stdout" 2>"$at_stder1"
2191   at_func_filter_trace $?
2192 else
2193   ( :;
2194
2195 test -z "`sort < /dev/null 2>&1`" || exit 77
2196
2197 num2word 1:10 | gtload test.db
2198 gtdel test.db 11
2199  ) >"$at_stdout" 2>"$at_stderr"
2200 fi
2201 at_status=$?
2202 at_failed=false
2203 echo >>"$at_stderr"; $as_echo "gtdel: cannot delete 11: Item not found
2204 " | \
2205   $at_diff - "$at_stderr" || at_failed=:
2206 at_func_diff_devnull "$at_stdout" || at_failed=:
2207 at_func_check_status 2 $at_status "$at_srcdir/delete01.at:20"
2208
2209 $at_failed && at_func_log_failure
2210 $at_traceon; }
2211
2212
2213   $at_traceoff
2214   $at_times_p && times >"$at_times_file"
2215 ) 5>&1 2>&1 | eval $at_tee_pipe
2216 at_status=`cat "$at_status_file"`
2217 #AT_STOP_6
2218 #AT_START_7
2219 # 7. delete02.at:17: delete: all records
2220 at_setup_line='delete02.at:17'
2221 at_func_banner 1
2222 at_desc="delete: all records"
2223 $at_quiet $as_echo_n "  7: $at_desc                            "
2224 at_xfail=no
2225 echo "#                             -*- compilation -*-" >> "$at_group_log"
2226 (
2227   $as_echo "7. delete02.at:17: testing ..."
2228   $at_traceon
2229
2230
2231
2232 { $at_traceoff
2233 $as_echo "$at_srcdir/delete02.at:20:
2234 num2word 1:10 | gtload test.db
2235 gtdel test.db 1 2 3 4 5 6 7 8 9 10
2236 gtdump test.db
2237 "
2238 echo delete02.at:20 >"$at_check_line_file"
2239
2240 if { echo 'Not enabling shell tracing (command contains an embedded newline)'
2241    false; }; then
2242   ( $at_traceon;
2243 num2word 1:10 | gtload test.db
2244 gtdel test.db 1 2 3 4 5 6 7 8 9 10
2245 gtdump test.db
2246  ) >"$at_stdout" 2>"$at_stder1"
2247   at_func_filter_trace $?
2248 else
2249   ( :;
2250 num2word 1:10 | gtload test.db
2251 gtdel test.db 1 2 3 4 5 6 7 8 9 10
2252 gtdump test.db
2253  ) >"$at_stdout" 2>"$at_stderr"
2254 fi
2255 at_status=$?
2256 at_failed=false
2257 at_func_diff_devnull "$at_stderr" || at_failed=:
2258 at_func_diff_devnull "$at_stdout" || at_failed=:
2259 at_func_check_status 0 $at_status "$at_srcdir/delete02.at:20"
2260
2261 $at_failed && at_func_log_failure
2262 $at_traceon; }
2263
2264
2265   $at_traceoff
2266   $at_times_p && times >"$at_times_file"
2267 ) 5>&1 2>&1 | eval $at_tee_pipe
2268 at_status=`cat "$at_status_file"`
2269 #AT_STOP_7
2270 #AT_START_8
2271 # 8. dbmcreate00.at:17: create database
2272 at_setup_line='dbmcreate00.at:17'
2273 at_func_banner 2
2274 at_desc="create database"
2275 $at_quiet $as_echo_n "  8: $at_desc                                "
2276 at_xfail=no
2277 echo "#                             -*- compilation -*-" >> "$at_group_log"
2278 (
2279   $as_echo "8. dbmcreate00.at:17: testing ..."
2280   $at_traceon
2281
2282
2283
2284 { $at_traceoff
2285 $as_echo "$at_srcdir/dbmcreate00.at:20:
2286
2287 test $COMPAT -eq 1 || exit 77
2288
2289
2290 test -z "`sort < /dev/null 2>&1`" || exit 77
2291
2292 num2word 1:1000 > input
2293 dtload test < input
2294 dtdump test | sort -k1,2 -n > output
2295 diff -u input output
2296 "
2297 echo dbmcreate00.at:20 >"$at_check_line_file"
2298
2299 if { echo 'Not enabling shell tracing (command contains an embedded newline)'
2300    false; }; then
2301   ( $at_traceon;
2302
2303 test $COMPAT -eq 1 || exit 77
2304
2305
2306 test -z "`sort < /dev/null 2>&1`" || exit 77
2307
2308 num2word 1:1000 > input
2309 dtload test < input
2310 dtdump test | sort -k1,2 -n > output
2311 diff -u input output
2312  ) >"$at_stdout" 2>"$at_stder1"
2313   at_func_filter_trace $?
2314 else
2315   ( :;
2316
2317 test $COMPAT -eq 1 || exit 77
2318
2319
2320 test -z "`sort < /dev/null 2>&1`" || exit 77
2321
2322 num2word 1:1000 > input
2323 dtload test < input
2324 dtdump test | sort -k1,2 -n > output
2325 diff -u input output
2326  ) >"$at_stdout" 2>"$at_stderr"
2327 fi
2328 at_status=$?
2329 at_failed=false
2330 at_func_diff_devnull "$at_stderr" || at_failed=:
2331 at_func_diff_devnull "$at_stdout" || at_failed=:
2332 at_func_check_status 0 $at_status "$at_srcdir/dbmcreate00.at:20"
2333
2334 $at_failed && at_func_log_failure
2335 $at_traceon; }
2336
2337
2338   $at_traceoff
2339   $at_times_p && times >"$at_times_file"
2340 ) 5>&1 2>&1 | eval $at_tee_pipe
2341 at_status=`cat "$at_status_file"`
2342 #AT_STOP_8
2343 #AT_START_9
2344 # 9. dbmcvt.at:17: converting a 1.8-style database
2345 at_setup_line='dbmcvt.at:17'
2346 at_func_banner 2
2347 at_desc="converting a 1.8-style database"
2348 $at_quiet $as_echo_n "  9: $at_desc                "
2349 at_xfail=no
2350 echo "#                             -*- compilation -*-" >> "$at_group_log"
2351 (
2352   $as_echo "9. dbmcvt.at:17: testing ..."
2353   $at_traceon
2354
2355
2356
2357 { $at_traceoff
2358 $as_echo "$at_srcdir/dbmcvt.at:20:
2359
2360 test $COMPAT -eq 1 || exit 77
2361
2362 num2word 1:10 | dtload test
2363 rm test.dir
2364 ln test.pag test.dir
2365 dtfetch test 6
2366 cmp test.pag test.dir >/dev/null 2>&1 && exit 1
2367 exit 0
2368 "
2369 echo dbmcvt.at:20 >"$at_check_line_file"
2370
2371 if { echo 'Not enabling shell tracing (command contains an embedded newline)'
2372    false; }; then
2373   ( $at_traceon;
2374
2375 test $COMPAT -eq 1 || exit 77
2376
2377 num2word 1:10 | dtload test
2378 rm test.dir
2379 ln test.pag test.dir
2380 dtfetch test 6
2381 cmp test.pag test.dir >/dev/null 2>&1 && exit 1
2382 exit 0
2383  ) >"$at_stdout" 2>"$at_stder1"
2384   at_func_filter_trace $?
2385 else
2386   ( :;
2387
2388 test $COMPAT -eq 1 || exit 77
2389
2390 num2word 1:10 | dtload test
2391 rm test.dir
2392 ln test.pag test.dir
2393 dtfetch test 6
2394 cmp test.pag test.dir >/dev/null 2>&1 && exit 1
2395 exit 0
2396  ) >"$at_stdout" 2>"$at_stderr"
2397 fi
2398 at_status=$?
2399 at_failed=false
2400 at_func_diff_devnull "$at_stderr" || at_failed=:
2401 echo >>"$at_stdout"; $as_echo "six
2402 " | \
2403   $at_diff - "$at_stdout" || at_failed=:
2404 at_func_check_status 0 $at_status "$at_srcdir/dbmcvt.at:20"
2405
2406 $at_failed && at_func_log_failure
2407 $at_traceon; }
2408
2409
2410   $at_traceoff
2411   $at_times_p && times >"$at_times_file"
2412 ) 5>&1 2>&1 | eval $at_tee_pipe
2413 at_status=`cat "$at_status_file"`
2414 #AT_STOP_9
2415 #AT_START_10
2416 # 10. dbmfetch00.at:17: fetch a record
2417 at_setup_line='dbmfetch00.at:17'
2418 at_func_banner 2
2419 at_desc="fetch a record"
2420 $at_quiet $as_echo_n " 10: $at_desc                                 "
2421 at_xfail=no
2422 echo "#                             -*- compilation -*-" >> "$at_group_log"
2423 (
2424   $as_echo "10. dbmfetch00.at:17: testing ..."
2425   $at_traceon
2426
2427
2428
2429 { $at_traceoff
2430 $as_echo "$at_srcdir/dbmfetch00.at:20:
2431
2432 test $COMPAT -eq 1 || exit 77
2433
2434 num2word 1:10000 | dtload test
2435 dtfetch test 1 2745 9999
2436 "
2437 echo dbmfetch00.at:20 >"$at_check_line_file"
2438
2439 if { echo 'Not enabling shell tracing (command contains an embedded newline)'
2440    false; }; then
2441   ( $at_traceon;
2442
2443 test $COMPAT -eq 1 || exit 77
2444
2445 num2word 1:10000 | dtload test
2446 dtfetch test 1 2745 9999
2447  ) >"$at_stdout" 2>"$at_stder1"
2448   at_func_filter_trace $?
2449 else
2450   ( :;
2451
2452 test $COMPAT -eq 1 || exit 77
2453
2454 num2word 1:10000 | dtload test
2455 dtfetch test 1 2745 9999
2456  ) >"$at_stdout" 2>"$at_stderr"
2457 fi
2458 at_status=$?
2459 at_failed=false
2460 at_func_diff_devnull "$at_stderr" || at_failed=:
2461 echo >>"$at_stdout"; $as_echo "one
2462 two thousand seven hundred and fourty-five
2463 nine thousand nine hundred and ninety-nine
2464 " | \
2465   $at_diff - "$at_stdout" || at_failed=:
2466 at_func_check_status 0 $at_status "$at_srcdir/dbmfetch00.at:20"
2467
2468 $at_failed && at_func_log_failure
2469 $at_traceon; }
2470
2471
2472   $at_traceoff
2473   $at_times_p && times >"$at_times_file"
2474 ) 5>&1 2>&1 | eval $at_tee_pipe
2475 at_status=`cat "$at_status_file"`
2476 #AT_STOP_10
2477 #AT_START_11
2478 # 11. dbmfetch01.at:17: fetch: nonexisting record
2479 at_setup_line='dbmfetch01.at:17'
2480 at_func_banner 2
2481 at_desc="fetch: nonexisting record"
2482 $at_quiet $as_echo_n " 11: $at_desc                      "
2483 at_xfail=no
2484 echo "#                             -*- compilation -*-" >> "$at_group_log"
2485 (
2486   $as_echo "11. dbmfetch01.at:17: testing ..."
2487   $at_traceon
2488
2489
2490
2491 { $at_traceoff
2492 $as_echo "$at_srcdir/dbmfetch01.at:20:
2493
2494 test $COMPAT -eq 1 || exit 77
2495
2496 num2word 1:10000 | dtload test
2497 dtfetch test 0
2498 "
2499 echo dbmfetch01.at:20 >"$at_check_line_file"
2500
2501 if { echo 'Not enabling shell tracing (command contains an embedded newline)'
2502    false; }; then
2503   ( $at_traceon;
2504
2505 test $COMPAT -eq 1 || exit 77
2506
2507 num2word 1:10000 | dtload test
2508 dtfetch test 0
2509  ) >"$at_stdout" 2>"$at_stder1"
2510   at_func_filter_trace $?
2511 else
2512   ( :;
2513
2514 test $COMPAT -eq 1 || exit 77
2515
2516 num2word 1:10000 | dtload test
2517 dtfetch test 0
2518  ) >"$at_stdout" 2>"$at_stderr"
2519 fi
2520 at_status=$?
2521 at_failed=false
2522 echo >>"$at_stderr"; $as_echo "dtfetch: 0: not found
2523 " | \
2524   $at_diff - "$at_stderr" || at_failed=:
2525 at_func_diff_devnull "$at_stdout" || at_failed=:
2526 at_func_check_status 2 $at_status "$at_srcdir/dbmfetch01.at:20"
2527
2528 $at_failed && at_func_log_failure
2529 $at_traceon; }
2530
2531
2532   $at_traceoff
2533   $at_times_p && times >"$at_times_file"
2534 ) 5>&1 2>&1 | eval $at_tee_pipe
2535 at_status=`cat "$at_status_file"`
2536 #AT_STOP_11
2537 #AT_START_12
2538 # 12. dbmfetch02.at:17: fetch from a read-only database
2539 at_setup_line='dbmfetch02.at:17'
2540 at_func_banner 2
2541 at_desc="fetch from a read-only database"
2542 $at_quiet $as_echo_n " 12: $at_desc                "
2543 at_xfail=no
2544 echo "#                             -*- compilation -*-" >> "$at_group_log"
2545 (
2546   $as_echo "12. dbmfetch02.at:17: testing ..."
2547   $at_traceon
2548
2549
2550
2551 { $at_traceoff
2552 $as_echo "$at_srcdir/dbmfetch02.at:20:
2553
2554 test $COMPAT -eq 1 || exit 77
2555
2556 num2word 1:10 | dtload test
2557 chmod -w test.dir test.pag
2558 dtfetch test 6 10
2559 "
2560 echo dbmfetch02.at:20 >"$at_check_line_file"
2561
2562 if { echo 'Not enabling shell tracing (command contains an embedded newline)'
2563    false; }; then
2564   ( $at_traceon;
2565
2566 test $COMPAT -eq 1 || exit 77
2567
2568 num2word 1:10 | dtload test
2569 chmod -w test.dir test.pag
2570 dtfetch test 6 10
2571  ) >"$at_stdout" 2>"$at_stder1"
2572   at_func_filter_trace $?
2573 else
2574   ( :;
2575
2576 test $COMPAT -eq 1 || exit 77
2577
2578 num2word 1:10 | dtload test
2579 chmod -w test.dir test.pag
2580 dtfetch test 6 10
2581  ) >"$at_stdout" 2>"$at_stderr"
2582 fi
2583 at_status=$?
2584 at_failed=false
2585 at_func_diff_devnull "$at_stderr" || at_failed=:
2586 echo >>"$at_stdout"; $as_echo "six
2587 ten
2588 " | \
2589   $at_diff - "$at_stdout" || at_failed=:
2590 at_func_check_status 0 $at_status "$at_srcdir/dbmfetch02.at:20"
2591
2592 $at_failed && at_func_log_failure
2593 $at_traceon; }
2594
2595
2596   $at_traceoff
2597   $at_times_p && times >"$at_times_file"
2598 ) 5>&1 2>&1 | eval $at_tee_pipe
2599 at_status=`cat "$at_status_file"`
2600 #AT_STOP_12
2601 #AT_START_13
2602 # 13. dbmfetch03.at:17: fetch from a read-only 1.8-style database
2603 at_setup_line='dbmfetch03.at:17'
2604 at_func_banner 2
2605 at_desc="fetch from a read-only 1.8-style database"
2606 $at_quiet $as_echo_n " 13: $at_desc      "
2607 at_xfail=no
2608 echo "#                             -*- compilation -*-" >> "$at_group_log"
2609 (
2610   $as_echo "13. dbmfetch03.at:17: testing ..."
2611   $at_traceon
2612
2613
2614
2615 { $at_traceoff
2616 $as_echo "$at_srcdir/dbmfetch03.at:20:
2617
2618 test $COMPAT -eq 1 || exit 77
2619
2620 mkdir dir
2621 cd dir
2622 num2word 1:10 | dtload test
2623 rm test.dir
2624 ln test.pag test.dir
2625 chmod -w test.dir test.pag .
2626 dtfetch test 6 10
2627 "
2628 echo dbmfetch03.at:20 >"$at_check_line_file"
2629
2630 if { echo 'Not enabling shell tracing (command contains an embedded newline)'
2631    false; }; then
2632   ( $at_traceon;
2633
2634 test $COMPAT -eq 1 || exit 77
2635
2636 mkdir dir
2637 cd dir
2638 num2word 1:10 | dtload test
2639 rm test.dir
2640 ln test.pag test.dir
2641 chmod -w test.dir test.pag .
2642 dtfetch test 6 10
2643  ) >"$at_stdout" 2>"$at_stder1"
2644   at_func_filter_trace $?
2645 else
2646   ( :;
2647
2648 test $COMPAT -eq 1 || exit 77
2649
2650 mkdir dir
2651 cd dir
2652 num2word 1:10 | dtload test
2653 rm test.dir
2654 ln test.pag test.dir
2655 chmod -w test.dir test.pag .
2656 dtfetch test 6 10
2657  ) >"$at_stdout" 2>"$at_stderr"
2658 fi
2659 at_status=$?
2660 at_failed=false
2661 at_func_diff_devnull "$at_stderr" || at_failed=:
2662 echo >>"$at_stdout"; $as_echo "six
2663 ten
2664 " | \
2665   $at_diff - "$at_stdout" || at_failed=:
2666 at_func_check_status 0 $at_status "$at_srcdir/dbmfetch03.at:20"
2667
2668 $at_failed && at_func_log_failure
2669 $at_traceon; }
2670
2671
2672   $at_traceoff
2673   $at_times_p && times >"$at_times_file"
2674 ) 5>&1 2>&1 | eval $at_tee_pipe
2675 at_status=`cat "$at_status_file"`
2676 #AT_STOP_13
2677 #AT_START_14
2678 # 14. dbmdel00.at:17: delete a record
2679 at_setup_line='dbmdel00.at:17'
2680 at_func_banner 2
2681 at_desc="delete a record"
2682 $at_quiet $as_echo_n " 14: $at_desc                                "
2683 at_xfail=no
2684 echo "#                             -*- compilation -*-" >> "$at_group_log"
2685 (
2686   $as_echo "14. dbmdel00.at:17: testing ..."
2687   $at_traceon
2688
2689
2690
2691 { $at_traceoff
2692 $as_echo "$at_srcdir/dbmdel00.at:20:
2693
2694 test $COMPAT -eq 1 || exit 77
2695
2696
2697 test -z "`sort < /dev/null 2>&1`" || exit 77
2698
2699 num2word 1:10 | dtload test
2700 dtdel test 8
2701 dtdump test | sort -k1,2 -n
2702 "
2703 echo dbmdel00.at:20 >"$at_check_line_file"
2704
2705 if { echo 'Not enabling shell tracing (command contains an embedded newline)'
2706    false; }; then
2707   ( $at_traceon;
2708
2709 test $COMPAT -eq 1 || exit 77
2710
2711
2712 test -z "`sort < /dev/null 2>&1`" || exit 77
2713
2714 num2word 1:10 | dtload test
2715 dtdel test 8
2716 dtdump test | sort -k1,2 -n
2717  ) >"$at_stdout" 2>"$at_stder1"
2718   at_func_filter_trace $?
2719 else
2720   ( :;
2721
2722 test $COMPAT -eq 1 || exit 77
2723
2724
2725 test -z "`sort < /dev/null 2>&1`" || exit 77
2726
2727 num2word 1:10 | dtload test
2728 dtdel test 8
2729 dtdump test | sort -k1,2 -n
2730  ) >"$at_stdout" 2>"$at_stderr"
2731 fi
2732 at_status=$?
2733 at_failed=false
2734 at_func_diff_devnull "$at_stderr" || at_failed=:
2735 echo >>"$at_stdout"; $as_echo "1        one
2736 2       two
2737 3       three
2738 4       four
2739 5       five
2740 6       six
2741 7       seven
2742 9       nine
2743 10      ten
2744 " | \
2745   $at_diff - "$at_stdout" || at_failed=:
2746 at_func_check_status 0 $at_status "$at_srcdir/dbmdel00.at:20"
2747
2748 $at_failed && at_func_log_failure
2749 $at_traceon; }
2750
2751
2752   $at_traceoff
2753   $at_times_p && times >"$at_times_file"
2754 ) 5>&1 2>&1 | eval $at_tee_pipe
2755 at_status=`cat "$at_status_file"`
2756 #AT_STOP_14
2757 #AT_START_15
2758 # 15. dbmdel01.at:17: delete: non existing record
2759 at_setup_line='dbmdel01.at:17'
2760 at_func_banner 2
2761 at_desc="delete: non existing record"
2762 $at_quiet $as_echo_n " 15: $at_desc                    "
2763 at_xfail=no
2764 echo "#                             -*- compilation -*-" >> "$at_group_log"
2765 (
2766   $as_echo "15. dbmdel01.at:17: testing ..."
2767   $at_traceon
2768
2769
2770
2771 { $at_traceoff
2772 $as_echo "$at_srcdir/dbmdel01.at:20:
2773
2774 test $COMPAT -eq 1 || exit 77
2775
2776
2777 test -z "`sort < /dev/null 2>&1`" || exit 77
2778
2779 num2word 1:10 | dtload test
2780 dtdel test 11
2781 "
2782 echo dbmdel01.at:20 >"$at_check_line_file"
2783
2784 if { echo 'Not enabling shell tracing (command contains an embedded newline)'
2785    false; }; then
2786   ( $at_traceon;
2787
2788 test $COMPAT -eq 1 || exit 77
2789
2790
2791 test -z "`sort < /dev/null 2>&1`" || exit 77
2792
2793 num2word 1:10 | dtload test
2794 dtdel test 11
2795  ) >"$at_stdout" 2>"$at_stder1"
2796   at_func_filter_trace $?
2797 else
2798   ( :;
2799
2800 test $COMPAT -eq 1 || exit 77
2801
2802
2803 test -z "`sort < /dev/null 2>&1`" || exit 77
2804
2805 num2word 1:10 | dtload test
2806 dtdel test 11
2807  ) >"$at_stdout" 2>"$at_stderr"
2808 fi
2809 at_status=$?
2810 at_failed=false
2811 echo >>"$at_stderr"; $as_echo "dtdel: cannot delete 11: Item not found
2812 " | \
2813   $at_diff - "$at_stderr" || at_failed=:
2814 at_func_diff_devnull "$at_stdout" || at_failed=:
2815 at_func_check_status 2 $at_status "$at_srcdir/dbmdel01.at:20"
2816
2817 $at_failed && at_func_log_failure
2818 $at_traceon; }
2819
2820
2821   $at_traceoff
2822   $at_times_p && times >"$at_times_file"
2823 ) 5>&1 2>&1 | eval $at_tee_pipe
2824 at_status=`cat "$at_status_file"`
2825 #AT_STOP_15
2826 #AT_START_16
2827 # 16. dbmdel02.at:17: delete: all records
2828 at_setup_line='dbmdel02.at:17'
2829 at_func_banner 2
2830 at_desc="delete: all records"
2831 $at_quiet $as_echo_n " 16: $at_desc                            "
2832 at_xfail=no
2833 echo "#                             -*- compilation -*-" >> "$at_group_log"
2834 (
2835   $as_echo "16. dbmdel02.at:17: testing ..."
2836   $at_traceon
2837
2838
2839
2840 { $at_traceoff
2841 $as_echo "$at_srcdir/dbmdel02.at:20:
2842
2843 test $COMPAT -eq 1 || exit 77
2844
2845 num2word 1:10 | dtload test
2846 dtdel test 1 2 3 4 5 6 7 8 9 10
2847 dtdump test
2848 "
2849 echo dbmdel02.at:20 >"$at_check_line_file"
2850
2851 if { echo 'Not enabling shell tracing (command contains an embedded newline)'
2852    false; }; then
2853   ( $at_traceon;
2854
2855 test $COMPAT -eq 1 || exit 77
2856
2857 num2word 1:10 | dtload test
2858 dtdel test 1 2 3 4 5 6 7 8 9 10
2859 dtdump test
2860  ) >"$at_stdout" 2>"$at_stder1"
2861   at_func_filter_trace $?
2862 else
2863   ( :;
2864
2865 test $COMPAT -eq 1 || exit 77
2866
2867 num2word 1:10 | dtload test
2868 dtdel test 1 2 3 4 5 6 7 8 9 10
2869 dtdump test
2870  ) >"$at_stdout" 2>"$at_stderr"
2871 fi
2872 at_status=$?
2873 at_failed=false
2874 at_func_diff_devnull "$at_stderr" || at_failed=:
2875 at_func_diff_devnull "$at_stdout" || at_failed=:
2876 at_func_check_status 0 $at_status "$at_srcdir/dbmdel02.at:20"
2877
2878 $at_failed && at_func_log_failure
2879 $at_traceon; }
2880
2881
2882   $at_traceoff
2883   $at_times_p && times >"$at_times_file"
2884 ) 5>&1 2>&1 | eval $at_tee_pipe
2885 at_status=`cat "$at_status_file"`
2886 #AT_STOP_16
2887 #AT_START_17
2888 # 17. setopt00.at:17: setopt
2889 at_setup_line='setopt00.at:17'
2890 at_func_banner 3
2891 at_desc="setopt"
2892 $at_quiet $as_echo_n " 17: $at_desc                                         "
2893 at_xfail=no
2894 echo "#                             -*- compilation -*-" >> "$at_group_log"
2895 (
2896   $as_echo "17. setopt00.at:17: testing ..."
2897   $at_traceon
2898
2899
2900
2901 { $at_traceoff
2902 $as_echo "$at_srcdir/setopt00.at:20:
2903 num2word 1:1000 | gtload test.db || exit 2
2904 gtopt test.db '!MMAP'
2905 "
2906 echo setopt00.at:20 >"$at_check_line_file"
2907
2908 if { echo 'Not enabling shell tracing (command contains an embedded newline)'
2909    false; }; then
2910   ( $at_traceon;
2911 num2word 1:1000 | gtload test.db || exit 2
2912 gtopt test.db '!MMAP'
2913  ) >"$at_stdout" 2>"$at_stder1"
2914   at_func_filter_trace $?
2915 else
2916   ( :;
2917 num2word 1:1000 | gtload test.db || exit 2
2918 gtopt test.db '!MMAP'
2919  ) >"$at_stdout" 2>"$at_stderr"
2920 fi
2921 at_status=$?
2922 at_failed=false
2923 at_func_diff_devnull "$at_stderr" || at_failed=:
2924 echo >>"$at_stdout"; $as_echo "GDBM_GETFLAGS: PASS
2925 * CACHESIZE:
2926 initial GDBM_SETCACHESIZE: PASS
2927 GDBM_GETCACHESIZE: PASS
2928 second GDBM_SETCACHESIZE: XFAIL
2929 * SYNCMODE:
2930 initial GDBM_GETSYNCMODE: PASS
2931 GDBM_SETSYNCMODE: PASS
2932 GDBM_GETSYNCMODE: PASS
2933 GDBM_SETSYNCMODE true: PASS
2934 GDBM_GETSYNCMODE: PASS
2935 GDBM_SETSYNCMODE false: PASS
2936 GDBM_GETSYNCMODE: PASS
2937 * CENTFREE:
2938 initial GDBM_GETCENTFREE: PASS
2939 GDBM_SETCENTFREE: PASS
2940 GDBM_GETCENTFREE: FAIL
2941 GDBM_SETCENTFREE true: PASS
2942 GDBM_GETCENTFREE: FAIL
2943 GDBM_SETCENTFREE false: PASS
2944 GDBM_GETCENTFREE: FAIL
2945 * COALESCEBLKS:
2946 initial GDBM_GETCOALESCEBLKS: PASS
2947 GDBM_SETCOALESCEBLKS: PASS
2948 GDBM_GETCOALESCEBLKS: PASS
2949 GDBM_SETCOALESCEBLKS true: PASS
2950 GDBM_GETCOALESCEBLKS: PASS
2951 GDBM_SETCOALESCEBLKS false: PASS
2952 GDBM_GETCOALESCEBLKS: PASS
2953 GDBM_GETDBNAME: PASS
2954 " | \
2955   $at_diff - "$at_stdout" || at_failed=:
2956 at_func_check_status 0 $at_status "$at_srcdir/setopt00.at:20"
2957
2958 $at_failed && at_func_log_failure
2959 $at_traceon; }
2960
2961
2962   $at_traceoff
2963   $at_times_p && times >"$at_times_file"
2964 ) 5>&1 2>&1 | eval $at_tee_pipe
2965 at_status=`cat "$at_status_file"`
2966 #AT_STOP_17
2967 #AT_START_18
2968 # 18. setopt01.at:17: setopt: mmap options
2969 at_setup_line='setopt01.at:17'
2970 at_func_banner 3
2971 at_desc="setopt: mmap options"
2972 $at_quiet $as_echo_n " 18: $at_desc                           "
2973 at_xfail=no
2974 echo "#                             -*- compilation -*-" >> "$at_group_log"
2975 (
2976   $as_echo "18. setopt01.at:17: testing ..."
2977   $at_traceon
2978
2979
2980
2981 { $at_traceoff
2982 $as_echo "$at_srcdir/setopt01.at:20:
2983 num2word 1:1000 | gtload test.db || exit 2
2984 gtopt test.db 'MMAP' > out
2985 grep 'MMAP: SKIP' out >/dev/null && exit 77
2986 cat out
2987 "
2988 echo setopt01.at:20 >"$at_check_line_file"
2989
2990 if { echo 'Not enabling shell tracing (command contains an embedded newline)'
2991    false; }; then
2992   ( $at_traceon;
2993 num2word 1:1000 | gtload test.db || exit 2
2994 gtopt test.db 'MMAP' > out
2995 grep 'MMAP: SKIP' out >/dev/null && exit 77
2996 cat out
2997  ) >"$at_stdout" 2>"$at_stder1"
2998   at_func_filter_trace $?
2999 else
3000   ( :;
3001 num2word 1:1000 | gtload test.db || exit 2
3002 gtopt test.db 'MMAP' > out
3003 grep 'MMAP: SKIP' out >/dev/null && exit 77
3004 cat out
3005  ) >"$at_stdout" 2>"$at_stderr"
3006 fi
3007 at_status=$?
3008 at_failed=false
3009 at_func_diff_devnull "$at_stderr" || at_failed=:
3010 echo >>"$at_stdout"; $as_echo "* MMAP:
3011 initial GDBM_GETMMAP: PASS
3012 GDBM_SETMMAP false: PASS
3013 GDBM_GETMMAP: PASS
3014 initial GDBM_GETMAXMAPSIZE: PASS
3015 GDBM_SETMAXMAPSIZE: PASS
3016 GDBM_GETMAXMAPSIZE: PASS
3017 " | \
3018   $at_diff - "$at_stdout" || at_failed=:
3019 at_func_check_status 0 $at_status "$at_srcdir/setopt01.at:20"
3020
3021 $at_failed && at_func_log_failure
3022 $at_traceon; }
3023
3024
3025   $at_traceoff
3026   $at_times_p && times >"$at_times_file"
3027 ) 5>&1 2>&1 | eval $at_tee_pipe
3028 at_status=`cat "$at_status_file"`
3029 #AT_STOP_18
3030 #AT_START_19
3031 # 19. cloexec00.at:17: cloexec: gdbm_open
3032 at_setup_line='cloexec00.at:17'
3033 at_func_banner 4
3034 at_desc="cloexec: gdbm_open"
3035 $at_quiet $as_echo_n " 19: $at_desc                             "
3036 at_xfail=no
3037 echo "#                             -*- compilation -*-" >> "$at_group_log"
3038 (
3039   $as_echo "19. cloexec00.at:17: testing ..."
3040   $at_traceon
3041
3042
3043
3044 { $at_traceoff
3045 $as_echo "$at_srcdir/cloexec00.at:20:
3046 g_open_ce \"\$abs_builddir/fdop\"
3047 "
3048 echo cloexec00.at:20 >"$at_check_line_file"
3049
3050 if { echo 'Not enabling shell tracing (command contains an embedded newline)'
3051    false; }; then
3052   ( $at_traceon;
3053 g_open_ce "$abs_builddir/fdop"
3054  ) >"$at_stdout" 2>"$at_stder1"
3055   at_func_filter_trace $?
3056 else
3057   ( :;
3058 g_open_ce "$abs_builddir/fdop"
3059  ) >"$at_stdout" 2>"$at_stderr"
3060 fi
3061 at_status=$?
3062 at_failed=false
3063 at_func_diff_devnull "$at_stderr" || at_failed=:
3064 at_func_diff_devnull "$at_stdout" || at_failed=:
3065 at_func_check_status 0 $at_status "$at_srcdir/cloexec00.at:20"
3066
3067 $at_failed && at_func_log_failure
3068 $at_traceon; }
3069
3070
3071   $at_traceoff
3072   $at_times_p && times >"$at_times_file"
3073 ) 5>&1 2>&1 | eval $at_tee_pipe
3074 at_status=`cat "$at_status_file"`
3075 #AT_STOP_19
3076 #AT_START_20
3077 # 20. cloexec01.at:17: cloexec: gdbm_reorganize
3078 at_setup_line='cloexec01.at:17'
3079 at_func_banner 4
3080 at_desc="cloexec: gdbm_reorganize"
3081 $at_quiet $as_echo_n " 20: $at_desc                       "
3082 at_xfail=no
3083 echo "#                             -*- compilation -*-" >> "$at_group_log"
3084 (
3085   $as_echo "20. cloexec01.at:17: testing ..."
3086   $at_traceon
3087
3088
3089
3090 { $at_traceoff
3091 $as_echo "$at_srcdir/cloexec01.at:20:
3092 g_reorg_ce \"\$abs_builddir/fdop\"
3093 "
3094 echo cloexec01.at:20 >"$at_check_line_file"
3095
3096 if { echo 'Not enabling shell tracing (command contains an embedded newline)'
3097    false; }; then
3098   ( $at_traceon;
3099 g_reorg_ce "$abs_builddir/fdop"
3100  ) >"$at_stdout" 2>"$at_stder1"
3101   at_func_filter_trace $?
3102 else
3103   ( :;
3104 g_reorg_ce "$abs_builddir/fdop"
3105  ) >"$at_stdout" 2>"$at_stderr"
3106 fi
3107 at_status=$?
3108 at_failed=false
3109 at_func_diff_devnull "$at_stderr" || at_failed=:
3110 at_func_diff_devnull "$at_stdout" || at_failed=:
3111 at_func_check_status 0 $at_status "$at_srcdir/cloexec01.at:20"
3112
3113 $at_failed && at_func_log_failure
3114 $at_traceon; }
3115
3116
3117   $at_traceoff
3118   $at_times_p && times >"$at_times_file"
3119 ) 5>&1 2>&1 | eval $at_tee_pipe
3120 at_status=`cat "$at_status_file"`
3121 #AT_STOP_20
3122 #AT_START_21
3123 # 21. cloexec02.at:17: cloexec: dbm_open
3124 at_setup_line='cloexec02.at:17'
3125 at_func_banner 4
3126 at_desc="cloexec: dbm_open"
3127 $at_quiet $as_echo_n " 21: $at_desc                              "
3128 at_xfail=no
3129 echo "#                             -*- compilation -*-" >> "$at_group_log"
3130 (
3131   $as_echo "21. cloexec02.at:17: testing ..."
3132   $at_traceon
3133
3134
3135
3136 { $at_traceoff
3137 $as_echo "$at_srcdir/cloexec02.at:20:
3138
3139 test $COMPAT -eq 1 || exit 77
3140
3141 num2word 1:10 | dtload file
3142 d_creat_ce \"\$abs_builddir/fdop\"
3143 "
3144 echo cloexec02.at:20 >"$at_check_line_file"
3145
3146 if { echo 'Not enabling shell tracing (command contains an embedded newline)'
3147    false; }; then
3148   ( $at_traceon;
3149
3150 test $COMPAT -eq 1 || exit 77
3151
3152 num2word 1:10 | dtload file
3153 d_creat_ce "$abs_builddir/fdop"
3154  ) >"$at_stdout" 2>"$at_stder1"
3155   at_func_filter_trace $?
3156 else
3157   ( :;
3158
3159 test $COMPAT -eq 1 || exit 77
3160
3161 num2word 1:10 | dtload file
3162 d_creat_ce "$abs_builddir/fdop"
3163  ) >"$at_stdout" 2>"$at_stderr"
3164 fi
3165 at_status=$?
3166 at_failed=false
3167 at_func_diff_devnull "$at_stderr" || at_failed=:
3168 at_func_diff_devnull "$at_stdout" || at_failed=:
3169 at_func_check_status 0 $at_status "$at_srcdir/cloexec02.at:20"
3170
3171 $at_failed && at_func_log_failure
3172 $at_traceon; }
3173
3174
3175   $at_traceoff
3176   $at_times_p && times >"$at_times_file"
3177 ) 5>&1 2>&1 | eval $at_tee_pipe
3178 at_status=`cat "$at_status_file"`
3179 #AT_STOP_21
3180 #AT_START_22
3181 # 22. cloexec03.at:17: cloexec: dbm_open -creat
3182 at_setup_line='cloexec03.at:17'
3183 at_func_banner 4
3184 at_desc="cloexec: dbm_open -creat"
3185 $at_quiet $as_echo_n " 22: $at_desc                       "
3186 at_xfail=no
3187 echo "#                             -*- compilation -*-" >> "$at_group_log"
3188 (
3189   $as_echo "22. cloexec03.at:17: testing ..."
3190   $at_traceon
3191
3192
3193
3194 { $at_traceoff
3195 $as_echo "$at_srcdir/cloexec03.at:20:
3196
3197 test $COMPAT -eq 1 || exit 77
3198
3199 d_creat_ce \"\$abs_builddir/fdop\" -creat
3200 "
3201 echo cloexec03.at:20 >"$at_check_line_file"
3202
3203 if { echo 'Not enabling shell tracing (command contains an embedded newline)'
3204    false; }; then
3205   ( $at_traceon;
3206
3207 test $COMPAT -eq 1 || exit 77
3208
3209 d_creat_ce "$abs_builddir/fdop" -creat
3210  ) >"$at_stdout" 2>"$at_stder1"
3211   at_func_filter_trace $?
3212 else
3213   ( :;
3214
3215 test $COMPAT -eq 1 || exit 77
3216
3217 d_creat_ce "$abs_builddir/fdop" -creat
3218  ) >"$at_stdout" 2>"$at_stderr"
3219 fi
3220 at_status=$?
3221 at_failed=false
3222 at_func_diff_devnull "$at_stderr" || at_failed=:
3223 at_func_diff_devnull "$at_stdout" || at_failed=:
3224 at_func_check_status 0 $at_status "$at_srcdir/cloexec03.at:20"
3225
3226 $at_failed && at_func_log_failure
3227 $at_traceon; }
3228
3229
3230   $at_traceoff
3231   $at_times_p && times >"$at_times_file"
3232 ) 5>&1 2>&1 | eval $at_tee_pipe
3233 at_status=`cat "$at_status_file"`
3234 #AT_STOP_22