1#! /bin/sh
2# Generated from bootstrap/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='kyua'
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;testsuite.at:72;test program crashes in test list;;
5942;testsuite.at:83;test program prints an empty test list;;
5953;testsuite.at:94;test program with zero test cases;;
5964;testsuite.at:105;run test case that passes;;
5975;testsuite.at:117;run test case that fails;;
5986;testsuite.at:130;run test case that skips;;
5997;testsuite.at:143;run two test cases, success;;
6008;testsuite.at:156;run two test cases, failure;;
6019;testsuite.at:169;run mixed test cases;;
60210;testsuite.at:183;run tests from build directories;;
603"
604# List of the all the test groups.
605at_groups_all=`$as_echo "$at_help_all" | sed 's/;.*//'`
606
607# at_fn_validate_ranges NAME...
608# -----------------------------
609# Validate and normalize the test group number contained in each variable
610# NAME. Leading zeroes are treated as decimal.
611at_fn_validate_ranges ()
612{
613  for at_grp
614  do
615    eval at_value=\$$at_grp
616    if test $at_value -lt 1 || test $at_value -gt 10; then
617      $as_echo "invalid test group: $at_value" >&2
618      exit 1
619    fi
620    case $at_value in
621      0*) # We want to treat leading 0 as decimal, like expr and test, but
622	  # AS_VAR_ARITH treats it as octal if it uses $(( )).
623	  # With XSI shells, ${at_value#${at_value%%[1-9]*}} avoids the
624	  # expr fork, but it is not worth the effort to determine if the
625	  # shell supports XSI when the user can just avoid leading 0.
626	  eval $at_grp='`expr $at_value + 0`' ;;
627    esac
628  done
629}
630
631at_prev=
632for at_option
633do
634  # If the previous option needs an argument, assign it.
635  if test -n "$at_prev"; then
636    at_option=$at_prev=$at_option
637    at_prev=
638  fi
639
640  case $at_option in
641  *=?*) at_optarg=`expr "X$at_option" : '[^=]*=\(.*\)'` ;;
642  *)    at_optarg= ;;
643  esac
644
645  # Accept the important Cygnus configure options, so we can diagnose typos.
646
647  case $at_option in
648    --help | -h )
649	at_help_p=:
650	;;
651
652    --list | -l )
653	at_list_p=:
654	;;
655
656    --version | -V )
657	at_version_p=:
658	;;
659
660    --clean | -c )
661	at_clean=:
662	;;
663
664    --color )
665	at_color=always
666	;;
667    --color=* )
668	case $at_optarg in
669	no | never | none) at_color=never ;;
670	auto | tty | if-tty) at_color=auto ;;
671	always | yes | force) at_color=always ;;
672	*) at_optname=`echo " $at_option" | sed 's/^ //; s/=.*//'`
673	   as_fn_error $? "unrecognized argument to $at_optname: $at_optarg" ;;
674	esac
675	;;
676
677    --debug | -d )
678	at_debug_p=:
679	;;
680
681    --errexit | -e )
682	at_debug_p=:
683	at_errexit_p=:
684	;;
685
686    --verbose | -v )
687	at_verbose=; at_quiet=:
688	;;
689
690    --trace | -x )
691	at_traceon='set -x'
692	at_trace_echo=echo
693	at_check_filter_trace=at_fn_filter_trace
694	;;
695
696    [0-9] | [0-9][0-9] | [0-9][0-9][0-9] | [0-9][0-9][0-9][0-9])
697	at_fn_validate_ranges at_option
698	as_fn_append at_groups "$at_option$as_nl"
699	;;
700
701    # Ranges
702    [0-9]- | [0-9][0-9]- | [0-9][0-9][0-9]- | [0-9][0-9][0-9][0-9]-)
703	at_range_start=`echo $at_option |tr -d X-`
704	at_fn_validate_ranges at_range_start
705	at_range=`$as_echo "$at_groups_all" | \
706	  sed -ne '/^'$at_range_start'$/,$p'`
707	as_fn_append at_groups "$at_range$as_nl"
708	;;
709
710    -[0-9] | -[0-9][0-9] | -[0-9][0-9][0-9] | -[0-9][0-9][0-9][0-9])
711	at_range_end=`echo $at_option |tr -d X-`
712	at_fn_validate_ranges at_range_end
713	at_range=`$as_echo "$at_groups_all" | \
714	  sed -ne '1,/^'$at_range_end'$/p'`
715	as_fn_append at_groups "$at_range$as_nl"
716	;;
717
718    [0-9]-[0-9] | [0-9]-[0-9][0-9] | [0-9]-[0-9][0-9][0-9] | \
719    [0-9]-[0-9][0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9] | \
720    [0-9][0-9]-[0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9][0-9][0-9] | \
721    [0-9][0-9][0-9]-[0-9][0-9][0-9] | \
722    [0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] | \
723    [0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] )
724	at_range_start=`expr $at_option : '\(.*\)-'`
725	at_range_end=`expr $at_option : '.*-\(.*\)'`
726	if test $at_range_start -gt $at_range_end; then
727	  at_tmp=$at_range_end
728	  at_range_end=$at_range_start
729	  at_range_start=$at_tmp
730	fi
731	at_fn_validate_ranges at_range_start at_range_end
732	at_range=`$as_echo "$at_groups_all" | \
733	  sed -ne '/^'$at_range_start'$/,/^'$at_range_end'$/p'`
734	as_fn_append at_groups "$at_range$as_nl"
735	;;
736
737    # Directory selection.
738    --directory | -C )
739	at_prev=--directory
740	;;
741    --directory=* )
742	at_change_dir=:
743	at_dir=$at_optarg
744	if test x- = "x$at_dir" ; then
745	  at_dir=./-
746	fi
747	;;
748
749    # Parallel execution.
750    --jobs | -j )
751	at_jobs=0
752	;;
753    --jobs=* | -j[0-9]* )
754	if test -n "$at_optarg"; then
755	  at_jobs=$at_optarg
756	else
757	  at_jobs=`expr X$at_option : 'X-j\(.*\)'`
758	fi
759	case $at_jobs in *[!0-9]*)
760	  at_optname=`echo " $at_option" | sed 's/^ //; s/[0-9=].*//'`
761	  as_fn_error $? "non-numeric argument to $at_optname: $at_jobs" ;;
762	esac
763	;;
764
765    # Keywords.
766    --keywords | -k )
767	at_prev=--keywords
768	;;
769    --keywords=* )
770	at_groups_selected=$at_help_all
771	at_save_IFS=$IFS
772	IFS=,
773	set X $at_optarg
774	shift
775	IFS=$at_save_IFS
776	for at_keyword
777	do
778	  at_invert=
779	  case $at_keyword in
780	  '!'*)
781	    at_invert="-v"
782	    at_keyword=`expr "X$at_keyword" : 'X!\(.*\)'`
783	    ;;
784	  esac
785	  # It is on purpose that we match the test group titles too.
786	  at_groups_selected=`$as_echo "$at_groups_selected" |
787	      grep -i $at_invert "^[1-9][^;]*;.*[; ]$at_keyword[ ;]"`
788	done
789	# Smash the keywords.
790	at_groups_selected=`$as_echo "$at_groups_selected" | sed 's/;.*//'`
791	as_fn_append at_groups "$at_groups_selected$as_nl"
792	;;
793    --recheck)
794	at_recheck=:
795	;;
796
797    *=*)
798	at_envvar=`expr "x$at_option" : 'x\([^=]*\)='`
799	# Reject names that are not valid shell variable names.
800	case $at_envvar in
801	  '' | [0-9]* | *[!_$as_cr_alnum]* )
802	    as_fn_error $? "invalid variable name: \`$at_envvar'" ;;
803	esac
804	at_value=`$as_echo "$at_optarg" | sed "s/'/'\\\\\\\\''/g"`
805	# Export now, but save eval for later and for debug scripts.
806	export $at_envvar
807	as_fn_append at_debug_args " $at_envvar='$at_value'"
808	;;
809
810     *) $as_echo "$as_me: invalid option: $at_option" >&2
811	$as_echo "Try \`$0 --help' for more information." >&2
812	exit 1
813	;;
814  esac
815done
816
817# Verify our last option didn't require an argument
818if test -n "$at_prev"; then :
819  as_fn_error $? "\`$at_prev' requires an argument"
820fi
821
822# The file containing the suite.
823at_suite_log=$at_dir/$as_me.log
824
825# Selected test groups.
826if test -z "$at_groups$at_recheck"; then
827  at_groups=$at_groups_all
828else
829  if test -n "$at_recheck" && test -r "$at_suite_log"; then
830    at_oldfails=`sed -n '
831      /^Failed tests:$/,/^Skipped tests:$/{
832	s/^[ ]*\([1-9][0-9]*\):.*/\1/p
833      }
834      /^Unexpected passes:$/,/^## Detailed failed tests/{
835	s/^[ ]*\([1-9][0-9]*\):.*/\1/p
836      }
837      /^## Detailed failed tests/q
838      ' "$at_suite_log"`
839    as_fn_append at_groups "$at_oldfails$as_nl"
840  fi
841  # Sort the tests, removing duplicates.
842  at_groups=`$as_echo "$at_groups" | sort -nu | sed '/^$/d'`
843fi
844
845if test x"$at_color" = xalways \
846   || { test x"$at_color" = xauto && test -t 1; }; then
847  at_red=`printf '\033[0;31m'`
848  at_grn=`printf '\033[0;32m'`
849  at_lgn=`printf '\033[1;32m'`
850  at_blu=`printf '\033[1;34m'`
851  at_std=`printf '\033[m'`
852else
853  at_red= at_grn= at_lgn= at_blu= at_std=
854fi
855
856# Help message.
857if $at_help_p; then
858  cat <<_ATEOF || at_write_fail=1
859Usage: $0 [OPTION]... [VARIABLE=VALUE]... [TESTS]
860
861Run all the tests, or the selected TESTS, given by numeric ranges, and
862save a detailed log file.  Upon failure, create debugging scripts.
863
864Do not change environment variables directly.  Instead, set them via
865command line arguments.  Set \`AUTOTEST_PATH' to select the executables
866to exercise.  Each relative directory is expanded as build and source
867directories relative to the top level of this distribution.
868E.g., from within the build directory /tmp/foo-1.0, invoking this:
869
870  $ $0 AUTOTEST_PATH=bin
871
872is equivalent to the following, assuming the source directory is /src/foo-1.0:
873
874  PATH=/tmp/foo-1.0/bin:/src/foo-1.0/bin:\$PATH $0
875_ATEOF
876cat <<_ATEOF || at_write_fail=1
877
878Operation modes:
879  -h, --help     print the help message, then exit
880  -V, --version  print version number, then exit
881  -c, --clean    remove all the files this test suite might create and exit
882  -l, --list     describes all the tests, or the selected TESTS
883_ATEOF
884cat <<_ATEOF || at_write_fail=1
885
886Execution tuning:
887  -C, --directory=DIR
888                 change to directory DIR before starting
889      --color[=never|auto|always]
890                 enable colored test results on terminal, or always
891  -j, --jobs[=N]
892                 Allow N jobs at once; infinite jobs with no arg (default 1)
893  -k, --keywords=KEYWORDS
894                 select the tests matching all the comma-separated KEYWORDS
895                 multiple \`-k' accumulate; prefixed \`!' negates a KEYWORD
896      --recheck  select all tests that failed or passed unexpectedly last time
897  -e, --errexit  abort as soon as a test fails; implies --debug
898  -v, --verbose  force more detailed output
899                 default for debugging scripts
900  -d, --debug    inhibit clean up and top-level logging
901                 default for debugging scripts
902  -x, --trace    enable tests shell tracing
903_ATEOF
904cat <<_ATEOF || at_write_fail=1
905
906Report bugs to <kyua-discuss@googlegroups.com>.
907_ATEOF
908  exit $at_write_fail
909fi
910
911# List of tests.
912if $at_list_p; then
913  cat <<_ATEOF || at_write_fail=1
914Kyua 0.13 test suite: bootstrapping tests test groups:
915
916 NUM: FILE-NAME:LINE     TEST-GROUP-NAME
917      KEYWORDS
918
919_ATEOF
920  # Pass an empty line as separator between selected groups and help.
921  $as_echo "$at_groups$as_nl$as_nl$at_help_all" |
922    awk 'NF == 1 && FS != ";" {
923	   selected[$ 1] = 1
924	   next
925	 }
926	 /^$/ { FS = ";" }
927	 NF > 0 {
928	   if (selected[$ 1]) {
929	     printf " %3d: %-18s %s\n", $ 1, $ 2, $ 3
930	     if ($ 4) {
931	       lmax = 79
932	       indent = "     "
933	       line = indent
934	       len = length (line)
935	       n = split ($ 4, a, " ")
936	       for (i = 1; i <= n; i++) {
937		 l = length (a[i]) + 1
938		 if (i > 1 && len + l > lmax) {
939		   print line
940		   line = indent " " a[i]
941		   len = length (line)
942		 } else {
943		   line = line " " a[i]
944		   len += l
945		 }
946	       }
947	       if (n)
948		 print line
949	     }
950	   }
951	 }' || at_write_fail=1
952  exit $at_write_fail
953fi
954if $at_version_p; then
955  $as_echo "$as_me (Kyua 0.13)" &&
956  cat <<\_ATEOF || at_write_fail=1
957
958Copyright (C) 2012 Free Software Foundation, Inc.
959This test suite is free software; the Free Software Foundation gives
960unlimited permission to copy, distribute and modify it.
961_ATEOF
962  exit $at_write_fail
963fi
964
965# Should we print banners?  Yes if more than one test is run.
966case $at_groups in #(
967  *$as_nl* )
968      at_print_banners=: ;; #(
969  * ) at_print_banners=false ;;
970esac
971# Text for banner N, set to a single space once printed.
972
973# Take any -C into account.
974if $at_change_dir ; then
975  test x != "x$at_dir" && cd "$at_dir" \
976    || as_fn_error $? "unable to change directory"
977  at_dir=`pwd`
978fi
979
980# Load the config files for any default variable assignments.
981for at_file in atconfig atlocal
982do
983  test -r $at_file || continue
984  . ./$at_file || as_fn_error $? "invalid content: $at_file"
985done
986
987# Autoconf <=2.59b set at_top_builddir instead of at_top_build_prefix:
988: "${at_top_build_prefix=$at_top_builddir}"
989
990# Perform any assignments requested during argument parsing.
991eval "$at_debug_args"
992
993# atconfig delivers names relative to the directory the test suite is
994# in, but the groups themselves are run in testsuite-dir/group-dir.
995if test -n "$at_top_srcdir"; then
996  builddir=../..
997  for at_dir_var in srcdir top_srcdir top_build_prefix
998  do
999    eval at_val=\$at_$at_dir_var
1000    case $at_val in
1001      [\\/$]* | ?:[\\/]* ) at_prefix= ;;
1002      *) at_prefix=../../ ;;
1003    esac
1004    eval "$at_dir_var=\$at_prefix\$at_val"
1005  done
1006fi
1007
1008## -------------------- ##
1009## Directory structure. ##
1010## -------------------- ##
1011
1012# This is the set of directories and files used by this script
1013# (non-literals are capitalized):
1014#
1015# TESTSUITE         - the testsuite
1016# TESTSUITE.log     - summarizes the complete testsuite run
1017# TESTSUITE.dir/    - created during a run, remains after -d or failed test
1018# + at-groups/      - during a run: status of all groups in run
1019# | + NNN/          - during a run: meta-data about test group NNN
1020# | | + check-line  - location (source file and line) of current AT_CHECK
1021# | | + status      - exit status of current AT_CHECK
1022# | | + stdout      - stdout of current AT_CHECK
1023# | | + stder1      - stderr, including trace
1024# | | + stderr      - stderr, with trace filtered out
1025# | | + test-source - portion of testsuite that defines group
1026# | | + times       - timestamps for computing duration
1027# | | + pass        - created if group passed
1028# | | + xpass       - created if group xpassed
1029# | | + fail        - created if group failed
1030# | | + xfail       - created if group xfailed
1031# | | + skip        - created if group skipped
1032# + at-stop         - during a run: end the run if this file exists
1033# + at-source-lines - during a run: cache of TESTSUITE line numbers for extraction
1034# + 0..NNN/         - created for each group NNN, remains after -d or failed test
1035# | + TESTSUITE.log - summarizes the group results
1036# | + ...           - files created during the group
1037
1038# The directory the whole suite works in.
1039# Should be absolute to let the user `cd' at will.
1040at_suite_dir=$at_dir/$as_me.dir
1041# The file containing the suite ($at_dir might have changed since earlier).
1042at_suite_log=$at_dir/$as_me.log
1043# The directory containing helper files per test group.
1044at_helper_dir=$at_suite_dir/at-groups
1045# Stop file: if it exists, do not start new jobs.
1046at_stop_file=$at_suite_dir/at-stop
1047# The fifo used for the job dispatcher.
1048at_job_fifo=$at_suite_dir/at-job-fifo
1049
1050if $at_clean; then
1051  test -d "$at_suite_dir" &&
1052    find "$at_suite_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \;
1053  rm -f -r "$at_suite_dir" "$at_suite_log"
1054  exit $?
1055fi
1056
1057# Don't take risks: use only absolute directories in PATH.
1058#
1059# For stand-alone test suites (ie. atconfig was not found),
1060# AUTOTEST_PATH is relative to `.'.
1061#
1062# For embedded test suites, AUTOTEST_PATH is relative to the top level
1063# of the package.  Then expand it into build/src parts, since users
1064# may create executables in both places.
1065AUTOTEST_PATH=`$as_echo "$AUTOTEST_PATH" | sed "s|:|$PATH_SEPARATOR|g"`
1066at_path=
1067as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1068for as_dir in $AUTOTEST_PATH $PATH
1069do
1070  IFS=$as_save_IFS
1071  test -z "$as_dir" && as_dir=.
1072    test -n "$at_path" && as_fn_append at_path $PATH_SEPARATOR
1073case $as_dir in
1074  [\\/]* | ?:[\\/]* )
1075    as_fn_append at_path "$as_dir"
1076    ;;
1077  * )
1078    if test -z "$at_top_build_prefix"; then
1079      # Stand-alone test suite.
1080      as_fn_append at_path "$as_dir"
1081    else
1082      # Embedded test suite.
1083      as_fn_append at_path "$at_top_build_prefix$as_dir$PATH_SEPARATOR"
1084      as_fn_append at_path "$at_top_srcdir/$as_dir"
1085    fi
1086    ;;
1087esac
1088  done
1089IFS=$as_save_IFS
1090
1091
1092# Now build and simplify PATH.
1093#
1094# There might be directories that don't exist, but don't redirect
1095# builtins' (eg., cd) stderr directly: Ultrix's sh hates that.
1096at_new_path=
1097as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1098for as_dir in $at_path
1099do
1100  IFS=$as_save_IFS
1101  test -z "$as_dir" && as_dir=.
1102    test -d "$as_dir" || continue
1103case $as_dir in
1104  [\\/]* | ?:[\\/]* ) ;;
1105  * ) as_dir=`(cd "$as_dir" && pwd) 2>/dev/null` ;;
1106esac
1107case $PATH_SEPARATOR$at_new_path$PATH_SEPARATOR in
1108  *$PATH_SEPARATOR$as_dir$PATH_SEPARATOR*) ;;
1109  $PATH_SEPARATOR$PATH_SEPARATOR) at_new_path=$as_dir ;;
1110  *) as_fn_append at_new_path "$PATH_SEPARATOR$as_dir" ;;
1111esac
1112  done
1113IFS=$as_save_IFS
1114
1115PATH=$at_new_path
1116export PATH
1117
1118# Setting up the FDs.
1119
1120
1121
1122# 5 is the log file.  Not to be overwritten if `-d'.
1123if $at_debug_p; then
1124  at_suite_log=/dev/null
1125else
1126  : >"$at_suite_log"
1127fi
1128exec 5>>"$at_suite_log"
1129
1130# Banners and logs.
1131$as_echo "## ------------------------------------------ ##
1132## Kyua 0.13 test suite: bootstrapping tests. ##
1133## ------------------------------------------ ##"
1134{
1135  $as_echo "## ------------------------------------------ ##
1136## Kyua 0.13 test suite: bootstrapping tests. ##
1137## ------------------------------------------ ##"
1138  echo
1139
1140  $as_echo "$as_me: command line was:"
1141  $as_echo "  \$ $0 $at_cli_args"
1142  echo
1143
1144  # If ChangeLog exists, list a few lines in case it might help determining
1145  # the exact version.
1146  if test -n "$at_top_srcdir" && test -f "$at_top_srcdir/ChangeLog"; then
1147    $as_echo "## ---------- ##
1148## ChangeLog. ##
1149## ---------- ##"
1150    echo
1151    sed 's/^/| /;10q' "$at_top_srcdir/ChangeLog"
1152    echo
1153  fi
1154
1155  {
1156cat <<_ASUNAME
1157## --------- ##
1158## Platform. ##
1159## --------- ##
1160
1161hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
1162uname -m = `(uname -m) 2>/dev/null || echo unknown`
1163uname -r = `(uname -r) 2>/dev/null || echo unknown`
1164uname -s = `(uname -s) 2>/dev/null || echo unknown`
1165uname -v = `(uname -v) 2>/dev/null || echo unknown`
1166
1167/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
1168/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
1169
1170/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
1171/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
1172/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
1173/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
1174/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
1175/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
1176/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
1177
1178_ASUNAME
1179
1180as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1181for as_dir in $PATH
1182do
1183  IFS=$as_save_IFS
1184  test -z "$as_dir" && as_dir=.
1185    $as_echo "PATH: $as_dir"
1186  done
1187IFS=$as_save_IFS
1188
1189}
1190  echo
1191
1192  # Contents of the config files.
1193  for at_file in atconfig atlocal
1194  do
1195    test -r $at_file || continue
1196    $as_echo "$as_me: $at_file:"
1197    sed 's/^/| /' $at_file
1198    echo
1199  done
1200} >&5
1201
1202
1203## ------------------------- ##
1204## Autotest shell functions. ##
1205## ------------------------- ##
1206
1207# at_fn_banner NUMBER
1208# -------------------
1209# Output banner NUMBER, provided the testsuite is running multiple groups and
1210# this particular banner has not yet been printed.
1211at_fn_banner ()
1212{
1213  $at_print_banners || return 0
1214  eval at_banner_text=\$at_banner_text_$1
1215  test "x$at_banner_text" = "x " && return 0
1216  eval "at_banner_text_$1=\" \""
1217  if test -z "$at_banner_text"; then
1218    $at_first || echo
1219  else
1220    $as_echo "$as_nl$at_banner_text$as_nl"
1221  fi
1222} # at_fn_banner
1223
1224# at_fn_check_prepare_notrace REASON LINE
1225# ---------------------------------------
1226# Perform AT_CHECK preparations for the command at LINE for an untraceable
1227# command; REASON is the reason for disabling tracing.
1228at_fn_check_prepare_notrace ()
1229{
1230  $at_trace_echo "Not enabling shell tracing (command contains $1)"
1231  $as_echo "$2" >"$at_check_line_file"
1232  at_check_trace=: at_check_filter=:
1233  : >"$at_stdout"; : >"$at_stderr"
1234}
1235
1236# at_fn_check_prepare_trace LINE
1237# ------------------------------
1238# Perform AT_CHECK preparations for the command at LINE for a traceable
1239# command.
1240at_fn_check_prepare_trace ()
1241{
1242  $as_echo "$1" >"$at_check_line_file"
1243  at_check_trace=$at_traceon at_check_filter=$at_check_filter_trace
1244  : >"$at_stdout"; : >"$at_stderr"
1245}
1246
1247# at_fn_check_prepare_dynamic COMMAND LINE
1248# ----------------------------------------
1249# Decide if COMMAND at LINE is traceable at runtime, and call the appropriate
1250# preparation function.
1251at_fn_check_prepare_dynamic ()
1252{
1253  case $1 in
1254    *$as_nl*)
1255      at_fn_check_prepare_notrace 'an embedded newline' "$2" ;;
1256    *)
1257      at_fn_check_prepare_trace "$2" ;;
1258  esac
1259}
1260
1261# at_fn_filter_trace
1262# ------------------
1263# Remove the lines in the file "$at_stderr" generated by "set -x" and print
1264# them to stderr.
1265at_fn_filter_trace ()
1266{
1267  mv "$at_stderr" "$at_stder1"
1268  grep '^ *+' "$at_stder1" >&2
1269  grep -v '^ *+' "$at_stder1" >"$at_stderr"
1270}
1271
1272# at_fn_log_failure FILE-LIST
1273# ---------------------------
1274# Copy the files in the list on stdout with a "> " prefix, and exit the shell
1275# with a failure exit code.
1276at_fn_log_failure ()
1277{
1278  for file
1279    do $as_echo "$file:"; sed 's/^/> /' "$file"; done
1280  echo 1 > "$at_status_file"
1281  exit 1
1282}
1283
1284# at_fn_check_skip EXIT-CODE LINE
1285# -------------------------------
1286# Check whether EXIT-CODE is a special exit code (77 or 99), and if so exit
1287# the test group subshell with that same exit code. Use LINE in any report
1288# about test failure.
1289at_fn_check_skip ()
1290{
1291  case $1 in
1292    99) echo 99 > "$at_status_file"; at_failed=:
1293	$as_echo "$2: hard failure"; exit 99;;
1294    77) echo 77 > "$at_status_file"; exit 77;;
1295  esac
1296}
1297
1298# at_fn_check_status EXPECTED EXIT-CODE LINE
1299# ------------------------------------------
1300# Check whether EXIT-CODE is the EXPECTED exit code, and if so do nothing.
1301# Otherwise, if it is 77 or 99, exit the test group subshell with that same
1302# exit code; if it is anything else print an error message referring to LINE,
1303# and fail the test.
1304at_fn_check_status ()
1305{
1306  case $2 in
1307    $1 ) ;;
1308    77) echo 77 > "$at_status_file"; exit 77;;
1309    99) echo 99 > "$at_status_file"; at_failed=:
1310	$as_echo "$3: hard failure"; exit 99;;
1311    *) $as_echo "$3: exit code was $2, expected $1"
1312      at_failed=:;;
1313  esac
1314}
1315
1316# at_fn_diff_devnull FILE
1317# -----------------------
1318# Emit a diff between /dev/null and FILE. Uses "test -s" to avoid useless diff
1319# invocations.
1320at_fn_diff_devnull ()
1321{
1322  test -s "$1" || return 0
1323  $at_diff "$at_devnull" "$1"
1324}
1325
1326# at_fn_test NUMBER
1327# -----------------
1328# Parse out test NUMBER from the tail of this file.
1329at_fn_test ()
1330{
1331  eval at_sed=\$at_sed$1
1332  sed "$at_sed" "$at_myself" > "$at_test_source"
1333}
1334
1335# at_fn_create_debugging_script
1336# -----------------------------
1337# Create the debugging script $at_group_dir/run which will reproduce the
1338# current test group.
1339at_fn_create_debugging_script ()
1340{
1341  {
1342    echo "#! /bin/sh" &&
1343    echo 'test "${ZSH_VERSION+set}" = set && alias -g '\''${1+"$@"}'\''='\''"$@"'\''' &&
1344    $as_echo "cd '$at_dir'" &&
1345    $as_echo "exec \${CONFIG_SHELL-$SHELL} \"$at_myself\" -v -d $at_debug_args $at_group \${1+\"\$@\"}" &&
1346    echo 'exit 1'
1347  } >"$at_group_dir/run" &&
1348  chmod +x "$at_group_dir/run"
1349}
1350
1351## -------------------------------- ##
1352## End of autotest shell functions. ##
1353## -------------------------------- ##
1354{
1355  $as_echo "## ---------------- ##
1356## Tested programs. ##
1357## ---------------- ##"
1358  echo
1359} >&5
1360
1361# Report what programs are being tested.
1362for at_program in : $at_tested
1363do
1364  test "$at_program" = : && continue
1365  case $at_program in
1366    [\\/]* | ?:[\\/]* ) $at_program_=$at_program ;;
1367    * )
1368    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1369for as_dir in $PATH
1370do
1371  IFS=$as_save_IFS
1372  test -z "$as_dir" && as_dir=.
1373    test -f "$as_dir/$at_program" && break
1374  done
1375IFS=$as_save_IFS
1376
1377    at_program_=$as_dir/$at_program ;;
1378  esac
1379  if test -f "$at_program_"; then
1380    {
1381      $as_echo "$at_srcdir/testsuite.at:29: $at_program_ --version"
1382      "$at_program_" --version </dev/null
1383      echo
1384    } >&5 2>&1
1385  else
1386    as_fn_error $? "cannot find $at_program" "$LINENO" 5
1387  fi
1388done
1389
1390{
1391  $as_echo "## ------------------ ##
1392## Running the tests. ##
1393## ------------------ ##"
1394} >&5
1395
1396at_start_date=`date`
1397at_start_time=`date +%s 2>/dev/null`
1398$as_echo "$as_me: starting at: $at_start_date" >&5
1399
1400# Create the master directory if it doesn't already exist.
1401as_dir="$at_suite_dir"; as_fn_mkdir_p ||
1402  as_fn_error $? "cannot create \`$at_suite_dir'" "$LINENO" 5
1403
1404# Can we diff with `/dev/null'?  DU 5.0 refuses.
1405if diff /dev/null /dev/null >/dev/null 2>&1; then
1406  at_devnull=/dev/null
1407else
1408  at_devnull=$at_suite_dir/devnull
1409  >"$at_devnull"
1410fi
1411
1412# Use `diff -u' when possible.
1413if at_diff=`diff -u "$at_devnull" "$at_devnull" 2>&1` && test -z "$at_diff"
1414then
1415  at_diff='diff -u'
1416else
1417  at_diff=diff
1418fi
1419
1420# Get the last needed group.
1421for at_group in : $at_groups; do :; done
1422
1423# Extract the start and end lines of each test group at the tail
1424# of this file
1425awk '
1426BEGIN { FS="" }
1427/^#AT_START_/ {
1428  start = NR
1429}
1430/^#AT_STOP_/ {
1431  test = substr ($ 0, 10)
1432  print "at_sed" test "=\"1," start "d;" (NR-1) "q\""
1433  if (test == "'"$at_group"'") exit
1434}' "$at_myself" > "$at_suite_dir/at-source-lines" &&
1435. "$at_suite_dir/at-source-lines" ||
1436  as_fn_error $? "cannot create test line number cache" "$LINENO" 5
1437rm -f "$at_suite_dir/at-source-lines"
1438
1439# Set number of jobs for `-j'; avoid more jobs than test groups.
1440set X $at_groups; shift; at_max_jobs=$#
1441if test $at_max_jobs -eq 0; then
1442  at_jobs=1
1443fi
1444if test $at_jobs -ne 1 &&
1445   { test $at_jobs -eq 0 || test $at_jobs -gt $at_max_jobs; }; then
1446  at_jobs=$at_max_jobs
1447fi
1448
1449# If parallel mode, don't output banners, don't split summary lines.
1450if test $at_jobs -ne 1; then
1451  at_print_banners=false
1452  at_quiet=:
1453fi
1454
1455# Set up helper dirs.
1456rm -rf "$at_helper_dir" &&
1457mkdir "$at_helper_dir" &&
1458cd "$at_helper_dir" &&
1459{ test -z "$at_groups" || mkdir $at_groups; } ||
1460as_fn_error $? "testsuite directory setup failed" "$LINENO" 5
1461
1462# Functions for running a test group.  We leave the actual
1463# test group execution outside of a shell function in order
1464# to avoid hitting zsh 4.x exit status bugs.
1465
1466# at_fn_group_prepare
1467# -------------------
1468# Prepare for running a test group.
1469at_fn_group_prepare ()
1470{
1471  # The directory for additional per-group helper files.
1472  at_job_dir=$at_helper_dir/$at_group
1473  # The file containing the location of the last AT_CHECK.
1474  at_check_line_file=$at_job_dir/check-line
1475  # The file containing the exit status of the last command.
1476  at_status_file=$at_job_dir/status
1477  # The files containing the output of the tested commands.
1478  at_stdout=$at_job_dir/stdout
1479  at_stder1=$at_job_dir/stder1
1480  at_stderr=$at_job_dir/stderr
1481  # The file containing the code for a test group.
1482  at_test_source=$at_job_dir/test-source
1483  # The file containing dates.
1484  at_times_file=$at_job_dir/times
1485
1486  # Be sure to come back to the top test directory.
1487  cd "$at_suite_dir"
1488
1489  # Clearly separate the test groups when verbose.
1490  $at_first || $at_verbose echo
1491
1492  at_group_normalized=$at_group
1493
1494  eval 'while :; do
1495    case $at_group_normalized in #(
1496    '"$at_format"'*) break;;
1497    esac
1498    at_group_normalized=0$at_group_normalized
1499  done'
1500
1501
1502  # Create a fresh directory for the next test group, and enter.
1503  # If one already exists, the user may have invoked ./run from
1504  # within that directory; we remove the contents, but not the
1505  # directory itself, so that we aren't pulling the rug out from
1506  # under the shell's notion of the current directory.
1507  at_group_dir=$at_suite_dir/$at_group_normalized
1508  at_group_log=$at_group_dir/$as_me.log
1509  if test -d "$at_group_dir"; then
1510  find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx {} \;
1511  rm -fr "$at_group_dir"/* "$at_group_dir"/.[!.] "$at_group_dir"/.??*
1512fi ||
1513    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: test directory for $at_group_normalized could not be cleaned" >&5
1514$as_echo "$as_me: WARNING: test directory for $at_group_normalized could not be cleaned" >&2;}
1515  # Be tolerant if the above `rm' was not able to remove the directory.
1516  as_dir="$at_group_dir"; as_fn_mkdir_p
1517
1518  echo 0 > "$at_status_file"
1519
1520  # In verbose mode, append to the log file *and* show on
1521  # the standard output; in quiet mode only write to the log.
1522  if test -z "$at_verbose"; then
1523    at_tee_pipe='tee -a "$at_group_log"'
1524  else
1525    at_tee_pipe='cat >> "$at_group_log"'
1526  fi
1527}
1528
1529# at_fn_group_banner ORDINAL LINE DESC PAD [BANNER]
1530# -------------------------------------------------
1531# Declare the test group ORDINAL, located at LINE with group description DESC,
1532# and residing under BANNER. Use PAD to align the status column.
1533at_fn_group_banner ()
1534{
1535  at_setup_line="$2"
1536  test -n "$5" && at_fn_banner $5
1537  at_desc="$3"
1538  case $1 in
1539    [0-9])      at_desc_line="  $1: ";;
1540    [0-9][0-9]) at_desc_line=" $1: " ;;
1541    *)          at_desc_line="$1: "  ;;
1542  esac
1543  as_fn_append at_desc_line "$3$4"
1544  $at_quiet $as_echo_n "$at_desc_line"
1545  echo "#                             -*- compilation -*-" >> "$at_group_log"
1546}
1547
1548# at_fn_group_postprocess
1549# -----------------------
1550# Perform cleanup after running a test group.
1551at_fn_group_postprocess ()
1552{
1553  # Be sure to come back to the suite directory, in particular
1554  # since below we might `rm' the group directory we are in currently.
1555  cd "$at_suite_dir"
1556
1557  if test ! -f "$at_check_line_file"; then
1558    sed "s/^ */$as_me: WARNING: /" <<_ATEOF
1559      A failure happened in a test group before any test could be
1560      run. This means that test suite is improperly designed.  Please
1561      report this failure to <kyua-discuss@googlegroups.com>.
1562_ATEOF
1563    $as_echo "$at_setup_line" >"$at_check_line_file"
1564    at_status=99
1565  fi
1566  $at_verbose $as_echo_n "$at_group. $at_setup_line: "
1567  $as_echo_n "$at_group. $at_setup_line: " >> "$at_group_log"
1568  case $at_xfail:$at_status in
1569    yes:0)
1570	at_msg="UNEXPECTED PASS"
1571	at_res=xpass
1572	at_errexit=$at_errexit_p
1573	at_color=$at_red
1574	;;
1575    no:0)
1576	at_msg="ok"
1577	at_res=pass
1578	at_errexit=false
1579	at_color=$at_grn
1580	;;
1581    *:77)
1582	at_msg='skipped ('`cat "$at_check_line_file"`')'
1583	at_res=skip
1584	at_errexit=false
1585	at_color=$at_blu
1586	;;
1587    no:* | *:99)
1588	at_msg='FAILED ('`cat "$at_check_line_file"`')'
1589	at_res=fail
1590	at_errexit=$at_errexit_p
1591	at_color=$at_red
1592	;;
1593    yes:*)
1594	at_msg='expected failure ('`cat "$at_check_line_file"`')'
1595	at_res=xfail
1596	at_errexit=false
1597	at_color=$at_lgn
1598	;;
1599  esac
1600  echo "$at_res" > "$at_job_dir/$at_res"
1601  # In parallel mode, output the summary line only afterwards.
1602  if test $at_jobs -ne 1 && test -n "$at_verbose"; then
1603    $as_echo "$at_desc_line $at_color$at_msg$at_std"
1604  else
1605    # Make sure there is a separator even with long titles.
1606    $as_echo " $at_color$at_msg$at_std"
1607  fi
1608  at_log_msg="$at_group. $at_desc ($at_setup_line): $at_msg"
1609  case $at_status in
1610    0|77)
1611      # $at_times_file is only available if the group succeeded.
1612      # We're not including the group log, so the success message
1613      # is written in the global log separately.  But we also
1614      # write to the group log in case they're using -d.
1615      if test -f "$at_times_file"; then
1616	at_log_msg="$at_log_msg     ("`sed 1d "$at_times_file"`')'
1617	rm -f "$at_times_file"
1618      fi
1619      $as_echo "$at_log_msg" >> "$at_group_log"
1620      $as_echo "$at_log_msg" >&5
1621
1622      # Cleanup the group directory, unless the user wants the files
1623      # or the success was unexpected.
1624      if $at_debug_p || test $at_res = xpass; then
1625	at_fn_create_debugging_script
1626	if test $at_res = xpass && $at_errexit; then
1627	  echo stop > "$at_stop_file"
1628	fi
1629      else
1630	if test -d "$at_group_dir"; then
1631	  find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \;
1632	  rm -fr "$at_group_dir"
1633	fi
1634	rm -f "$at_test_source"
1635      fi
1636      ;;
1637    *)
1638      # Upon failure, include the log into the testsuite's global
1639      # log.  The failure message is written in the group log.  It
1640      # is later included in the global log.
1641      $as_echo "$at_log_msg" >> "$at_group_log"
1642
1643      # Upon failure, keep the group directory for autopsy, and create
1644      # the debugging script.  With -e, do not start any further tests.
1645      at_fn_create_debugging_script
1646      if $at_errexit; then
1647	echo stop > "$at_stop_file"
1648      fi
1649      ;;
1650  esac
1651}
1652
1653
1654## ------------ ##
1655## Driver loop. ##
1656## ------------ ##
1657
1658
1659if (set -m && set +m && set +b) >/dev/null 2>&1; then
1660  set +b
1661  at_job_control_on='set -m' at_job_control_off='set +m' at_job_group=-
1662else
1663  at_job_control_on=: at_job_control_off=: at_job_group=
1664fi
1665
1666for at_signal in 1 2 15; do
1667  trap 'set +x; set +e
1668	$at_job_control_off
1669	at_signal='"$at_signal"'
1670	echo stop > "$at_stop_file"
1671	trap "" $at_signal
1672	at_pgids=
1673	for at_pgid in `jobs -p 2>/dev/null`; do
1674	  at_pgids="$at_pgids $at_job_group$at_pgid"
1675	done
1676	test -z "$at_pgids" || kill -$at_signal $at_pgids 2>/dev/null
1677	wait
1678	if test "$at_jobs" -eq 1 || test -z "$at_verbose"; then
1679	  echo >&2
1680	fi
1681	at_signame=`kill -l $at_signal 2>&1 || echo $at_signal`
1682	set x $at_signame
1683	test 1 -gt 2 && at_signame=$at_signal
1684	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: caught signal $at_signame, bailing out" >&5
1685$as_echo "$as_me: WARNING: caught signal $at_signame, bailing out" >&2;}
1686	as_fn_arith 128 + $at_signal && exit_status=$as_val
1687	as_fn_exit $exit_status' $at_signal
1688done
1689
1690rm -f "$at_stop_file"
1691at_first=:
1692
1693if test $at_jobs -ne 1 &&
1694     rm -f "$at_job_fifo" &&
1695     test -n "$at_job_group" &&
1696     ( mkfifo "$at_job_fifo" && trap 'exit 1' PIPE STOP TSTP ) 2>/dev/null
1697then
1698  # FIFO job dispatcher.
1699
1700  trap 'at_pids=
1701	for at_pid in `jobs -p`; do
1702	  at_pids="$at_pids $at_job_group$at_pid"
1703	done
1704	if test -n "$at_pids"; then
1705	  at_sig=TSTP
1706	  test "${TMOUT+set}" = set && at_sig=STOP
1707	  kill -$at_sig $at_pids 2>/dev/null
1708	fi
1709	kill -STOP $$
1710	test -z "$at_pids" || kill -CONT $at_pids 2>/dev/null' TSTP
1711
1712  echo
1713  # Turn jobs into a list of numbers, starting from 1.
1714  at_joblist=`$as_echo "$at_groups" | sed -n 1,${at_jobs}p`
1715
1716  set X $at_joblist
1717  shift
1718  for at_group in $at_groups; do
1719    $at_job_control_on 2>/dev/null
1720    (
1721      # Start one test group.
1722      $at_job_control_off
1723      if $at_first; then
1724	exec 7>"$at_job_fifo"
1725      else
1726	exec 6<&-
1727      fi
1728      trap 'set +x; set +e
1729	    trap "" PIPE
1730	    echo stop > "$at_stop_file"
1731	    echo >&7
1732	    as_fn_exit 141' PIPE
1733      at_fn_group_prepare
1734      if cd "$at_group_dir" &&
1735	 at_fn_test $at_group &&
1736	 . "$at_test_source"
1737      then :; else
1738	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5
1739$as_echo "$as_me: WARNING: unable to parse test group: $at_group" >&2;}
1740	at_failed=:
1741      fi
1742      at_fn_group_postprocess
1743      echo >&7
1744    ) &
1745    $at_job_control_off
1746    if $at_first; then
1747      at_first=false
1748      exec 6<"$at_job_fifo" 7>"$at_job_fifo"
1749    fi
1750    shift # Consume one token.
1751    if test $# -gt 0; then :; else
1752      read at_token <&6 || break
1753      set x $*
1754    fi
1755    test -f "$at_stop_file" && break
1756  done
1757  exec 7>&-
1758  # Read back the remaining ($at_jobs - 1) tokens.
1759  set X $at_joblist
1760  shift
1761  if test $# -gt 0; then
1762    shift
1763    for at_job
1764    do
1765      read at_token
1766    done <&6
1767  fi
1768  exec 6<&-
1769  wait
1770else
1771  # Run serially, avoid forks and other potential surprises.
1772  for at_group in $at_groups; do
1773    at_fn_group_prepare
1774    if cd "$at_group_dir" &&
1775       at_fn_test $at_group &&
1776       . "$at_test_source"; then :; else
1777      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5
1778$as_echo "$as_me: WARNING: unable to parse test group: $at_group" >&2;}
1779      at_failed=:
1780    fi
1781    at_fn_group_postprocess
1782    test -f "$at_stop_file" && break
1783    at_first=false
1784  done
1785fi
1786
1787# Wrap up the test suite with summary statistics.
1788cd "$at_helper_dir"
1789
1790# Use ?..???? when the list must remain sorted, the faster * otherwise.
1791at_pass_list=`for f in */pass; do echo $f; done | sed '/\*/d; s,/pass,,'`
1792at_skip_list=`for f in */skip; do echo $f; done | sed '/\*/d; s,/skip,,'`
1793at_xfail_list=`for f in */xfail; do echo $f; done | sed '/\*/d; s,/xfail,,'`
1794at_xpass_list=`for f in ?/xpass ??/xpass ???/xpass ????/xpass; do
1795		 echo $f; done | sed '/?/d; s,/xpass,,'`
1796at_fail_list=`for f in ?/fail ??/fail ???/fail ????/fail; do
1797		echo $f; done | sed '/?/d; s,/fail,,'`
1798
1799set X $at_pass_list $at_xpass_list $at_xfail_list $at_fail_list $at_skip_list
1800shift; at_group_count=$#
1801set X $at_xpass_list; shift; at_xpass_count=$#; at_xpass_list=$*
1802set X $at_xfail_list; shift; at_xfail_count=$#
1803set X $at_fail_list; shift; at_fail_count=$#; at_fail_list=$*
1804set X $at_skip_list; shift; at_skip_count=$#
1805
1806as_fn_arith $at_group_count - $at_skip_count && at_run_count=$as_val
1807as_fn_arith $at_xpass_count + $at_fail_count && at_unexpected_count=$as_val
1808as_fn_arith $at_xfail_count + $at_fail_count && at_total_fail_count=$as_val
1809
1810# Back to the top directory.
1811cd "$at_dir"
1812rm -rf "$at_helper_dir"
1813
1814# Compute the duration of the suite.
1815at_stop_date=`date`
1816at_stop_time=`date +%s 2>/dev/null`
1817$as_echo "$as_me: ending at: $at_stop_date" >&5
1818case $at_start_time,$at_stop_time in
1819  [0-9]*,[0-9]*)
1820    as_fn_arith $at_stop_time - $at_start_time && at_duration_s=$as_val
1821    as_fn_arith $at_duration_s / 60 && at_duration_m=$as_val
1822    as_fn_arith $at_duration_m / 60 && at_duration_h=$as_val
1823    as_fn_arith $at_duration_s % 60 && at_duration_s=$as_val
1824    as_fn_arith $at_duration_m % 60 && at_duration_m=$as_val
1825    at_duration="${at_duration_h}h ${at_duration_m}m ${at_duration_s}s"
1826    $as_echo "$as_me: test suite duration: $at_duration" >&5
1827    ;;
1828esac
1829
1830echo
1831$as_echo "## ------------- ##
1832## Test results. ##
1833## ------------- ##"
1834echo
1835{
1836  echo
1837  $as_echo "## ------------- ##
1838## Test results. ##
1839## ------------- ##"
1840  echo
1841} >&5
1842
1843if test $at_run_count = 1; then
1844  at_result="1 test"
1845  at_were=was
1846else
1847  at_result="$at_run_count tests"
1848  at_were=were
1849fi
1850if $at_errexit_p && test $at_unexpected_count != 0; then
1851  if test $at_xpass_count = 1; then
1852    at_result="$at_result $at_were run, one passed"
1853  else
1854    at_result="$at_result $at_were run, one failed"
1855  fi
1856  at_result="$at_result unexpectedly and inhibited subsequent tests."
1857  at_color=$at_red
1858else
1859  # Don't you just love exponential explosion of the number of cases?
1860  at_color=$at_red
1861  case $at_xpass_count:$at_fail_count:$at_xfail_count in
1862    # So far, so good.
1863    0:0:0) at_result="$at_result $at_were successful." at_color=$at_grn ;;
1864    0:0:*) at_result="$at_result behaved as expected." at_color=$at_lgn ;;
1865
1866    # Some unexpected failures
1867    0:*:0) at_result="$at_result $at_were run,
1868$at_fail_count failed unexpectedly." ;;
1869
1870    # Some failures, both expected and unexpected
1871    0:*:1) at_result="$at_result $at_were run,
1872$at_total_fail_count failed ($at_xfail_count expected failure)." ;;
1873    0:*:*) at_result="$at_result $at_were run,
1874$at_total_fail_count failed ($at_xfail_count expected failures)." ;;
1875
1876    # No unexpected failures, but some xpasses
1877    *:0:*) at_result="$at_result $at_were run,
1878$at_xpass_count passed unexpectedly." ;;
1879
1880    # No expected failures, but failures and xpasses
1881    *:1:0) at_result="$at_result $at_were run,
1882$at_unexpected_count did not behave as expected ($at_fail_count unexpected failure)." ;;
1883    *:*:0) at_result="$at_result $at_were run,
1884$at_unexpected_count did not behave as expected ($at_fail_count unexpected failures)." ;;
1885
1886    # All of them.
1887    *:*:1) at_result="$at_result $at_were run,
1888$at_xpass_count passed unexpectedly,
1889$at_total_fail_count failed ($at_xfail_count expected failure)." ;;
1890    *:*:*) at_result="$at_result $at_were run,
1891$at_xpass_count passed unexpectedly,
1892$at_total_fail_count failed ($at_xfail_count expected failures)." ;;
1893  esac
1894
1895  if test $at_skip_count = 0 && test $at_run_count -gt 1; then
1896    at_result="All $at_result"
1897  fi
1898fi
1899
1900# Now put skips in the mix.
1901case $at_skip_count in
1902  0) ;;
1903  1) at_result="$at_result
19041 test was skipped." ;;
1905  *) at_result="$at_result
1906$at_skip_count tests were skipped." ;;
1907esac
1908
1909if test $at_unexpected_count = 0; then
1910  echo "$at_color$at_result$at_std"
1911  echo "$at_result" >&5
1912else
1913  echo "${at_color}ERROR: $at_result$at_std" >&2
1914  echo "ERROR: $at_result" >&5
1915  {
1916    echo
1917    $as_echo "## ------------------------ ##
1918## Summary of the failures. ##
1919## ------------------------ ##"
1920
1921    # Summary of failed and skipped tests.
1922    if test $at_fail_count != 0; then
1923      echo "Failed tests:"
1924      $SHELL "$at_myself" $at_fail_list --list
1925      echo
1926    fi
1927    if test $at_skip_count != 0; then
1928      echo "Skipped tests:"
1929      $SHELL "$at_myself" $at_skip_list --list
1930      echo
1931    fi
1932    if test $at_xpass_count != 0; then
1933      echo "Unexpected passes:"
1934      $SHELL "$at_myself" $at_xpass_list --list
1935      echo
1936    fi
1937    if test $at_fail_count != 0; then
1938      $as_echo "## ---------------------- ##
1939## Detailed failed tests. ##
1940## ---------------------- ##"
1941      echo
1942      for at_group in $at_fail_list
1943      do
1944	at_group_normalized=$at_group
1945
1946  eval 'while :; do
1947    case $at_group_normalized in #(
1948    '"$at_format"'*) break;;
1949    esac
1950    at_group_normalized=0$at_group_normalized
1951  done'
1952
1953	cat "$at_suite_dir/$at_group_normalized/$as_me.log"
1954	echo
1955      done
1956      echo
1957    fi
1958    if test -n "$at_top_srcdir"; then
1959      sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
1960## ${at_top_build_prefix}config.log ##
1961_ASBOX
1962      sed 's/^/| /' ${at_top_build_prefix}config.log
1963      echo
1964    fi
1965  } >&5
1966
1967  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
1968## $as_me.log was created. ##
1969_ASBOX
1970
1971  echo
1972  if $at_debug_p; then
1973    at_msg='per-test log files'
1974  else
1975    at_msg="\`${at_testdir+${at_testdir}/}$as_me.log'"
1976  fi
1977  $as_echo "Please send $at_msg and all information you think might help:
1978
1979   To: <kyua-discuss@googlegroups.com>
1980   Subject: [Kyua 0.13] $as_me: $at_fail_list${at_fail_list:+ failed${at_xpass_list:+, }}$at_xpass_list${at_xpass_list:+ passed unexpectedly}
1981
1982You may investigate any problem if you feel able to do so, in which
1983case the test suite provides a good starting point.  Its output may
1984be found below \`${at_testdir+${at_testdir}/}$as_me.dir'.
1985"
1986  exit 1
1987fi
1988
1989exit 0
1990
1991## ------------- ##
1992## Actual tests. ##
1993## ------------- ##
1994#AT_START_1
1995at_fn_group_banner 1 'testsuite.at:72' \
1996  "test program crashes in test list" "              "
1997at_xfail=no
1998(
1999  $as_echo "1. $at_setup_line: testing $at_desc ..."
2000  $at_traceon
2001
2002
2003
2004
2005    cat >Kyuafile <<'_ATEOF'
2006
2007syntax(2)
2008test_suite("bootstrap")
2009atf_test_program{name="plain_helpers"}
2010_ATEOF
2011
2012    ln -s $({
2013    old=$(pwd)
2014    cd "$(dirname ${as_myself})"
2015    # We need to locate a build product, not a source file, because the
2016    # test suite may be run outside of the source tree (think distcheck).
2017    while test $(pwd) != '/' -a ! -e bootstrap/plain_helpers; do
2018        cd ..
2019    done
2020    topdir=$(pwd)
2021    cd ${old}
2022    echo ${topdir}
2023})/bootstrap/plain_helpers plain_helpers
2024
2025{ set +x
2026$as_echo "$at_srcdir/testsuite.at:76: HOME=\$(pwd) HELPER=\"abort_test_cases_list\" kyua --config=none \\
2027        test --results-file=bootstrap.db"
2028at_fn_check_prepare_notrace 'a $(...) command substitution' "testsuite.at:76"
2029( $at_check_trace; HOME=$(pwd) HELPER="abort_test_cases_list" kyua --config=none \
2030        test --results-file=bootstrap.db
2031) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2032at_status=$? at_failed=false
2033$at_check_filter
2034at_fn_diff_devnull "$at_stderr" || at_failed=:
2035echo stdout:; tee stdout <"$at_stdout"
2036at_fn_check_status 1 $at_status "$at_srcdir/testsuite.at:76"
2037$at_failed && at_fn_log_failure
2038$at_traceon; }
2039
2040re='plain_helpers:__test_cases_list__.*broken.*Test program received signal'
2041{ set +x
2042$as_echo "$at_srcdir/testsuite.at:78: grep \"\${re}\" stdout"
2043at_fn_check_prepare_notrace 'a ${...} parameter expansion' "testsuite.at:78"
2044( $at_check_trace; grep "${re}" stdout
2045) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2046at_status=$? at_failed=false
2047$at_check_filter
2048at_fn_diff_devnull "$at_stderr" || at_failed=:
2049echo stdout:; cat "$at_stdout"
2050at_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:78"
2051$at_failed && at_fn_log_failure
2052$at_traceon; }
2053
2054
2055  set +x
2056  $at_times_p && times >"$at_times_file"
2057) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2058read at_status <"$at_status_file"
2059#AT_STOP_1
2060#AT_START_2
2061at_fn_group_banner 2 'testsuite.at:83' \
2062  "test program prints an empty test list" "         "
2063at_xfail=no
2064(
2065  $as_echo "2. $at_setup_line: testing $at_desc ..."
2066  $at_traceon
2067
2068
2069
2070
2071    cat >Kyuafile <<'_ATEOF'
2072
2073syntax(2)
2074test_suite("bootstrap")
2075atf_test_program{name="plain_helpers"}
2076_ATEOF
2077
2078    ln -s $({
2079    old=$(pwd)
2080    cd "$(dirname ${as_myself})"
2081    # We need to locate a build product, not a source file, because the
2082    # test suite may be run outside of the source tree (think distcheck).
2083    while test $(pwd) != '/' -a ! -e bootstrap/plain_helpers; do
2084        cd ..
2085    done
2086    topdir=$(pwd)
2087    cd ${old}
2088    echo ${topdir}
2089})/bootstrap/plain_helpers plain_helpers
2090
2091{ set +x
2092$as_echo "$at_srcdir/testsuite.at:87: HOME=\$(pwd) HELPER=\"empty_test_cases_list\" kyua --config=none \\
2093        test --results-file=bootstrap.db"
2094at_fn_check_prepare_notrace 'a $(...) command substitution' "testsuite.at:87"
2095( $at_check_trace; HOME=$(pwd) HELPER="empty_test_cases_list" kyua --config=none \
2096        test --results-file=bootstrap.db
2097) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2098at_status=$? at_failed=false
2099$at_check_filter
2100at_fn_diff_devnull "$at_stderr" || at_failed=:
2101echo stdout:; tee stdout <"$at_stdout"
2102at_fn_check_status 1 $at_status "$at_srcdir/testsuite.at:87"
2103$at_failed && at_fn_log_failure
2104$at_traceon; }
2105
2106re="plain_helpers:__test_cases_list__.*broken.*Invalid header.*got ''"
2107{ set +x
2108$as_echo "$at_srcdir/testsuite.at:89: grep \"\${re}\" stdout"
2109at_fn_check_prepare_notrace 'a ${...} parameter expansion' "testsuite.at:89"
2110( $at_check_trace; grep "${re}" stdout
2111) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2112at_status=$? at_failed=false
2113$at_check_filter
2114at_fn_diff_devnull "$at_stderr" || at_failed=:
2115echo stdout:; cat "$at_stdout"
2116at_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:89"
2117$at_failed && at_fn_log_failure
2118$at_traceon; }
2119
2120
2121  set +x
2122  $at_times_p && times >"$at_times_file"
2123) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2124read at_status <"$at_status_file"
2125#AT_STOP_2
2126#AT_START_3
2127at_fn_group_banner 3 'testsuite.at:94' \
2128  "test program with zero test cases" "              "
2129at_xfail=no
2130(
2131  $as_echo "3. $at_setup_line: testing $at_desc ..."
2132  $at_traceon
2133
2134
2135
2136
2137    cat >Kyuafile <<'_ATEOF'
2138
2139syntax(2)
2140test_suite("bootstrap")
2141atf_test_program{name="plain_helpers"}
2142_ATEOF
2143
2144    ln -s $({
2145    old=$(pwd)
2146    cd "$(dirname ${as_myself})"
2147    # We need to locate a build product, not a source file, because the
2148    # test suite may be run outside of the source tree (think distcheck).
2149    while test $(pwd) != '/' -a ! -e bootstrap/plain_helpers; do
2150        cd ..
2151    done
2152    topdir=$(pwd)
2153    cd ${old}
2154    echo ${topdir}
2155})/bootstrap/plain_helpers plain_helpers
2156
2157{ set +x
2158$as_echo "$at_srcdir/testsuite.at:98: HOME=\$(pwd) HELPER=\"zero_test_cases\" kyua --config=none \\
2159        test --results-file=bootstrap.db"
2160at_fn_check_prepare_notrace 'a $(...) command substitution' "testsuite.at:98"
2161( $at_check_trace; HOME=$(pwd) HELPER="zero_test_cases" kyua --config=none \
2162        test --results-file=bootstrap.db
2163) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2164at_status=$? at_failed=false
2165$at_check_filter
2166at_fn_diff_devnull "$at_stderr" || at_failed=:
2167echo stdout:; tee stdout <"$at_stdout"
2168at_fn_check_status 1 $at_status "$at_srcdir/testsuite.at:98"
2169$at_failed && at_fn_log_failure
2170$at_traceon; }
2171
2172re='plain_helpers:__test_cases_list__.*broken.*No test cases'
2173{ set +x
2174$as_echo "$at_srcdir/testsuite.at:100: grep \"\${re}\" stdout"
2175at_fn_check_prepare_notrace 'a ${...} parameter expansion' "testsuite.at:100"
2176( $at_check_trace; grep "${re}" stdout
2177) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2178at_status=$? at_failed=false
2179$at_check_filter
2180at_fn_diff_devnull "$at_stderr" || at_failed=:
2181echo stdout:; cat "$at_stdout"
2182at_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:100"
2183$at_failed && at_fn_log_failure
2184$at_traceon; }
2185
2186
2187  set +x
2188  $at_times_p && times >"$at_times_file"
2189) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2190read at_status <"$at_status_file"
2191#AT_STOP_3
2192#AT_START_4
2193at_fn_group_banner 4 'testsuite.at:105' \
2194  "run test case that passes" "                      "
2195at_xfail=no
2196(
2197  $as_echo "4. $at_setup_line: testing $at_desc ..."
2198  $at_traceon
2199
2200
2201
2202
2203    cat >Kyuafile <<'_ATEOF'
2204
2205syntax(2)
2206test_suite("bootstrap")
2207atf_test_program{name="atf_helpers"}
2208_ATEOF
2209
2210    ln -s $({
2211    old=$(pwd)
2212    cd "$(dirname ${as_myself})"
2213    # We need to locate a build product, not a source file, because the
2214    # test suite may be run outside of the source tree (think distcheck).
2215    while test $(pwd) != '/' -a ! -e bootstrap/plain_helpers; do
2216        cd ..
2217    done
2218    topdir=$(pwd)
2219    cd ${old}
2220    echo ${topdir}
2221})/bootstrap/atf_helpers atf_helpers
2222
2223{ set +x
2224$as_echo "$at_srcdir/testsuite.at:109: HOME=\$(pwd) TESTS=\"passes\" kyua --config=none \\
2225        test --results-file=bootstrap.db "
2226at_fn_check_prepare_notrace 'a $(...) command substitution' "testsuite.at:109"
2227( $at_check_trace; HOME=$(pwd) TESTS="passes" kyua --config=none \
2228        test --results-file=bootstrap.db
2229) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2230at_status=$? at_failed=false
2231$at_check_filter
2232at_fn_diff_devnull "$at_stderr" || at_failed=:
2233echo stdout:; tee stdout <"$at_stdout"
2234at_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:109"
2235$at_failed && at_fn_log_failure
2236$at_traceon; }
2237
2238{ set +x
2239$as_echo "$at_srcdir/testsuite.at:110: grep \"atf_helpers:fails\" stdout"
2240at_fn_check_prepare_trace "testsuite.at:110"
2241( $at_check_trace; grep "atf_helpers:fails" stdout
2242) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2243at_status=$? at_failed=false
2244$at_check_filter
2245at_fn_diff_devnull "$at_stderr" || at_failed=:
2246at_fn_diff_devnull "$at_stdout" || at_failed=:
2247at_fn_check_status 1 $at_status "$at_srcdir/testsuite.at:110"
2248$at_failed && at_fn_log_failure
2249$at_traceon; }
2250
2251{ set +x
2252$as_echo "$at_srcdir/testsuite.at:111: grep \"atf_helpers:passes.*passed\" stdout"
2253at_fn_check_prepare_trace "testsuite.at:111"
2254( $at_check_trace; grep "atf_helpers:passes.*passed" stdout
2255) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2256at_status=$? at_failed=false
2257$at_check_filter
2258at_fn_diff_devnull "$at_stderr" || at_failed=:
2259echo stdout:; cat "$at_stdout"
2260at_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:111"
2261$at_failed && at_fn_log_failure
2262$at_traceon; }
2263
2264{ set +x
2265$as_echo "$at_srcdir/testsuite.at:112: grep \"atf_helpers:skips\" stdout"
2266at_fn_check_prepare_trace "testsuite.at:112"
2267( $at_check_trace; grep "atf_helpers:skips" stdout
2268) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2269at_status=$? at_failed=false
2270$at_check_filter
2271at_fn_diff_devnull "$at_stderr" || at_failed=:
2272at_fn_diff_devnull "$at_stdout" || at_failed=:
2273at_fn_check_status 1 $at_status "$at_srcdir/testsuite.at:112"
2274$at_failed && at_fn_log_failure
2275$at_traceon; }
2276
2277
2278  set +x
2279  $at_times_p && times >"$at_times_file"
2280) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2281read at_status <"$at_status_file"
2282#AT_STOP_4
2283#AT_START_5
2284at_fn_group_banner 5 'testsuite.at:117' \
2285  "run test case that fails" "                       "
2286at_xfail=no
2287(
2288  $as_echo "5. $at_setup_line: testing $at_desc ..."
2289  $at_traceon
2290
2291
2292
2293
2294    cat >Kyuafile <<'_ATEOF'
2295
2296syntax(2)
2297test_suite("bootstrap")
2298atf_test_program{name="atf_helpers"}
2299_ATEOF
2300
2301    ln -s $({
2302    old=$(pwd)
2303    cd "$(dirname ${as_myself})"
2304    # We need to locate a build product, not a source file, because the
2305    # test suite may be run outside of the source tree (think distcheck).
2306    while test $(pwd) != '/' -a ! -e bootstrap/plain_helpers; do
2307        cd ..
2308    done
2309    topdir=$(pwd)
2310    cd ${old}
2311    echo ${topdir}
2312})/bootstrap/atf_helpers atf_helpers
2313
2314{ set +x
2315$as_echo "$at_srcdir/testsuite.at:121: HOME=\$(pwd) TESTS=\"fails\" kyua --config=none \\
2316        test --results-file=bootstrap.db "
2317at_fn_check_prepare_notrace 'a $(...) command substitution' "testsuite.at:121"
2318( $at_check_trace; HOME=$(pwd) TESTS="fails" kyua --config=none \
2319        test --results-file=bootstrap.db
2320) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2321at_status=$? at_failed=false
2322$at_check_filter
2323at_fn_diff_devnull "$at_stderr" || at_failed=:
2324echo stdout:; tee stdout <"$at_stdout"
2325at_fn_check_status 1 $at_status "$at_srcdir/testsuite.at:121"
2326$at_failed && at_fn_log_failure
2327$at_traceon; }
2328
2329{ set +x
2330$as_echo "$at_srcdir/testsuite.at:122: grep \"atf_helpers:fails.*failed.*Failed on purpose\" stdout"
2331at_fn_check_prepare_trace "testsuite.at:122"
2332( $at_check_trace; grep "atf_helpers:fails.*failed.*Failed on purpose" stdout
2333) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2334at_status=$? at_failed=false
2335$at_check_filter
2336at_fn_diff_devnull "$at_stderr" || at_failed=:
2337echo stdout:; cat "$at_stdout"
2338at_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:122"
2339$at_failed && at_fn_log_failure
2340$at_traceon; }
2341
2342{ set +x
2343$as_echo "$at_srcdir/testsuite.at:124: grep \"atf_helpers:passes\" stdout"
2344at_fn_check_prepare_trace "testsuite.at:124"
2345( $at_check_trace; grep "atf_helpers:passes" stdout
2346) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2347at_status=$? at_failed=false
2348$at_check_filter
2349at_fn_diff_devnull "$at_stderr" || at_failed=:
2350at_fn_diff_devnull "$at_stdout" || at_failed=:
2351at_fn_check_status 1 $at_status "$at_srcdir/testsuite.at:124"
2352$at_failed && at_fn_log_failure
2353$at_traceon; }
2354
2355{ set +x
2356$as_echo "$at_srcdir/testsuite.at:125: grep \"atf_helpers:skips\" stdout"
2357at_fn_check_prepare_trace "testsuite.at:125"
2358( $at_check_trace; grep "atf_helpers:skips" stdout
2359) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2360at_status=$? at_failed=false
2361$at_check_filter
2362at_fn_diff_devnull "$at_stderr" || at_failed=:
2363at_fn_diff_devnull "$at_stdout" || at_failed=:
2364at_fn_check_status 1 $at_status "$at_srcdir/testsuite.at:125"
2365$at_failed && at_fn_log_failure
2366$at_traceon; }
2367
2368
2369  set +x
2370  $at_times_p && times >"$at_times_file"
2371) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2372read at_status <"$at_status_file"
2373#AT_STOP_5
2374#AT_START_6
2375at_fn_group_banner 6 'testsuite.at:130' \
2376  "run test case that skips" "                       "
2377at_xfail=no
2378(
2379  $as_echo "6. $at_setup_line: testing $at_desc ..."
2380  $at_traceon
2381
2382
2383
2384
2385    cat >Kyuafile <<'_ATEOF'
2386
2387syntax(2)
2388test_suite("bootstrap")
2389atf_test_program{name="atf_helpers"}
2390_ATEOF
2391
2392    ln -s $({
2393    old=$(pwd)
2394    cd "$(dirname ${as_myself})"
2395    # We need to locate a build product, not a source file, because the
2396    # test suite may be run outside of the source tree (think distcheck).
2397    while test $(pwd) != '/' -a ! -e bootstrap/plain_helpers; do
2398        cd ..
2399    done
2400    topdir=$(pwd)
2401    cd ${old}
2402    echo ${topdir}
2403})/bootstrap/atf_helpers atf_helpers
2404
2405{ set +x
2406$as_echo "$at_srcdir/testsuite.at:134: HOME=\$(pwd) TESTS=\"skips\" kyua --config=none \\
2407        test --results-file=bootstrap.db "
2408at_fn_check_prepare_notrace 'a $(...) command substitution' "testsuite.at:134"
2409( $at_check_trace; HOME=$(pwd) TESTS="skips" kyua --config=none \
2410        test --results-file=bootstrap.db
2411) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2412at_status=$? at_failed=false
2413$at_check_filter
2414at_fn_diff_devnull "$at_stderr" || at_failed=:
2415echo stdout:; tee stdout <"$at_stdout"
2416at_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:134"
2417$at_failed && at_fn_log_failure
2418$at_traceon; }
2419
2420{ set +x
2421$as_echo "$at_srcdir/testsuite.at:135: grep \"atf_helpers:fails\" stdout"
2422at_fn_check_prepare_trace "testsuite.at:135"
2423( $at_check_trace; grep "atf_helpers:fails" stdout
2424) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2425at_status=$? at_failed=false
2426$at_check_filter
2427at_fn_diff_devnull "$at_stderr" || at_failed=:
2428at_fn_diff_devnull "$at_stdout" || at_failed=:
2429at_fn_check_status 1 $at_status "$at_srcdir/testsuite.at:135"
2430$at_failed && at_fn_log_failure
2431$at_traceon; }
2432
2433{ set +x
2434$as_echo "$at_srcdir/testsuite.at:136: grep \"atf_helpers:passes\" stdout"
2435at_fn_check_prepare_trace "testsuite.at:136"
2436( $at_check_trace; grep "atf_helpers:passes" stdout
2437) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2438at_status=$? at_failed=false
2439$at_check_filter
2440at_fn_diff_devnull "$at_stderr" || at_failed=:
2441at_fn_diff_devnull "$at_stdout" || at_failed=:
2442at_fn_check_status 1 $at_status "$at_srcdir/testsuite.at:136"
2443$at_failed && at_fn_log_failure
2444$at_traceon; }
2445
2446{ set +x
2447$as_echo "$at_srcdir/testsuite.at:137: grep \"atf_helpers:skips.*skipped.*Skipped on purpose\" stdout"
2448at_fn_check_prepare_trace "testsuite.at:137"
2449( $at_check_trace; grep "atf_helpers:skips.*skipped.*Skipped on purpose" stdout
2450) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2451at_status=$? at_failed=false
2452$at_check_filter
2453at_fn_diff_devnull "$at_stderr" || at_failed=:
2454echo stdout:; cat "$at_stdout"
2455at_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:137"
2456$at_failed && at_fn_log_failure
2457$at_traceon; }
2458
2459
2460  set +x
2461  $at_times_p && times >"$at_times_file"
2462) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2463read at_status <"$at_status_file"
2464#AT_STOP_6
2465#AT_START_7
2466at_fn_group_banner 7 'testsuite.at:143' \
2467  "run two test cases, success" "                    "
2468at_xfail=no
2469(
2470  $as_echo "7. $at_setup_line: testing $at_desc ..."
2471  $at_traceon
2472
2473
2474
2475
2476    cat >Kyuafile <<'_ATEOF'
2477
2478syntax(2)
2479test_suite("bootstrap")
2480atf_test_program{name="atf_helpers"}
2481_ATEOF
2482
2483    ln -s $({
2484    old=$(pwd)
2485    cd "$(dirname ${as_myself})"
2486    # We need to locate a build product, not a source file, because the
2487    # test suite may be run outside of the source tree (think distcheck).
2488    while test $(pwd) != '/' -a ! -e bootstrap/plain_helpers; do
2489        cd ..
2490    done
2491    topdir=$(pwd)
2492    cd ${old}
2493    echo ${topdir}
2494})/bootstrap/atf_helpers atf_helpers
2495
2496{ set +x
2497$as_echo "$at_srcdir/testsuite.at:147: HOME=\$(pwd) TESTS=\"passes skips\" kyua --config=none \\
2498        test --results-file=bootstrap.db "
2499at_fn_check_prepare_notrace 'a $(...) command substitution' "testsuite.at:147"
2500( $at_check_trace; HOME=$(pwd) TESTS="passes skips" kyua --config=none \
2501        test --results-file=bootstrap.db
2502) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2503at_status=$? at_failed=false
2504$at_check_filter
2505at_fn_diff_devnull "$at_stderr" || at_failed=:
2506echo stdout:; tee stdout <"$at_stdout"
2507at_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:147"
2508$at_failed && at_fn_log_failure
2509$at_traceon; }
2510
2511{ set +x
2512$as_echo "$at_srcdir/testsuite.at:148: grep \"atf_helpers:fails\" stdout"
2513at_fn_check_prepare_trace "testsuite.at:148"
2514( $at_check_trace; grep "atf_helpers:fails" stdout
2515) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2516at_status=$? at_failed=false
2517$at_check_filter
2518at_fn_diff_devnull "$at_stderr" || at_failed=:
2519at_fn_diff_devnull "$at_stdout" || at_failed=:
2520at_fn_check_status 1 $at_status "$at_srcdir/testsuite.at:148"
2521$at_failed && at_fn_log_failure
2522$at_traceon; }
2523
2524{ set +x
2525$as_echo "$at_srcdir/testsuite.at:149: grep \"atf_helpers:passes.*passed\" stdout"
2526at_fn_check_prepare_trace "testsuite.at:149"
2527( $at_check_trace; grep "atf_helpers:passes.*passed" stdout
2528) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2529at_status=$? at_failed=false
2530$at_check_filter
2531at_fn_diff_devnull "$at_stderr" || at_failed=:
2532echo stdout:; cat "$at_stdout"
2533at_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:149"
2534$at_failed && at_fn_log_failure
2535$at_traceon; }
2536
2537{ set +x
2538$as_echo "$at_srcdir/testsuite.at:150: grep \"atf_helpers:skips.*skipped.*Skipped on purpose\" stdout"
2539at_fn_check_prepare_trace "testsuite.at:150"
2540( $at_check_trace; grep "atf_helpers:skips.*skipped.*Skipped on purpose" stdout
2541) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2542at_status=$? at_failed=false
2543$at_check_filter
2544at_fn_diff_devnull "$at_stderr" || at_failed=:
2545echo stdout:; cat "$at_stdout"
2546at_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:150"
2547$at_failed && at_fn_log_failure
2548$at_traceon; }
2549
2550
2551  set +x
2552  $at_times_p && times >"$at_times_file"
2553) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2554read at_status <"$at_status_file"
2555#AT_STOP_7
2556#AT_START_8
2557at_fn_group_banner 8 'testsuite.at:156' \
2558  "run two test cases, failure" "                    "
2559at_xfail=no
2560(
2561  $as_echo "8. $at_setup_line: testing $at_desc ..."
2562  $at_traceon
2563
2564
2565
2566
2567    cat >Kyuafile <<'_ATEOF'
2568
2569syntax(2)
2570test_suite("bootstrap")
2571atf_test_program{name="atf_helpers"}
2572_ATEOF
2573
2574    ln -s $({
2575    old=$(pwd)
2576    cd "$(dirname ${as_myself})"
2577    # We need to locate a build product, not a source file, because the
2578    # test suite may be run outside of the source tree (think distcheck).
2579    while test $(pwd) != '/' -a ! -e bootstrap/plain_helpers; do
2580        cd ..
2581    done
2582    topdir=$(pwd)
2583    cd ${old}
2584    echo ${topdir}
2585})/bootstrap/atf_helpers atf_helpers
2586
2587{ set +x
2588$as_echo "$at_srcdir/testsuite.at:160: HOME=\$(pwd) TESTS=\"fails passes\" kyua --config=none \\
2589        test --results-file=bootstrap.db "
2590at_fn_check_prepare_notrace 'a $(...) command substitution' "testsuite.at:160"
2591( $at_check_trace; HOME=$(pwd) TESTS="fails passes" kyua --config=none \
2592        test --results-file=bootstrap.db
2593) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2594at_status=$? at_failed=false
2595$at_check_filter
2596at_fn_diff_devnull "$at_stderr" || at_failed=:
2597echo stdout:; tee stdout <"$at_stdout"
2598at_fn_check_status 1 $at_status "$at_srcdir/testsuite.at:160"
2599$at_failed && at_fn_log_failure
2600$at_traceon; }
2601
2602{ set +x
2603$as_echo "$at_srcdir/testsuite.at:161: grep \"atf_helpers:fails.*failure.*Failed on purpose\" stdout"
2604at_fn_check_prepare_trace "testsuite.at:161"
2605( $at_check_trace; grep "atf_helpers:fails.*failure.*Failed on purpose" stdout
2606) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2607at_status=$? at_failed=false
2608$at_check_filter
2609at_fn_diff_devnull "$at_stderr" || at_failed=:
2610at_fn_diff_devnull "$at_stdout" || at_failed=:
2611at_fn_check_status 1 $at_status "$at_srcdir/testsuite.at:161"
2612$at_failed && at_fn_log_failure
2613$at_traceon; }
2614
2615{ set +x
2616$as_echo "$at_srcdir/testsuite.at:163: grep \"atf_helpers:passes.*passed\" stdout"
2617at_fn_check_prepare_trace "testsuite.at:163"
2618( $at_check_trace; grep "atf_helpers:passes.*passed" stdout
2619) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2620at_status=$? at_failed=false
2621$at_check_filter
2622at_fn_diff_devnull "$at_stderr" || at_failed=:
2623echo stdout:; cat "$at_stdout"
2624at_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:163"
2625$at_failed && at_fn_log_failure
2626$at_traceon; }
2627
2628{ set +x
2629$as_echo "$at_srcdir/testsuite.at:164: grep \"atf_helpers:skips\" stdout"
2630at_fn_check_prepare_trace "testsuite.at:164"
2631( $at_check_trace; grep "atf_helpers:skips" stdout
2632) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2633at_status=$? at_failed=false
2634$at_check_filter
2635at_fn_diff_devnull "$at_stderr" || at_failed=:
2636at_fn_diff_devnull "$at_stdout" || at_failed=:
2637at_fn_check_status 1 $at_status "$at_srcdir/testsuite.at:164"
2638$at_failed && at_fn_log_failure
2639$at_traceon; }
2640
2641
2642  set +x
2643  $at_times_p && times >"$at_times_file"
2644) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2645read at_status <"$at_status_file"
2646#AT_STOP_8
2647#AT_START_9
2648at_fn_group_banner 9 'testsuite.at:169' \
2649  "run mixed test cases" "                           "
2650at_xfail=no
2651(
2652  $as_echo "9. $at_setup_line: testing $at_desc ..."
2653  $at_traceon
2654
2655
2656
2657
2658    cat >Kyuafile <<'_ATEOF'
2659
2660syntax(2)
2661test_suite("bootstrap")
2662atf_test_program{name="atf_helpers"}
2663_ATEOF
2664
2665    ln -s $({
2666    old=$(pwd)
2667    cd "$(dirname ${as_myself})"
2668    # We need to locate a build product, not a source file, because the
2669    # test suite may be run outside of the source tree (think distcheck).
2670    while test $(pwd) != '/' -a ! -e bootstrap/plain_helpers; do
2671        cd ..
2672    done
2673    topdir=$(pwd)
2674    cd ${old}
2675    echo ${topdir}
2676})/bootstrap/atf_helpers atf_helpers
2677
2678{ set +x
2679$as_echo "$at_srcdir/testsuite.at:173: HOME=\$(pwd) TESTS=\"fails passes skips\" kyua --config=none \\
2680        test --results-file=bootstrap.db "
2681at_fn_check_prepare_notrace 'a $(...) command substitution' "testsuite.at:173"
2682( $at_check_trace; HOME=$(pwd) TESTS="fails passes skips" kyua --config=none \
2683        test --results-file=bootstrap.db
2684) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2685at_status=$? at_failed=false
2686$at_check_filter
2687at_fn_diff_devnull "$at_stderr" || at_failed=:
2688echo stdout:; tee stdout <"$at_stdout"
2689at_fn_check_status 1 $at_status "$at_srcdir/testsuite.at:173"
2690$at_failed && at_fn_log_failure
2691$at_traceon; }
2692
2693{ set +x
2694$as_echo "$at_srcdir/testsuite.at:174: grep \"atf_helpers:fails.*failure.*Failed on purpose\" stdout"
2695at_fn_check_prepare_trace "testsuite.at:174"
2696( $at_check_trace; grep "atf_helpers:fails.*failure.*Failed on purpose" stdout
2697) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2698at_status=$? at_failed=false
2699$at_check_filter
2700at_fn_diff_devnull "$at_stderr" || at_failed=:
2701at_fn_diff_devnull "$at_stdout" || at_failed=:
2702at_fn_check_status 1 $at_status "$at_srcdir/testsuite.at:174"
2703$at_failed && at_fn_log_failure
2704$at_traceon; }
2705
2706{ set +x
2707$as_echo "$at_srcdir/testsuite.at:176: grep \"atf_helpers:passes.*passed\" stdout"
2708at_fn_check_prepare_trace "testsuite.at:176"
2709( $at_check_trace; grep "atf_helpers:passes.*passed" stdout
2710) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2711at_status=$? at_failed=false
2712$at_check_filter
2713at_fn_diff_devnull "$at_stderr" || at_failed=:
2714echo stdout:; cat "$at_stdout"
2715at_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:176"
2716$at_failed && at_fn_log_failure
2717$at_traceon; }
2718
2719{ set +x
2720$as_echo "$at_srcdir/testsuite.at:177: grep \"atf_helpers:skips.*skipped.*Skipped on purpose\" stdout"
2721at_fn_check_prepare_trace "testsuite.at:177"
2722( $at_check_trace; grep "atf_helpers:skips.*skipped.*Skipped on purpose" stdout
2723) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2724at_status=$? at_failed=false
2725$at_check_filter
2726at_fn_diff_devnull "$at_stderr" || at_failed=:
2727echo stdout:; cat "$at_stdout"
2728at_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:177"
2729$at_failed && at_fn_log_failure
2730$at_traceon; }
2731
2732
2733  set +x
2734  $at_times_p && times >"$at_times_file"
2735) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2736read at_status <"$at_status_file"
2737#AT_STOP_9
2738#AT_START_10
2739at_fn_group_banner 10 'testsuite.at:183' \
2740  "run tests from build directories" "               "
2741at_xfail=no
2742(
2743  $as_echo "10. $at_setup_line: testing $at_desc ..."
2744  $at_traceon
2745
2746
2747
2748
2749    cat >Kyuafile <<'_ATEOF'
2750
2751syntax(2)
2752test_suite("bootstrap")
2753atf_test_program{name="atf_helpers"}
2754_ATEOF
2755
2756    ln -s $({
2757    old=$(pwd)
2758    cd "$(dirname ${as_myself})"
2759    # We need to locate a build product, not a source file, because the
2760    # test suite may be run outside of the source tree (think distcheck).
2761    while test $(pwd) != '/' -a ! -e bootstrap/plain_helpers; do
2762        cd ..
2763    done
2764    topdir=$(pwd)
2765    cd ${old}
2766    echo ${topdir}
2767})/bootstrap/atf_helpers atf_helpers
2768
2769{ set +x
2770$as_echo "$at_srcdir/testsuite.at:187: mkdir src"
2771at_fn_check_prepare_trace "testsuite.at:187"
2772( $at_check_trace; mkdir src
2773) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2774at_status=$? at_failed=false
2775$at_check_filter
2776at_fn_diff_devnull "$at_stderr" || at_failed=:
2777at_fn_diff_devnull "$at_stdout" || at_failed=:
2778at_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:187"
2779$at_failed && at_fn_log_failure
2780$at_traceon; }
2781
2782{ set +x
2783$as_echo "$at_srcdir/testsuite.at:188: mv Kyuafile src"
2784at_fn_check_prepare_trace "testsuite.at:188"
2785( $at_check_trace; mv Kyuafile src
2786) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2787at_status=$? at_failed=false
2788$at_check_filter
2789at_fn_diff_devnull "$at_stderr" || at_failed=:
2790at_fn_diff_devnull "$at_stdout" || at_failed=:
2791at_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:188"
2792$at_failed && at_fn_log_failure
2793$at_traceon; }
2794
2795{ set +x
2796$as_echo "$at_srcdir/testsuite.at:189: mkdir obj"
2797at_fn_check_prepare_trace "testsuite.at:189"
2798( $at_check_trace; mkdir obj
2799) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2800at_status=$? at_failed=false
2801$at_check_filter
2802at_fn_diff_devnull "$at_stderr" || at_failed=:
2803at_fn_diff_devnull "$at_stdout" || at_failed=:
2804at_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:189"
2805$at_failed && at_fn_log_failure
2806$at_traceon; }
2807
2808{ set +x
2809$as_echo "$at_srcdir/testsuite.at:190: mv atf_helpers obj"
2810at_fn_check_prepare_trace "testsuite.at:190"
2811( $at_check_trace; mv atf_helpers obj
2812) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2813at_status=$? at_failed=false
2814$at_check_filter
2815at_fn_diff_devnull "$at_stderr" || at_failed=:
2816at_fn_diff_devnull "$at_stdout" || at_failed=:
2817at_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:190"
2818$at_failed && at_fn_log_failure
2819$at_traceon; }
2820
2821{ set +x
2822$as_echo "$at_srcdir/testsuite.at:191: HOME=\$(pwd) TESTS=\"fails passes skips\" kyua --config=none \\
2823        test --results-file=bootstrap.db --kyuafile=src/Kyuafile --build-root=obj"
2824at_fn_check_prepare_notrace 'a $(...) command substitution' "testsuite.at:191"
2825( $at_check_trace; HOME=$(pwd) TESTS="fails passes skips" kyua --config=none \
2826        test --results-file=bootstrap.db --kyuafile=src/Kyuafile --build-root=obj
2827) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2828at_status=$? at_failed=false
2829$at_check_filter
2830at_fn_diff_devnull "$at_stderr" || at_failed=:
2831echo stdout:; tee stdout <"$at_stdout"
2832at_fn_check_status 1 $at_status "$at_srcdir/testsuite.at:191"
2833$at_failed && at_fn_log_failure
2834$at_traceon; }
2835
2836{ set +x
2837$as_echo "$at_srcdir/testsuite.at:194: grep \"atf_helpers:fails.*failure.*Failed on purpose\" stdout"
2838at_fn_check_prepare_trace "testsuite.at:194"
2839( $at_check_trace; grep "atf_helpers:fails.*failure.*Failed on purpose" stdout
2840) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2841at_status=$? at_failed=false
2842$at_check_filter
2843at_fn_diff_devnull "$at_stderr" || at_failed=:
2844at_fn_diff_devnull "$at_stdout" || at_failed=:
2845at_fn_check_status 1 $at_status "$at_srcdir/testsuite.at:194"
2846$at_failed && at_fn_log_failure
2847$at_traceon; }
2848
2849{ set +x
2850$as_echo "$at_srcdir/testsuite.at:196: grep \"atf_helpers:passes.*passed\" stdout"
2851at_fn_check_prepare_trace "testsuite.at:196"
2852( $at_check_trace; grep "atf_helpers:passes.*passed" stdout
2853) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2854at_status=$? at_failed=false
2855$at_check_filter
2856at_fn_diff_devnull "$at_stderr" || at_failed=:
2857echo stdout:; cat "$at_stdout"
2858at_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:196"
2859$at_failed && at_fn_log_failure
2860$at_traceon; }
2861
2862{ set +x
2863$as_echo "$at_srcdir/testsuite.at:197: grep \"atf_helpers:skips.*skipped.*Skipped on purpose\" stdout"
2864at_fn_check_prepare_trace "testsuite.at:197"
2865( $at_check_trace; grep "atf_helpers:skips.*skipped.*Skipped on purpose" stdout
2866) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2867at_status=$? at_failed=false
2868$at_check_filter
2869at_fn_diff_devnull "$at_stderr" || at_failed=:
2870echo stdout:; cat "$at_stdout"
2871at_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:197"
2872$at_failed && at_fn_log_failure
2873$at_traceon; }
2874
2875
2876  set +x
2877  $at_times_p && times >"$at_times_file"
2878) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2879read at_status <"$at_status_file"
2880#AT_STOP_10
2881