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