xref: /minix3/external/bsd/kyua-cli/dist/bootstrap/testsuite (revision 84d9c625bfea59e274550651111ae9edfdc40fbd)
111be35a1SLionel Sambuc#! /bin/sh
211be35a1SLionel Sambuc# Generated from bootstrap/testsuite.at by GNU Autoconf 2.69.
311be35a1SLionel Sambuc#
411be35a1SLionel Sambuc# Copyright (C) 2009-2012 Free Software Foundation, Inc.
511be35a1SLionel Sambuc#
611be35a1SLionel Sambuc# This test suite is free software; the Free Software Foundation gives
711be35a1SLionel Sambuc# unlimited permission to copy, distribute and modify it.
811be35a1SLionel Sambuc## -------------------- ##
911be35a1SLionel Sambuc## M4sh Initialization. ##
1011be35a1SLionel Sambuc## -------------------- ##
1111be35a1SLionel Sambuc
1211be35a1SLionel Sambuc# Be more Bourne compatible
1311be35a1SLionel SambucDUALCASE=1; export DUALCASE # for MKS sh
1411be35a1SLionel Sambucif test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
1511be35a1SLionel Sambuc  emulate sh
1611be35a1SLionel Sambuc  NULLCMD=:
1711be35a1SLionel Sambuc  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
1811be35a1SLionel Sambuc  # is contrary to our usage.  Disable this feature.
1911be35a1SLionel Sambuc  alias -g '${1+"$@"}'='"$@"'
2011be35a1SLionel Sambuc  setopt NO_GLOB_SUBST
2111be35a1SLionel Sambucelse
2211be35a1SLionel Sambuc  case `(set -o) 2>/dev/null` in #(
2311be35a1SLionel Sambuc  *posix*) :
2411be35a1SLionel Sambuc    set -o posix ;; #(
2511be35a1SLionel Sambuc  *) :
2611be35a1SLionel Sambuc     ;;
2711be35a1SLionel Sambucesac
2811be35a1SLionel Sambucfi
2911be35a1SLionel Sambuc
3011be35a1SLionel Sambuc
3111be35a1SLionel Sambucas_nl='
3211be35a1SLionel Sambuc'
3311be35a1SLionel Sambucexport as_nl
3411be35a1SLionel Sambuc# Printing a long string crashes Solaris 7 /usr/bin/printf.
3511be35a1SLionel Sambucas_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
3611be35a1SLionel Sambucas_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
3711be35a1SLionel Sambucas_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
3811be35a1SLionel Sambuc# Prefer a ksh shell builtin over an external printf program on Solaris,
3911be35a1SLionel Sambuc# but without wasting forks for bash or zsh.
4011be35a1SLionel Sambucif test -z "$BASH_VERSION$ZSH_VERSION" \
4111be35a1SLionel Sambuc    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
4211be35a1SLionel Sambuc  as_echo='print -r --'
4311be35a1SLionel Sambuc  as_echo_n='print -rn --'
4411be35a1SLionel Sambucelif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
4511be35a1SLionel Sambuc  as_echo='printf %s\n'
4611be35a1SLionel Sambuc  as_echo_n='printf %s'
4711be35a1SLionel Sambucelse
4811be35a1SLionel Sambuc  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
4911be35a1SLionel Sambuc    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
5011be35a1SLionel Sambuc    as_echo_n='/usr/ucb/echo -n'
5111be35a1SLionel Sambuc  else
5211be35a1SLionel Sambuc    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
5311be35a1SLionel Sambuc    as_echo_n_body='eval
5411be35a1SLionel Sambuc      arg=$1;
5511be35a1SLionel Sambuc      case $arg in #(
5611be35a1SLionel Sambuc      *"$as_nl"*)
5711be35a1SLionel Sambuc	expr "X$arg" : "X\\(.*\\)$as_nl";
5811be35a1SLionel Sambuc	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
5911be35a1SLionel Sambuc      esac;
6011be35a1SLionel Sambuc      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
6111be35a1SLionel Sambuc    '
6211be35a1SLionel Sambuc    export as_echo_n_body
6311be35a1SLionel Sambuc    as_echo_n='sh -c $as_echo_n_body as_echo'
6411be35a1SLionel Sambuc  fi
6511be35a1SLionel Sambuc  export as_echo_body
6611be35a1SLionel Sambuc  as_echo='sh -c $as_echo_body as_echo'
6711be35a1SLionel Sambucfi
6811be35a1SLionel Sambuc
6911be35a1SLionel Sambuc# The user is always right.
7011be35a1SLionel Sambucif test "${PATH_SEPARATOR+set}" != set; then
7111be35a1SLionel Sambuc  PATH_SEPARATOR=:
7211be35a1SLionel Sambuc  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
7311be35a1SLionel Sambuc    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
7411be35a1SLionel Sambuc      PATH_SEPARATOR=';'
7511be35a1SLionel Sambuc  }
7611be35a1SLionel Sambucfi
7711be35a1SLionel Sambuc
7811be35a1SLionel Sambuc
7911be35a1SLionel Sambuc# IFS
8011be35a1SLionel Sambuc# We need space, tab and new line, in precisely that order.  Quoting is
8111be35a1SLionel Sambuc# there to prevent editors from complaining about space-tab.
8211be35a1SLionel Sambuc# (If _AS_PATH_WALK were called with IFS unset, it would disable word
8311be35a1SLionel Sambuc# splitting by setting IFS to empty value.)
8411be35a1SLionel SambucIFS=" ""	$as_nl"
8511be35a1SLionel Sambuc
8611be35a1SLionel Sambuc# Find who we are.  Look in the path if we contain no directory separator.
8711be35a1SLionel Sambucas_myself=
8811be35a1SLionel Sambuccase $0 in #((
8911be35a1SLionel Sambuc  *[\\/]* ) as_myself=$0 ;;
9011be35a1SLionel Sambuc  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
9111be35a1SLionel Sambucfor as_dir in $PATH
9211be35a1SLionel Sambucdo
9311be35a1SLionel Sambuc  IFS=$as_save_IFS
9411be35a1SLionel Sambuc  test -z "$as_dir" && as_dir=.
9511be35a1SLionel Sambuc    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
9611be35a1SLionel Sambuc  done
9711be35a1SLionel SambucIFS=$as_save_IFS
9811be35a1SLionel Sambuc
9911be35a1SLionel Sambuc     ;;
10011be35a1SLionel Sambucesac
10111be35a1SLionel Sambuc# We did not find ourselves, most probably we were run as `sh COMMAND'
10211be35a1SLionel Sambuc# in which case we are not to be found in the path.
10311be35a1SLionel Sambucif test "x$as_myself" = x; then
10411be35a1SLionel Sambuc  as_myself=$0
10511be35a1SLionel Sambucfi
10611be35a1SLionel Sambucif test ! -f "$as_myself"; then
10711be35a1SLionel Sambuc  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
10811be35a1SLionel Sambuc  exit 1
10911be35a1SLionel Sambucfi
11011be35a1SLionel Sambuc
11111be35a1SLionel Sambuc# Unset variables that we do not need and which cause bugs (e.g. in
11211be35a1SLionel Sambuc# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
11311be35a1SLionel Sambuc# suppresses any "Segmentation fault" message there.  '((' could
11411be35a1SLionel Sambuc# trigger a bug in pdksh 5.2.14.
11511be35a1SLionel Sambucfor as_var in BASH_ENV ENV MAIL MAILPATH
11611be35a1SLionel Sambucdo eval test x\${$as_var+set} = xset \
11711be35a1SLionel Sambuc  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
11811be35a1SLionel Sambucdone
11911be35a1SLionel SambucPS1='$ '
12011be35a1SLionel SambucPS2='> '
12111be35a1SLionel SambucPS4='+ '
12211be35a1SLionel Sambuc
12311be35a1SLionel Sambuc# NLS nuisances.
12411be35a1SLionel SambucLC_ALL=C
12511be35a1SLionel Sambucexport LC_ALL
12611be35a1SLionel SambucLANGUAGE=C
12711be35a1SLionel Sambucexport LANGUAGE
12811be35a1SLionel Sambuc
12911be35a1SLionel Sambuc# CDPATH.
13011be35a1SLionel Sambuc(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
13111be35a1SLionel Sambuc
13211be35a1SLionel Sambucif test "x$CONFIG_SHELL" = x; then
13311be35a1SLionel Sambuc  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
13411be35a1SLionel Sambuc  emulate sh
13511be35a1SLionel Sambuc  NULLCMD=:
13611be35a1SLionel Sambuc  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
13711be35a1SLionel Sambuc  # is contrary to our usage.  Disable this feature.
13811be35a1SLionel Sambuc  alias -g '\${1+\"\$@\"}'='\"\$@\"'
13911be35a1SLionel Sambuc  setopt NO_GLOB_SUBST
14011be35a1SLionel Sambucelse
14111be35a1SLionel Sambuc  case \`(set -o) 2>/dev/null\` in #(
14211be35a1SLionel Sambuc  *posix*) :
14311be35a1SLionel Sambuc    set -o posix ;; #(
14411be35a1SLionel Sambuc  *) :
14511be35a1SLionel Sambuc     ;;
14611be35a1SLionel Sambucesac
14711be35a1SLionel Sambucfi
14811be35a1SLionel Sambuc"
14911be35a1SLionel Sambuc  as_required="as_fn_return () { (exit \$1); }
15011be35a1SLionel Sambucas_fn_success () { as_fn_return 0; }
15111be35a1SLionel Sambucas_fn_failure () { as_fn_return 1; }
15211be35a1SLionel Sambucas_fn_ret_success () { return 0; }
15311be35a1SLionel Sambucas_fn_ret_failure () { return 1; }
15411be35a1SLionel Sambuc
15511be35a1SLionel Sambucexitcode=0
15611be35a1SLionel Sambucas_fn_success || { exitcode=1; echo as_fn_success failed.; }
15711be35a1SLionel Sambucas_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
15811be35a1SLionel Sambucas_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
15911be35a1SLionel Sambucas_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
16011be35a1SLionel Sambucif ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
16111be35a1SLionel Sambuc
16211be35a1SLionel Sambucelse
16311be35a1SLionel Sambuc  exitcode=1; echo positional parameters were not saved.
16411be35a1SLionel Sambucfi
16511be35a1SLionel Sambuctest x\$exitcode = x0 || exit 1
16611be35a1SLionel Sambuctest -x / || exit 1"
16711be35a1SLionel Sambuc  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
16811be35a1SLionel Sambuc  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
16911be35a1SLionel Sambuc  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
17011be35a1SLionel Sambuc  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
17111be35a1SLionel Sambuctest \$(( 1 + 1 )) = 2 || exit 1"
17211be35a1SLionel Sambuc  if (eval "$as_required") 2>/dev/null; then :
17311be35a1SLionel Sambuc  as_have_required=yes
17411be35a1SLionel Sambucelse
17511be35a1SLionel Sambuc  as_have_required=no
17611be35a1SLionel Sambucfi
17711be35a1SLionel Sambuc  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
17811be35a1SLionel Sambuc
17911be35a1SLionel Sambucelse
18011be35a1SLionel Sambuc  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
18111be35a1SLionel Sambucas_found=false
18211be35a1SLionel Sambucfor as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
18311be35a1SLionel Sambucdo
18411be35a1SLionel Sambuc  IFS=$as_save_IFS
18511be35a1SLionel Sambuc  test -z "$as_dir" && as_dir=.
18611be35a1SLionel Sambuc  as_found=:
18711be35a1SLionel Sambuc  case $as_dir in #(
18811be35a1SLionel Sambuc	 /*)
18911be35a1SLionel Sambuc	   for as_base in sh bash ksh sh5; do
19011be35a1SLionel Sambuc	     # Try only shells that exist, to save several forks.
19111be35a1SLionel Sambuc	     as_shell=$as_dir/$as_base
19211be35a1SLionel Sambuc	     if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
19311be35a1SLionel Sambuc		    { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
19411be35a1SLionel Sambuc  CONFIG_SHELL=$as_shell as_have_required=yes
19511be35a1SLionel Sambuc		   if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
19611be35a1SLionel Sambuc  break 2
19711be35a1SLionel Sambucfi
19811be35a1SLionel Sambucfi
19911be35a1SLionel Sambuc	   done;;
20011be35a1SLionel Sambuc       esac
20111be35a1SLionel Sambuc  as_found=false
20211be35a1SLionel Sambucdone
20311be35a1SLionel Sambuc$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
20411be35a1SLionel Sambuc	      { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
20511be35a1SLionel Sambuc  CONFIG_SHELL=$SHELL as_have_required=yes
20611be35a1SLionel Sambucfi; }
20711be35a1SLionel SambucIFS=$as_save_IFS
20811be35a1SLionel Sambuc
20911be35a1SLionel Sambuc
21011be35a1SLionel Sambuc      if test "x$CONFIG_SHELL" != x; then :
21111be35a1SLionel Sambuc  export CONFIG_SHELL
21211be35a1SLionel Sambuc             # We cannot yet assume a decent shell, so we have to provide a
21311be35a1SLionel Sambuc# neutralization value for shells without unset; and this also
21411be35a1SLionel Sambuc# works around shells that cannot unset nonexistent variables.
21511be35a1SLionel Sambuc# Preserve -v and -x to the replacement shell.
21611be35a1SLionel SambucBASH_ENV=/dev/null
21711be35a1SLionel SambucENV=/dev/null
21811be35a1SLionel Sambuc(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
21911be35a1SLionel Sambuccase $- in # ((((
22011be35a1SLionel Sambuc  *v*x* | *x*v* ) as_opts=-vx ;;
22111be35a1SLionel Sambuc  *v* ) as_opts=-v ;;
22211be35a1SLionel Sambuc  *x* ) as_opts=-x ;;
22311be35a1SLionel Sambuc  * ) as_opts= ;;
22411be35a1SLionel Sambucesac
22511be35a1SLionel Sambucexec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
22611be35a1SLionel Sambuc# Admittedly, this is quite paranoid, since all the known shells bail
22711be35a1SLionel Sambuc# out after a failed `exec'.
22811be35a1SLionel Sambuc$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
22911be35a1SLionel Sambucexit 255
23011be35a1SLionel Sambucfi
23111be35a1SLionel Sambuc
23211be35a1SLionel Sambuc    if test x$as_have_required = xno; then :
23311be35a1SLionel Sambuc  $as_echo "$0: This script requires a shell more modern than all"
23411be35a1SLionel Sambuc  $as_echo "$0: the shells that I found on your system."
23511be35a1SLionel Sambuc  if test x${ZSH_VERSION+set} = xset ; then
23611be35a1SLionel Sambuc    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
23711be35a1SLionel Sambuc    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
23811be35a1SLionel Sambuc  else
23911be35a1SLionel Sambuc    $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
24011be35a1SLionel Sambuc$0: including any error possibly output before this
24111be35a1SLionel Sambuc$0: message. Then install a modern shell, or manually run
24211be35a1SLionel Sambuc$0: the script under such a shell if you do have one."
24311be35a1SLionel Sambuc  fi
24411be35a1SLionel Sambuc  exit 1
24511be35a1SLionel Sambucfi
24611be35a1SLionel Sambucfi
24711be35a1SLionel Sambucfi
24811be35a1SLionel SambucSHELL=${CONFIG_SHELL-/bin/sh}
24911be35a1SLionel Sambucexport SHELL
25011be35a1SLionel Sambuc# Unset more variables known to interfere with behavior of common tools.
25111be35a1SLionel SambucCLICOLOR_FORCE= GREP_OPTIONS=
25211be35a1SLionel Sambucunset CLICOLOR_FORCE GREP_OPTIONS
25311be35a1SLionel Sambuc
25411be35a1SLionel Sambuc## --------------------- ##
25511be35a1SLionel Sambuc## M4sh Shell Functions. ##
25611be35a1SLionel Sambuc## --------------------- ##
25711be35a1SLionel Sambuc# as_fn_unset VAR
25811be35a1SLionel Sambuc# ---------------
25911be35a1SLionel Sambuc# Portably unset VAR.
26011be35a1SLionel Sambucas_fn_unset ()
26111be35a1SLionel Sambuc{
26211be35a1SLionel Sambuc  { eval $1=; unset $1;}
26311be35a1SLionel Sambuc}
26411be35a1SLionel Sambucas_unset=as_fn_unset
26511be35a1SLionel Sambuc
26611be35a1SLionel Sambuc# as_fn_set_status STATUS
26711be35a1SLionel Sambuc# -----------------------
26811be35a1SLionel Sambuc# Set $? to STATUS, without forking.
26911be35a1SLionel Sambucas_fn_set_status ()
27011be35a1SLionel Sambuc{
27111be35a1SLionel Sambuc  return $1
27211be35a1SLionel Sambuc} # as_fn_set_status
27311be35a1SLionel Sambuc
27411be35a1SLionel Sambuc# as_fn_exit STATUS
27511be35a1SLionel Sambuc# -----------------
27611be35a1SLionel Sambuc# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
27711be35a1SLionel Sambucas_fn_exit ()
27811be35a1SLionel Sambuc{
27911be35a1SLionel Sambuc  set +e
28011be35a1SLionel Sambuc  as_fn_set_status $1
28111be35a1SLionel Sambuc  exit $1
28211be35a1SLionel Sambuc} # as_fn_exit
28311be35a1SLionel Sambuc
28411be35a1SLionel Sambuc# as_fn_mkdir_p
28511be35a1SLionel Sambuc# -------------
28611be35a1SLionel Sambuc# Create "$as_dir" as a directory, including parents if necessary.
28711be35a1SLionel Sambucas_fn_mkdir_p ()
28811be35a1SLionel Sambuc{
28911be35a1SLionel Sambuc
29011be35a1SLionel Sambuc  case $as_dir in #(
29111be35a1SLionel Sambuc  -*) as_dir=./$as_dir;;
29211be35a1SLionel Sambuc  esac
29311be35a1SLionel Sambuc  test -d "$as_dir" || eval $as_mkdir_p || {
29411be35a1SLionel Sambuc    as_dirs=
29511be35a1SLionel Sambuc    while :; do
29611be35a1SLionel Sambuc      case $as_dir in #(
29711be35a1SLionel Sambuc      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
29811be35a1SLionel Sambuc      *) as_qdir=$as_dir;;
29911be35a1SLionel Sambuc      esac
30011be35a1SLionel Sambuc      as_dirs="'$as_qdir' $as_dirs"
30111be35a1SLionel Sambuc      as_dir=`$as_dirname -- "$as_dir" ||
30211be35a1SLionel Sambuc$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
30311be35a1SLionel Sambuc	 X"$as_dir" : 'X\(//\)[^/]' \| \
30411be35a1SLionel Sambuc	 X"$as_dir" : 'X\(//\)$' \| \
30511be35a1SLionel Sambuc	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
30611be35a1SLionel Sambuc$as_echo X"$as_dir" |
30711be35a1SLionel Sambuc    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
30811be35a1SLionel Sambuc	    s//\1/
30911be35a1SLionel Sambuc	    q
31011be35a1SLionel Sambuc	  }
31111be35a1SLionel Sambuc	  /^X\(\/\/\)[^/].*/{
31211be35a1SLionel Sambuc	    s//\1/
31311be35a1SLionel Sambuc	    q
31411be35a1SLionel Sambuc	  }
31511be35a1SLionel Sambuc	  /^X\(\/\/\)$/{
31611be35a1SLionel Sambuc	    s//\1/
31711be35a1SLionel Sambuc	    q
31811be35a1SLionel Sambuc	  }
31911be35a1SLionel Sambuc	  /^X\(\/\).*/{
32011be35a1SLionel Sambuc	    s//\1/
32111be35a1SLionel Sambuc	    q
32211be35a1SLionel Sambuc	  }
32311be35a1SLionel Sambuc	  s/.*/./; q'`
32411be35a1SLionel Sambuc      test -d "$as_dir" && break
32511be35a1SLionel Sambuc    done
32611be35a1SLionel Sambuc    test -z "$as_dirs" || eval "mkdir $as_dirs"
32711be35a1SLionel Sambuc  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
32811be35a1SLionel Sambuc
32911be35a1SLionel Sambuc
33011be35a1SLionel Sambuc} # as_fn_mkdir_p
33111be35a1SLionel Sambuc
33211be35a1SLionel Sambuc# as_fn_executable_p FILE
33311be35a1SLionel Sambuc# -----------------------
33411be35a1SLionel Sambuc# Test if FILE is an executable regular file.
33511be35a1SLionel Sambucas_fn_executable_p ()
33611be35a1SLionel Sambuc{
33711be35a1SLionel Sambuc  test -f "$1" && test -x "$1"
33811be35a1SLionel Sambuc} # as_fn_executable_p
33911be35a1SLionel Sambuc# as_fn_append VAR VALUE
34011be35a1SLionel Sambuc# ----------------------
34111be35a1SLionel Sambuc# Append the text in VALUE to the end of the definition contained in VAR. Take
34211be35a1SLionel Sambuc# advantage of any shell optimizations that allow amortized linear growth over
34311be35a1SLionel Sambuc# repeated appends, instead of the typical quadratic growth present in naive
34411be35a1SLionel Sambuc# implementations.
34511be35a1SLionel Sambucif (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
34611be35a1SLionel Sambuc  eval 'as_fn_append ()
34711be35a1SLionel Sambuc  {
34811be35a1SLionel Sambuc    eval $1+=\$2
34911be35a1SLionel Sambuc  }'
35011be35a1SLionel Sambucelse
35111be35a1SLionel Sambuc  as_fn_append ()
35211be35a1SLionel Sambuc  {
35311be35a1SLionel Sambuc    eval $1=\$$1\$2
35411be35a1SLionel Sambuc  }
35511be35a1SLionel Sambucfi # as_fn_append
35611be35a1SLionel Sambuc
35711be35a1SLionel Sambuc# as_fn_arith ARG...
35811be35a1SLionel Sambuc# ------------------
35911be35a1SLionel Sambuc# Perform arithmetic evaluation on the ARGs, and store the result in the
36011be35a1SLionel Sambuc# global $as_val. Take advantage of shells that can avoid forks. The arguments
36111be35a1SLionel Sambuc# must be portable across $(()) and expr.
36211be35a1SLionel Sambucif (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
36311be35a1SLionel Sambuc  eval 'as_fn_arith ()
36411be35a1SLionel Sambuc  {
36511be35a1SLionel Sambuc    as_val=$(( $* ))
36611be35a1SLionel Sambuc  }'
36711be35a1SLionel Sambucelse
36811be35a1SLionel Sambuc  as_fn_arith ()
36911be35a1SLionel Sambuc  {
37011be35a1SLionel Sambuc    as_val=`expr "$@" || test $? -eq 1`
37111be35a1SLionel Sambuc  }
37211be35a1SLionel Sambucfi # as_fn_arith
37311be35a1SLionel Sambuc
37411be35a1SLionel Sambuc
37511be35a1SLionel Sambuc# as_fn_error STATUS ERROR [LINENO LOG_FD]
37611be35a1SLionel Sambuc# ----------------------------------------
37711be35a1SLionel Sambuc# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
37811be35a1SLionel Sambuc# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
37911be35a1SLionel Sambuc# script with STATUS, using 1 if that was 0.
38011be35a1SLionel Sambucas_fn_error ()
38111be35a1SLionel Sambuc{
38211be35a1SLionel Sambuc  as_status=$1; test $as_status -eq 0 && as_status=1
38311be35a1SLionel Sambuc  if test "$4"; then
38411be35a1SLionel Sambuc    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
38511be35a1SLionel Sambuc    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
38611be35a1SLionel Sambuc  fi
38711be35a1SLionel Sambuc  $as_echo "$as_me: error: $2" >&2
38811be35a1SLionel Sambuc  as_fn_exit $as_status
38911be35a1SLionel Sambuc} # as_fn_error
39011be35a1SLionel Sambuc
39111be35a1SLionel Sambucif expr a : '\(a\)' >/dev/null 2>&1 &&
39211be35a1SLionel Sambuc   test "X`expr 00001 : '.*\(...\)'`" = X001; then
39311be35a1SLionel Sambuc  as_expr=expr
39411be35a1SLionel Sambucelse
39511be35a1SLionel Sambuc  as_expr=false
39611be35a1SLionel Sambucfi
39711be35a1SLionel Sambuc
39811be35a1SLionel Sambucif (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
39911be35a1SLionel Sambuc  as_basename=basename
40011be35a1SLionel Sambucelse
40111be35a1SLionel Sambuc  as_basename=false
40211be35a1SLionel Sambucfi
40311be35a1SLionel Sambuc
40411be35a1SLionel Sambucas_me=`$as_basename -- "$0" ||
40511be35a1SLionel Sambuc$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
40611be35a1SLionel Sambuc	 X"$0" : 'X\(//\)$' \| \
40711be35a1SLionel Sambuc	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
40811be35a1SLionel Sambuc$as_echo X/"$0" |
40911be35a1SLionel Sambuc    sed '/^.*\/\([^/][^/]*\)\/*$/{
41011be35a1SLionel Sambuc	    s//\1/
41111be35a1SLionel Sambuc	    q
41211be35a1SLionel Sambuc	  }
41311be35a1SLionel Sambuc	  /^X\/\(\/\/\)$/{
41411be35a1SLionel Sambuc	    s//\1/
41511be35a1SLionel Sambuc	    q
41611be35a1SLionel Sambuc	  }
41711be35a1SLionel Sambuc	  /^X\/\(\/\).*/{
41811be35a1SLionel Sambuc	    s//\1/
41911be35a1SLionel Sambuc	    q
42011be35a1SLionel Sambuc	  }
42111be35a1SLionel Sambuc	  s/.*/./; q'`
42211be35a1SLionel Sambuc
42311be35a1SLionel Sambucif (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
42411be35a1SLionel Sambuc  as_dirname=dirname
42511be35a1SLionel Sambucelse
42611be35a1SLionel Sambuc  as_dirname=false
42711be35a1SLionel Sambucfi
42811be35a1SLionel Sambuc
42911be35a1SLionel Sambuc# Avoid depending upon Character Ranges.
43011be35a1SLionel Sambucas_cr_letters='abcdefghijklmnopqrstuvwxyz'
43111be35a1SLionel Sambucas_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
43211be35a1SLionel Sambucas_cr_Letters=$as_cr_letters$as_cr_LETTERS
43311be35a1SLionel Sambucas_cr_digits='0123456789'
43411be35a1SLionel Sambucas_cr_alnum=$as_cr_Letters$as_cr_digits
43511be35a1SLionel Sambuc
43611be35a1SLionel Sambuc
43711be35a1SLionel Sambuc  as_lineno_1=$LINENO as_lineno_1a=$LINENO
43811be35a1SLionel Sambuc  as_lineno_2=$LINENO as_lineno_2a=$LINENO
43911be35a1SLionel Sambuc  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
44011be35a1SLionel Sambuc  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
44111be35a1SLionel Sambuc  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
44211be35a1SLionel Sambuc  sed -n '
44311be35a1SLionel Sambuc    p
44411be35a1SLionel Sambuc    /[$]LINENO/=
44511be35a1SLionel Sambuc  ' <$as_myself |
44611be35a1SLionel Sambuc    sed '
44711be35a1SLionel Sambuc      s/[$]LINENO.*/&-/
44811be35a1SLionel Sambuc      t lineno
44911be35a1SLionel Sambuc      b
45011be35a1SLionel Sambuc      :lineno
45111be35a1SLionel Sambuc      N
45211be35a1SLionel Sambuc      :loop
45311be35a1SLionel Sambuc      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
45411be35a1SLionel Sambuc      t loop
45511be35a1SLionel Sambuc      s/-\n.*//
45611be35a1SLionel Sambuc    ' >$as_me.lineno &&
45711be35a1SLionel Sambuc  chmod +x "$as_me.lineno" ||
45811be35a1SLionel Sambuc    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
45911be35a1SLionel Sambuc
46011be35a1SLionel Sambuc  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
46111be35a1SLionel Sambuc  # already done that, so ensure we don't try to do so again and fall
46211be35a1SLionel Sambuc  # in an infinite loop.  This has already happened in practice.
46311be35a1SLionel Sambuc  _as_can_reexec=no; export _as_can_reexec
46411be35a1SLionel Sambuc  # Don't try to exec as it changes $[0], causing all sort of problems
46511be35a1SLionel Sambuc  # (the dirname of $[0] is not the place where we might find the
46611be35a1SLionel Sambuc  # original and so on.  Autoconf is especially sensitive to this).
46711be35a1SLionel Sambuc  . "./$as_me.lineno"
46811be35a1SLionel Sambuc  # Exit status is that of the last command.
46911be35a1SLionel Sambuc  exit
47011be35a1SLionel Sambuc}
47111be35a1SLionel Sambuc
47211be35a1SLionel SambucECHO_C= ECHO_N= ECHO_T=
47311be35a1SLionel Sambuccase `echo -n x` in #(((((
47411be35a1SLionel Sambuc-n*)
47511be35a1SLionel Sambuc  case `echo 'xy\c'` in
47611be35a1SLionel Sambuc  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
47711be35a1SLionel Sambuc  xy)  ECHO_C='\c';;
47811be35a1SLionel Sambuc  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
47911be35a1SLionel Sambuc       ECHO_T='	';;
48011be35a1SLionel Sambuc  esac;;
48111be35a1SLionel Sambuc*)
48211be35a1SLionel Sambuc  ECHO_N='-n';;
48311be35a1SLionel Sambucesac
48411be35a1SLionel Sambuc
48511be35a1SLionel Sambucrm -f conf$$ conf$$.exe conf$$.file
48611be35a1SLionel Sambucif test -d conf$$.dir; then
48711be35a1SLionel Sambuc  rm -f conf$$.dir/conf$$.file
48811be35a1SLionel Sambucelse
48911be35a1SLionel Sambuc  rm -f conf$$.dir
49011be35a1SLionel Sambuc  mkdir conf$$.dir 2>/dev/null
49111be35a1SLionel Sambucfi
49211be35a1SLionel Sambucif (echo >conf$$.file) 2>/dev/null; then
49311be35a1SLionel Sambuc  if ln -s conf$$.file conf$$ 2>/dev/null; then
49411be35a1SLionel Sambuc    as_ln_s='ln -s'
49511be35a1SLionel Sambuc    # ... but there are two gotchas:
49611be35a1SLionel Sambuc    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
49711be35a1SLionel Sambuc    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
49811be35a1SLionel Sambuc    # In both cases, we have to default to `cp -pR'.
49911be35a1SLionel Sambuc    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
50011be35a1SLionel Sambuc      as_ln_s='cp -pR'
50111be35a1SLionel Sambuc  elif ln conf$$.file conf$$ 2>/dev/null; then
50211be35a1SLionel Sambuc    as_ln_s=ln
50311be35a1SLionel Sambuc  else
50411be35a1SLionel Sambuc    as_ln_s='cp -pR'
50511be35a1SLionel Sambuc  fi
50611be35a1SLionel Sambucelse
50711be35a1SLionel Sambuc  as_ln_s='cp -pR'
50811be35a1SLionel Sambucfi
50911be35a1SLionel Sambucrm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
51011be35a1SLionel Sambucrmdir conf$$.dir 2>/dev/null
51111be35a1SLionel Sambuc
51211be35a1SLionel Sambucif mkdir -p . 2>/dev/null; then
51311be35a1SLionel Sambuc  as_mkdir_p='mkdir -p "$as_dir"'
51411be35a1SLionel Sambucelse
51511be35a1SLionel Sambuc  test -d ./-p && rmdir ./-p
51611be35a1SLionel Sambuc  as_mkdir_p=false
51711be35a1SLionel Sambucfi
51811be35a1SLionel Sambuc
51911be35a1SLionel Sambucas_test_x='test -x'
52011be35a1SLionel Sambucas_executable_p=as_fn_executable_p
52111be35a1SLionel Sambuc
52211be35a1SLionel Sambuc# Sed expression to map a string onto a valid CPP name.
52311be35a1SLionel Sambucas_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
52411be35a1SLionel Sambuc
52511be35a1SLionel Sambuc# Sed expression to map a string onto a valid variable name.
52611be35a1SLionel Sambucas_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
52711be35a1SLionel Sambuc
52811be35a1SLionel Sambuc
52911be35a1SLionel Sambuc
53011be35a1SLionel Sambuc
53111be35a1SLionel Sambuc
53211be35a1SLionel SambucSHELL=${CONFIG_SHELL-/bin/sh}
53311be35a1SLionel Sambuc
53411be35a1SLionel Sambuc# How were we run?
53511be35a1SLionel Sambucat_cli_args="$@"
53611be35a1SLionel Sambuc
53711be35a1SLionel Sambuc
53811be35a1SLionel Sambuc# Not all shells have the 'times' builtin; the subshell is needed to make
53911be35a1SLionel Sambuc# sure we discard the 'times: not found' message from the shell.
54011be35a1SLionel Sambucat_times_p=false
54111be35a1SLionel Sambuc(times) >/dev/null 2>&1 && at_times_p=:
54211be35a1SLionel Sambuc
54311be35a1SLionel Sambuc# CLI Arguments to pass to the debugging scripts.
54411be35a1SLionel Sambucat_debug_args=
54511be35a1SLionel Sambuc# -e sets to true
54611be35a1SLionel Sambucat_errexit_p=false
54711be35a1SLionel Sambuc# Shall we be verbose?  ':' means no, empty means yes.
54811be35a1SLionel Sambucat_verbose=:
54911be35a1SLionel Sambucat_quiet=
55011be35a1SLionel Sambuc# Running several jobs in parallel, 0 means as many as test groups.
55111be35a1SLionel Sambucat_jobs=1
55211be35a1SLionel Sambucat_traceon=:
55311be35a1SLionel Sambucat_trace_echo=:
55411be35a1SLionel Sambucat_check_filter_trace=:
55511be35a1SLionel Sambuc
55611be35a1SLionel Sambuc# Shall we keep the debug scripts?  Must be `:' when the suite is
55711be35a1SLionel Sambuc# run by a debug script, so that the script doesn't remove itself.
55811be35a1SLionel Sambucat_debug_p=false
55911be35a1SLionel Sambuc# Display help message?
56011be35a1SLionel Sambucat_help_p=false
56111be35a1SLionel Sambuc# Display the version message?
56211be35a1SLionel Sambucat_version_p=false
56311be35a1SLionel Sambuc# List test groups?
56411be35a1SLionel Sambucat_list_p=false
56511be35a1SLionel Sambuc# --clean
56611be35a1SLionel Sambucat_clean=false
56711be35a1SLionel Sambuc# Test groups to run
56811be35a1SLionel Sambucat_groups=
56911be35a1SLionel Sambuc# Whether to rerun failed tests.
57011be35a1SLionel Sambucat_recheck=
57111be35a1SLionel Sambuc# Whether a write failure occurred
57211be35a1SLionel Sambucat_write_fail=0
57311be35a1SLionel Sambuc
57411be35a1SLionel Sambuc# The directory we run the suite in.  Default to . if no -C option.
57511be35a1SLionel Sambucat_dir=`pwd`
57611be35a1SLionel Sambuc# An absolute reference to this testsuite script.
57711be35a1SLionel Sambuccase $as_myself in
57811be35a1SLionel Sambuc  [\\/]* | ?:[\\/]* ) at_myself=$as_myself ;;
57911be35a1SLionel Sambuc  * ) at_myself=$at_dir/$as_myself ;;
58011be35a1SLionel Sambucesac
58111be35a1SLionel Sambuc# Whether -C is in effect.
58211be35a1SLionel Sambucat_change_dir=false
58311be35a1SLionel Sambuc
58411be35a1SLionel Sambuc# Whether to enable colored test results.
58511be35a1SLionel Sambucat_color=no
58611be35a1SLionel Sambuc# List of the tested programs.
58711be35a1SLionel Sambucat_tested='kyua'
58811be35a1SLionel Sambuc# As many question marks as there are digits in the last test group number.
58911be35a1SLionel Sambuc# Used to normalize the test group numbers so that `ls' lists them in
59011be35a1SLionel Sambuc# numerical order.
59111be35a1SLionel Sambucat_format='??'
59211be35a1SLionel Sambuc# Description of all the test groups.
59311be35a1SLionel Sambucat_help_all="1;testsuite.at:70;test program crashes in test list;;
59411be35a1SLionel Sambuc2;testsuite.at:81;test program prints an empty test list;;
59511be35a1SLionel Sambuc3;testsuite.at:92;test program with zero test cases;;
59611be35a1SLionel Sambuc4;testsuite.at:103;run test case that passes;;
59711be35a1SLionel Sambuc5;testsuite.at:115;run test case that fails;;
59811be35a1SLionel Sambuc6;testsuite.at:128;run test case that skips;;
59911be35a1SLionel Sambuc7;testsuite.at:141;run two test cases, success;;
60011be35a1SLionel Sambuc8;testsuite.at:154;run two test cases, failure;;
60111be35a1SLionel Sambuc9;testsuite.at:167;run mixed test cases;;
60211be35a1SLionel Sambuc10;testsuite.at:181;run tests from build directories;;
60311be35a1SLionel Sambuc"
60411be35a1SLionel Sambuc# List of the all the test groups.
60511be35a1SLionel Sambucat_groups_all=`$as_echo "$at_help_all" | sed 's/;.*//'`
60611be35a1SLionel Sambuc
60711be35a1SLionel Sambuc# at_fn_validate_ranges NAME...
60811be35a1SLionel Sambuc# -----------------------------
60911be35a1SLionel Sambuc# Validate and normalize the test group number contained in each variable
61011be35a1SLionel Sambuc# NAME. Leading zeroes are treated as decimal.
61111be35a1SLionel Sambucat_fn_validate_ranges ()
61211be35a1SLionel Sambuc{
61311be35a1SLionel Sambuc  for at_grp
61411be35a1SLionel Sambuc  do
61511be35a1SLionel Sambuc    eval at_value=\$$at_grp
61611be35a1SLionel Sambuc    if test $at_value -lt 1 || test $at_value -gt 10; then
61711be35a1SLionel Sambuc      $as_echo "invalid test group: $at_value" >&2
61811be35a1SLionel Sambuc      exit 1
61911be35a1SLionel Sambuc    fi
62011be35a1SLionel Sambuc    case $at_value in
62111be35a1SLionel Sambuc      0*) # We want to treat leading 0 as decimal, like expr and test, but
62211be35a1SLionel Sambuc	  # AS_VAR_ARITH treats it as octal if it uses $(( )).
62311be35a1SLionel Sambuc	  # With XSI shells, ${at_value#${at_value%%[1-9]*}} avoids the
62411be35a1SLionel Sambuc	  # expr fork, but it is not worth the effort to determine if the
62511be35a1SLionel Sambuc	  # shell supports XSI when the user can just avoid leading 0.
62611be35a1SLionel Sambuc	  eval $at_grp='`expr $at_value + 0`' ;;
62711be35a1SLionel Sambuc    esac
62811be35a1SLionel Sambuc  done
62911be35a1SLionel Sambuc}
63011be35a1SLionel Sambuc
63111be35a1SLionel Sambucat_prev=
63211be35a1SLionel Sambucfor at_option
63311be35a1SLionel Sambucdo
63411be35a1SLionel Sambuc  # If the previous option needs an argument, assign it.
63511be35a1SLionel Sambuc  if test -n "$at_prev"; then
63611be35a1SLionel Sambuc    at_option=$at_prev=$at_option
63711be35a1SLionel Sambuc    at_prev=
63811be35a1SLionel Sambuc  fi
63911be35a1SLionel Sambuc
64011be35a1SLionel Sambuc  case $at_option in
64111be35a1SLionel Sambuc  *=?*) at_optarg=`expr "X$at_option" : '[^=]*=\(.*\)'` ;;
64211be35a1SLionel Sambuc  *)    at_optarg= ;;
64311be35a1SLionel Sambuc  esac
64411be35a1SLionel Sambuc
64511be35a1SLionel Sambuc  # Accept the important Cygnus configure options, so we can diagnose typos.
64611be35a1SLionel Sambuc
64711be35a1SLionel Sambuc  case $at_option in
64811be35a1SLionel Sambuc    --help | -h )
64911be35a1SLionel Sambuc	at_help_p=:
65011be35a1SLionel Sambuc	;;
65111be35a1SLionel Sambuc
65211be35a1SLionel Sambuc    --list | -l )
65311be35a1SLionel Sambuc	at_list_p=:
65411be35a1SLionel Sambuc	;;
65511be35a1SLionel Sambuc
65611be35a1SLionel Sambuc    --version | -V )
65711be35a1SLionel Sambuc	at_version_p=:
65811be35a1SLionel Sambuc	;;
65911be35a1SLionel Sambuc
66011be35a1SLionel Sambuc    --clean | -c )
66111be35a1SLionel Sambuc	at_clean=:
66211be35a1SLionel Sambuc	;;
66311be35a1SLionel Sambuc
66411be35a1SLionel Sambuc    --color )
66511be35a1SLionel Sambuc	at_color=always
66611be35a1SLionel Sambuc	;;
66711be35a1SLionel Sambuc    --color=* )
66811be35a1SLionel Sambuc	case $at_optarg in
66911be35a1SLionel Sambuc	no | never | none) at_color=never ;;
67011be35a1SLionel Sambuc	auto | tty | if-tty) at_color=auto ;;
67111be35a1SLionel Sambuc	always | yes | force) at_color=always ;;
67211be35a1SLionel Sambuc	*) at_optname=`echo " $at_option" | sed 's/^ //; s/=.*//'`
67311be35a1SLionel Sambuc	   as_fn_error $? "unrecognized argument to $at_optname: $at_optarg" ;;
67411be35a1SLionel Sambuc	esac
67511be35a1SLionel Sambuc	;;
67611be35a1SLionel Sambuc
67711be35a1SLionel Sambuc    --debug | -d )
67811be35a1SLionel Sambuc	at_debug_p=:
67911be35a1SLionel Sambuc	;;
68011be35a1SLionel Sambuc
68111be35a1SLionel Sambuc    --errexit | -e )
68211be35a1SLionel Sambuc	at_debug_p=:
68311be35a1SLionel Sambuc	at_errexit_p=:
68411be35a1SLionel Sambuc	;;
68511be35a1SLionel Sambuc
68611be35a1SLionel Sambuc    --verbose | -v )
68711be35a1SLionel Sambuc	at_verbose=; at_quiet=:
68811be35a1SLionel Sambuc	;;
68911be35a1SLionel Sambuc
69011be35a1SLionel Sambuc    --trace | -x )
69111be35a1SLionel Sambuc	at_traceon='set -x'
69211be35a1SLionel Sambuc	at_trace_echo=echo
69311be35a1SLionel Sambuc	at_check_filter_trace=at_fn_filter_trace
69411be35a1SLionel Sambuc	;;
69511be35a1SLionel Sambuc
69611be35a1SLionel Sambuc    [0-9] | [0-9][0-9] | [0-9][0-9][0-9] | [0-9][0-9][0-9][0-9])
69711be35a1SLionel Sambuc	at_fn_validate_ranges at_option
69811be35a1SLionel Sambuc	as_fn_append at_groups "$at_option$as_nl"
69911be35a1SLionel Sambuc	;;
70011be35a1SLionel Sambuc
70111be35a1SLionel Sambuc    # Ranges
70211be35a1SLionel Sambuc    [0-9]- | [0-9][0-9]- | [0-9][0-9][0-9]- | [0-9][0-9][0-9][0-9]-)
70311be35a1SLionel Sambuc	at_range_start=`echo $at_option |tr -d X-`
70411be35a1SLionel Sambuc	at_fn_validate_ranges at_range_start
70511be35a1SLionel Sambuc	at_range=`$as_echo "$at_groups_all" | \
70611be35a1SLionel Sambuc	  sed -ne '/^'$at_range_start'$/,$p'`
70711be35a1SLionel Sambuc	as_fn_append at_groups "$at_range$as_nl"
70811be35a1SLionel Sambuc	;;
70911be35a1SLionel Sambuc
71011be35a1SLionel Sambuc    -[0-9] | -[0-9][0-9] | -[0-9][0-9][0-9] | -[0-9][0-9][0-9][0-9])
71111be35a1SLionel Sambuc	at_range_end=`echo $at_option |tr -d X-`
71211be35a1SLionel Sambuc	at_fn_validate_ranges at_range_end
71311be35a1SLionel Sambuc	at_range=`$as_echo "$at_groups_all" | \
71411be35a1SLionel Sambuc	  sed -ne '1,/^'$at_range_end'$/p'`
71511be35a1SLionel Sambuc	as_fn_append at_groups "$at_range$as_nl"
71611be35a1SLionel Sambuc	;;
71711be35a1SLionel Sambuc
71811be35a1SLionel Sambuc    [0-9]-[0-9] | [0-9]-[0-9][0-9] | [0-9]-[0-9][0-9][0-9] | \
71911be35a1SLionel Sambuc    [0-9]-[0-9][0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9] | \
72011be35a1SLionel Sambuc    [0-9][0-9]-[0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9][0-9][0-9] | \
72111be35a1SLionel Sambuc    [0-9][0-9][0-9]-[0-9][0-9][0-9] | \
72211be35a1SLionel Sambuc    [0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] | \
72311be35a1SLionel Sambuc    [0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] )
72411be35a1SLionel Sambuc	at_range_start=`expr $at_option : '\(.*\)-'`
72511be35a1SLionel Sambuc	at_range_end=`expr $at_option : '.*-\(.*\)'`
72611be35a1SLionel Sambuc	if test $at_range_start -gt $at_range_end; then
72711be35a1SLionel Sambuc	  at_tmp=$at_range_end
72811be35a1SLionel Sambuc	  at_range_end=$at_range_start
72911be35a1SLionel Sambuc	  at_range_start=$at_tmp
73011be35a1SLionel Sambuc	fi
73111be35a1SLionel Sambuc	at_fn_validate_ranges at_range_start at_range_end
73211be35a1SLionel Sambuc	at_range=`$as_echo "$at_groups_all" | \
73311be35a1SLionel Sambuc	  sed -ne '/^'$at_range_start'$/,/^'$at_range_end'$/p'`
73411be35a1SLionel Sambuc	as_fn_append at_groups "$at_range$as_nl"
73511be35a1SLionel Sambuc	;;
73611be35a1SLionel Sambuc
73711be35a1SLionel Sambuc    # Directory selection.
73811be35a1SLionel Sambuc    --directory | -C )
73911be35a1SLionel Sambuc	at_prev=--directory
74011be35a1SLionel Sambuc	;;
74111be35a1SLionel Sambuc    --directory=* )
74211be35a1SLionel Sambuc	at_change_dir=:
74311be35a1SLionel Sambuc	at_dir=$at_optarg
74411be35a1SLionel Sambuc	if test x- = "x$at_dir" ; then
74511be35a1SLionel Sambuc	  at_dir=./-
74611be35a1SLionel Sambuc	fi
74711be35a1SLionel Sambuc	;;
74811be35a1SLionel Sambuc
74911be35a1SLionel Sambuc    # Parallel execution.
75011be35a1SLionel Sambuc    --jobs | -j )
75111be35a1SLionel Sambuc	at_jobs=0
75211be35a1SLionel Sambuc	;;
75311be35a1SLionel Sambuc    --jobs=* | -j[0-9]* )
75411be35a1SLionel Sambuc	if test -n "$at_optarg"; then
75511be35a1SLionel Sambuc	  at_jobs=$at_optarg
75611be35a1SLionel Sambuc	else
75711be35a1SLionel Sambuc	  at_jobs=`expr X$at_option : 'X-j\(.*\)'`
75811be35a1SLionel Sambuc	fi
75911be35a1SLionel Sambuc	case $at_jobs in *[!0-9]*)
76011be35a1SLionel Sambuc	  at_optname=`echo " $at_option" | sed 's/^ //; s/[0-9=].*//'`
76111be35a1SLionel Sambuc	  as_fn_error $? "non-numeric argument to $at_optname: $at_jobs" ;;
76211be35a1SLionel Sambuc	esac
76311be35a1SLionel Sambuc	;;
76411be35a1SLionel Sambuc
76511be35a1SLionel Sambuc    # Keywords.
76611be35a1SLionel Sambuc    --keywords | -k )
76711be35a1SLionel Sambuc	at_prev=--keywords
76811be35a1SLionel Sambuc	;;
76911be35a1SLionel Sambuc    --keywords=* )
77011be35a1SLionel Sambuc	at_groups_selected=$at_help_all
77111be35a1SLionel Sambuc	at_save_IFS=$IFS
77211be35a1SLionel Sambuc	IFS=,
77311be35a1SLionel Sambuc	set X $at_optarg
77411be35a1SLionel Sambuc	shift
77511be35a1SLionel Sambuc	IFS=$at_save_IFS
77611be35a1SLionel Sambuc	for at_keyword
77711be35a1SLionel Sambuc	do
77811be35a1SLionel Sambuc	  at_invert=
77911be35a1SLionel Sambuc	  case $at_keyword in
78011be35a1SLionel Sambuc	  '!'*)
78111be35a1SLionel Sambuc	    at_invert="-v"
78211be35a1SLionel Sambuc	    at_keyword=`expr "X$at_keyword" : 'X!\(.*\)'`
78311be35a1SLionel Sambuc	    ;;
78411be35a1SLionel Sambuc	  esac
78511be35a1SLionel Sambuc	  # It is on purpose that we match the test group titles too.
78611be35a1SLionel Sambuc	  at_groups_selected=`$as_echo "$at_groups_selected" |
78711be35a1SLionel Sambuc	      grep -i $at_invert "^[1-9][^;]*;.*[; ]$at_keyword[ ;]"`
78811be35a1SLionel Sambuc	done
78911be35a1SLionel Sambuc	# Smash the keywords.
79011be35a1SLionel Sambuc	at_groups_selected=`$as_echo "$at_groups_selected" | sed 's/;.*//'`
79111be35a1SLionel Sambuc	as_fn_append at_groups "$at_groups_selected$as_nl"
79211be35a1SLionel Sambuc	;;
79311be35a1SLionel Sambuc    --recheck)
79411be35a1SLionel Sambuc	at_recheck=:
79511be35a1SLionel Sambuc	;;
79611be35a1SLionel Sambuc
79711be35a1SLionel Sambuc    *=*)
79811be35a1SLionel Sambuc	at_envvar=`expr "x$at_option" : 'x\([^=]*\)='`
79911be35a1SLionel Sambuc	# Reject names that are not valid shell variable names.
80011be35a1SLionel Sambuc	case $at_envvar in
80111be35a1SLionel Sambuc	  '' | [0-9]* | *[!_$as_cr_alnum]* )
80211be35a1SLionel Sambuc	    as_fn_error $? "invalid variable name: \`$at_envvar'" ;;
80311be35a1SLionel Sambuc	esac
80411be35a1SLionel Sambuc	at_value=`$as_echo "$at_optarg" | sed "s/'/'\\\\\\\\''/g"`
80511be35a1SLionel Sambuc	# Export now, but save eval for later and for debug scripts.
80611be35a1SLionel Sambuc	export $at_envvar
80711be35a1SLionel Sambuc	as_fn_append at_debug_args " $at_envvar='$at_value'"
80811be35a1SLionel Sambuc	;;
80911be35a1SLionel Sambuc
81011be35a1SLionel Sambuc     *) $as_echo "$as_me: invalid option: $at_option" >&2
81111be35a1SLionel Sambuc	$as_echo "Try \`$0 --help' for more information." >&2
81211be35a1SLionel Sambuc	exit 1
81311be35a1SLionel Sambuc	;;
81411be35a1SLionel Sambuc  esac
81511be35a1SLionel Sambucdone
81611be35a1SLionel Sambuc
81711be35a1SLionel Sambuc# Verify our last option didn't require an argument
81811be35a1SLionel Sambucif test -n "$at_prev"; then :
81911be35a1SLionel Sambuc  as_fn_error $? "\`$at_prev' requires an argument"
82011be35a1SLionel Sambucfi
82111be35a1SLionel Sambuc
82211be35a1SLionel Sambuc# The file containing the suite.
82311be35a1SLionel Sambucat_suite_log=$at_dir/$as_me.log
82411be35a1SLionel Sambuc
82511be35a1SLionel Sambuc# Selected test groups.
82611be35a1SLionel Sambucif test -z "$at_groups$at_recheck"; then
82711be35a1SLionel Sambuc  at_groups=$at_groups_all
82811be35a1SLionel Sambucelse
82911be35a1SLionel Sambuc  if test -n "$at_recheck" && test -r "$at_suite_log"; then
83011be35a1SLionel Sambuc    at_oldfails=`sed -n '
83111be35a1SLionel Sambuc      /^Failed tests:$/,/^Skipped tests:$/{
83211be35a1SLionel Sambuc	s/^[ ]*\([1-9][0-9]*\):.*/\1/p
83311be35a1SLionel Sambuc      }
83411be35a1SLionel Sambuc      /^Unexpected passes:$/,/^## Detailed failed tests/{
83511be35a1SLionel Sambuc	s/^[ ]*\([1-9][0-9]*\):.*/\1/p
83611be35a1SLionel Sambuc      }
83711be35a1SLionel Sambuc      /^## Detailed failed tests/q
83811be35a1SLionel Sambuc      ' "$at_suite_log"`
83911be35a1SLionel Sambuc    as_fn_append at_groups "$at_oldfails$as_nl"
84011be35a1SLionel Sambuc  fi
84111be35a1SLionel Sambuc  # Sort the tests, removing duplicates.
84211be35a1SLionel Sambuc  at_groups=`$as_echo "$at_groups" | sort -nu | sed '/^$/d'`
84311be35a1SLionel Sambucfi
84411be35a1SLionel Sambuc
84511be35a1SLionel Sambucif test x"$at_color" = xalways \
84611be35a1SLionel Sambuc   || { test x"$at_color" = xauto && test -t 1; }; then
84711be35a1SLionel Sambuc  at_red=`printf '\033[0;31m'`
84811be35a1SLionel Sambuc  at_grn=`printf '\033[0;32m'`
84911be35a1SLionel Sambuc  at_lgn=`printf '\033[1;32m'`
85011be35a1SLionel Sambuc  at_blu=`printf '\033[1;34m'`
85111be35a1SLionel Sambuc  at_std=`printf '\033[m'`
85211be35a1SLionel Sambucelse
85311be35a1SLionel Sambuc  at_red= at_grn= at_lgn= at_blu= at_std=
85411be35a1SLionel Sambucfi
85511be35a1SLionel Sambuc
85611be35a1SLionel Sambuc# Help message.
85711be35a1SLionel Sambucif $at_help_p; then
85811be35a1SLionel Sambuc  cat <<_ATEOF || at_write_fail=1
85911be35a1SLionel SambucUsage: $0 [OPTION]... [VARIABLE=VALUE]... [TESTS]
86011be35a1SLionel Sambuc
86111be35a1SLionel SambucRun all the tests, or the selected TESTS, given by numeric ranges, and
86211be35a1SLionel Sambucsave a detailed log file.  Upon failure, create debugging scripts.
86311be35a1SLionel Sambuc
86411be35a1SLionel SambucDo not change environment variables directly.  Instead, set them via
86511be35a1SLionel Sambuccommand line arguments.  Set \`AUTOTEST_PATH' to select the executables
86611be35a1SLionel Sambucto exercise.  Each relative directory is expanded as build and source
86711be35a1SLionel Sambucdirectories relative to the top level of this distribution.
86811be35a1SLionel SambucE.g., from within the build directory /tmp/foo-1.0, invoking this:
86911be35a1SLionel Sambuc
87011be35a1SLionel Sambuc  $ $0 AUTOTEST_PATH=bin
87111be35a1SLionel Sambuc
87211be35a1SLionel Sambucis equivalent to the following, assuming the source directory is /src/foo-1.0:
87311be35a1SLionel Sambuc
87411be35a1SLionel Sambuc  PATH=/tmp/foo-1.0/bin:/src/foo-1.0/bin:\$PATH $0
87511be35a1SLionel Sambuc_ATEOF
87611be35a1SLionel Sambuccat <<_ATEOF || at_write_fail=1
87711be35a1SLionel Sambuc
87811be35a1SLionel SambucOperation modes:
87911be35a1SLionel Sambuc  -h, --help     print the help message, then exit
88011be35a1SLionel Sambuc  -V, --version  print version number, then exit
88111be35a1SLionel Sambuc  -c, --clean    remove all the files this test suite might create and exit
88211be35a1SLionel Sambuc  -l, --list     describes all the tests, or the selected TESTS
88311be35a1SLionel Sambuc_ATEOF
88411be35a1SLionel Sambuccat <<_ATEOF || at_write_fail=1
88511be35a1SLionel Sambuc
88611be35a1SLionel SambucExecution tuning:
88711be35a1SLionel Sambuc  -C, --directory=DIR
88811be35a1SLionel Sambuc                 change to directory DIR before starting
88911be35a1SLionel Sambuc      --color[=never|auto|always]
89011be35a1SLionel Sambuc                 enable colored test results on terminal, or always
89111be35a1SLionel Sambuc  -j, --jobs[=N]
89211be35a1SLionel Sambuc                 Allow N jobs at once; infinite jobs with no arg (default 1)
89311be35a1SLionel Sambuc  -k, --keywords=KEYWORDS
89411be35a1SLionel Sambuc                 select the tests matching all the comma-separated KEYWORDS
89511be35a1SLionel Sambuc                 multiple \`-k' accumulate; prefixed \`!' negates a KEYWORD
89611be35a1SLionel Sambuc      --recheck  select all tests that failed or passed unexpectedly last time
89711be35a1SLionel Sambuc  -e, --errexit  abort as soon as a test fails; implies --debug
89811be35a1SLionel Sambuc  -v, --verbose  force more detailed output
89911be35a1SLionel Sambuc                 default for debugging scripts
90011be35a1SLionel Sambuc  -d, --debug    inhibit clean up and top-level logging
90111be35a1SLionel Sambuc                 default for debugging scripts
90211be35a1SLionel Sambuc  -x, --trace    enable tests shell tracing
90311be35a1SLionel Sambuc_ATEOF
90411be35a1SLionel Sambuccat <<_ATEOF || at_write_fail=1
90511be35a1SLionel Sambuc
90611be35a1SLionel SambucReport bugs to <kyua-discuss@googlegroups.com>.
90711be35a1SLionel Sambuc_ATEOF
90811be35a1SLionel Sambuc  exit $at_write_fail
90911be35a1SLionel Sambucfi
91011be35a1SLionel Sambuc
91111be35a1SLionel Sambuc# List of tests.
91211be35a1SLionel Sambucif $at_list_p; then
91311be35a1SLionel Sambuc  cat <<_ATEOF || at_write_fail=1
914*84d9c625SLionel SambucKyua - Command line interface 0.7 test suite: bootstrapping tests test groups:
91511be35a1SLionel Sambuc
91611be35a1SLionel Sambuc NUM: FILE-NAME:LINE     TEST-GROUP-NAME
91711be35a1SLionel Sambuc      KEYWORDS
91811be35a1SLionel Sambuc
91911be35a1SLionel Sambuc_ATEOF
92011be35a1SLionel Sambuc  # Pass an empty line as separator between selected groups and help.
92111be35a1SLionel Sambuc  $as_echo "$at_groups$as_nl$as_nl$at_help_all" |
92211be35a1SLionel Sambuc    awk 'NF == 1 && FS != ";" {
92311be35a1SLionel Sambuc	   selected[$ 1] = 1
92411be35a1SLionel Sambuc	   next
92511be35a1SLionel Sambuc	 }
92611be35a1SLionel Sambuc	 /^$/ { FS = ";" }
92711be35a1SLionel Sambuc	 NF > 0 {
92811be35a1SLionel Sambuc	   if (selected[$ 1]) {
92911be35a1SLionel Sambuc	     printf " %3d: %-18s %s\n", $ 1, $ 2, $ 3
93011be35a1SLionel Sambuc	     if ($ 4) {
93111be35a1SLionel Sambuc	       lmax = 79
93211be35a1SLionel Sambuc	       indent = "     "
93311be35a1SLionel Sambuc	       line = indent
93411be35a1SLionel Sambuc	       len = length (line)
93511be35a1SLionel Sambuc	       n = split ($ 4, a, " ")
93611be35a1SLionel Sambuc	       for (i = 1; i <= n; i++) {
93711be35a1SLionel Sambuc		 l = length (a[i]) + 1
93811be35a1SLionel Sambuc		 if (i > 1 && len + l > lmax) {
93911be35a1SLionel Sambuc		   print line
94011be35a1SLionel Sambuc		   line = indent " " a[i]
94111be35a1SLionel Sambuc		   len = length (line)
94211be35a1SLionel Sambuc		 } else {
94311be35a1SLionel Sambuc		   line = line " " a[i]
94411be35a1SLionel Sambuc		   len += l
94511be35a1SLionel Sambuc		 }
94611be35a1SLionel Sambuc	       }
94711be35a1SLionel Sambuc	       if (n)
94811be35a1SLionel Sambuc		 print line
94911be35a1SLionel Sambuc	     }
95011be35a1SLionel Sambuc	   }
95111be35a1SLionel Sambuc	 }' || at_write_fail=1
95211be35a1SLionel Sambuc  exit $at_write_fail
95311be35a1SLionel Sambucfi
95411be35a1SLionel Sambucif $at_version_p; then
955*84d9c625SLionel Sambuc  $as_echo "$as_me (Kyua - Command line interface 0.7)" &&
95611be35a1SLionel Sambuc  cat <<\_ATEOF || at_write_fail=1
95711be35a1SLionel Sambuc
95811be35a1SLionel SambucCopyright (C) 2012 Free Software Foundation, Inc.
95911be35a1SLionel SambucThis test suite is free software; the Free Software Foundation gives
96011be35a1SLionel Sambucunlimited permission to copy, distribute and modify it.
96111be35a1SLionel Sambuc_ATEOF
96211be35a1SLionel Sambuc  exit $at_write_fail
96311be35a1SLionel Sambucfi
96411be35a1SLionel Sambuc
96511be35a1SLionel Sambuc# Should we print banners?  Yes if more than one test is run.
96611be35a1SLionel Sambuccase $at_groups in #(
96711be35a1SLionel Sambuc  *$as_nl* )
96811be35a1SLionel Sambuc      at_print_banners=: ;; #(
96911be35a1SLionel Sambuc  * ) at_print_banners=false ;;
97011be35a1SLionel Sambucesac
97111be35a1SLionel Sambuc# Text for banner N, set to a single space once printed.
97211be35a1SLionel Sambuc
97311be35a1SLionel Sambuc# Take any -C into account.
97411be35a1SLionel Sambucif $at_change_dir ; then
97511be35a1SLionel Sambuc  test x != "x$at_dir" && cd "$at_dir" \
97611be35a1SLionel Sambuc    || as_fn_error $? "unable to change directory"
97711be35a1SLionel Sambuc  at_dir=`pwd`
97811be35a1SLionel Sambucfi
97911be35a1SLionel Sambuc
98011be35a1SLionel Sambuc# Load the config files for any default variable assignments.
98111be35a1SLionel Sambucfor at_file in atconfig atlocal
98211be35a1SLionel Sambucdo
98311be35a1SLionel Sambuc  test -r $at_file || continue
98411be35a1SLionel Sambuc  . ./$at_file || as_fn_error $? "invalid content: $at_file"
98511be35a1SLionel Sambucdone
98611be35a1SLionel Sambuc
98711be35a1SLionel Sambuc# Autoconf <=2.59b set at_top_builddir instead of at_top_build_prefix:
98811be35a1SLionel Sambuc: "${at_top_build_prefix=$at_top_builddir}"
98911be35a1SLionel Sambuc
99011be35a1SLionel Sambuc# Perform any assignments requested during argument parsing.
99111be35a1SLionel Sambuceval "$at_debug_args"
99211be35a1SLionel Sambuc
99311be35a1SLionel Sambuc# atconfig delivers names relative to the directory the test suite is
99411be35a1SLionel Sambuc# in, but the groups themselves are run in testsuite-dir/group-dir.
99511be35a1SLionel Sambucif test -n "$at_top_srcdir"; then
99611be35a1SLionel Sambuc  builddir=../..
99711be35a1SLionel Sambuc  for at_dir_var in srcdir top_srcdir top_build_prefix
99811be35a1SLionel Sambuc  do
99911be35a1SLionel Sambuc    eval at_val=\$at_$at_dir_var
100011be35a1SLionel Sambuc    case $at_val in
100111be35a1SLionel Sambuc      [\\/$]* | ?:[\\/]* ) at_prefix= ;;
100211be35a1SLionel Sambuc      *) at_prefix=../../ ;;
100311be35a1SLionel Sambuc    esac
100411be35a1SLionel Sambuc    eval "$at_dir_var=\$at_prefix\$at_val"
100511be35a1SLionel Sambuc  done
100611be35a1SLionel Sambucfi
100711be35a1SLionel Sambuc
100811be35a1SLionel Sambuc## -------------------- ##
100911be35a1SLionel Sambuc## Directory structure. ##
101011be35a1SLionel Sambuc## -------------------- ##
101111be35a1SLionel Sambuc
101211be35a1SLionel Sambuc# This is the set of directories and files used by this script
101311be35a1SLionel Sambuc# (non-literals are capitalized):
101411be35a1SLionel Sambuc#
101511be35a1SLionel Sambuc# TESTSUITE         - the testsuite
101611be35a1SLionel Sambuc# TESTSUITE.log     - summarizes the complete testsuite run
101711be35a1SLionel Sambuc# TESTSUITE.dir/    - created during a run, remains after -d or failed test
101811be35a1SLionel Sambuc# + at-groups/      - during a run: status of all groups in run
101911be35a1SLionel Sambuc# | + NNN/          - during a run: meta-data about test group NNN
102011be35a1SLionel Sambuc# | | + check-line  - location (source file and line) of current AT_CHECK
102111be35a1SLionel Sambuc# | | + status      - exit status of current AT_CHECK
102211be35a1SLionel Sambuc# | | + stdout      - stdout of current AT_CHECK
102311be35a1SLionel Sambuc# | | + stder1      - stderr, including trace
102411be35a1SLionel Sambuc# | | + stderr      - stderr, with trace filtered out
102511be35a1SLionel Sambuc# | | + test-source - portion of testsuite that defines group
102611be35a1SLionel Sambuc# | | + times       - timestamps for computing duration
102711be35a1SLionel Sambuc# | | + pass        - created if group passed
102811be35a1SLionel Sambuc# | | + xpass       - created if group xpassed
102911be35a1SLionel Sambuc# | | + fail        - created if group failed
103011be35a1SLionel Sambuc# | | + xfail       - created if group xfailed
103111be35a1SLionel Sambuc# | | + skip        - created if group skipped
103211be35a1SLionel Sambuc# + at-stop         - during a run: end the run if this file exists
103311be35a1SLionel Sambuc# + at-source-lines - during a run: cache of TESTSUITE line numbers for extraction
103411be35a1SLionel Sambuc# + 0..NNN/         - created for each group NNN, remains after -d or failed test
103511be35a1SLionel Sambuc# | + TESTSUITE.log - summarizes the group results
103611be35a1SLionel Sambuc# | + ...           - files created during the group
103711be35a1SLionel Sambuc
103811be35a1SLionel Sambuc# The directory the whole suite works in.
103911be35a1SLionel Sambuc# Should be absolute to let the user `cd' at will.
104011be35a1SLionel Sambucat_suite_dir=$at_dir/$as_me.dir
104111be35a1SLionel Sambuc# The file containing the suite ($at_dir might have changed since earlier).
104211be35a1SLionel Sambucat_suite_log=$at_dir/$as_me.log
104311be35a1SLionel Sambuc# The directory containing helper files per test group.
104411be35a1SLionel Sambucat_helper_dir=$at_suite_dir/at-groups
104511be35a1SLionel Sambuc# Stop file: if it exists, do not start new jobs.
104611be35a1SLionel Sambucat_stop_file=$at_suite_dir/at-stop
104711be35a1SLionel Sambuc# The fifo used for the job dispatcher.
104811be35a1SLionel Sambucat_job_fifo=$at_suite_dir/at-job-fifo
104911be35a1SLionel Sambuc
105011be35a1SLionel Sambucif $at_clean; then
105111be35a1SLionel Sambuc  test -d "$at_suite_dir" &&
105211be35a1SLionel Sambuc    find "$at_suite_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \;
105311be35a1SLionel Sambuc  rm -f -r "$at_suite_dir" "$at_suite_log"
105411be35a1SLionel Sambuc  exit $?
105511be35a1SLionel Sambucfi
105611be35a1SLionel Sambuc
105711be35a1SLionel Sambuc# Don't take risks: use only absolute directories in PATH.
105811be35a1SLionel Sambuc#
105911be35a1SLionel Sambuc# For stand-alone test suites (ie. atconfig was not found),
106011be35a1SLionel Sambuc# AUTOTEST_PATH is relative to `.'.
106111be35a1SLionel Sambuc#
106211be35a1SLionel Sambuc# For embedded test suites, AUTOTEST_PATH is relative to the top level
106311be35a1SLionel Sambuc# of the package.  Then expand it into build/src parts, since users
106411be35a1SLionel Sambuc# may create executables in both places.
106511be35a1SLionel SambucAUTOTEST_PATH=`$as_echo "$AUTOTEST_PATH" | sed "s|:|$PATH_SEPARATOR|g"`
106611be35a1SLionel Sambucat_path=
106711be35a1SLionel Sambucas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
106811be35a1SLionel Sambucfor as_dir in $AUTOTEST_PATH $PATH
106911be35a1SLionel Sambucdo
107011be35a1SLionel Sambuc  IFS=$as_save_IFS
107111be35a1SLionel Sambuc  test -z "$as_dir" && as_dir=.
107211be35a1SLionel Sambuc    test -n "$at_path" && as_fn_append at_path $PATH_SEPARATOR
107311be35a1SLionel Sambuccase $as_dir in
107411be35a1SLionel Sambuc  [\\/]* | ?:[\\/]* )
107511be35a1SLionel Sambuc    as_fn_append at_path "$as_dir"
107611be35a1SLionel Sambuc    ;;
107711be35a1SLionel Sambuc  * )
107811be35a1SLionel Sambuc    if test -z "$at_top_build_prefix"; then
107911be35a1SLionel Sambuc      # Stand-alone test suite.
108011be35a1SLionel Sambuc      as_fn_append at_path "$as_dir"
108111be35a1SLionel Sambuc    else
108211be35a1SLionel Sambuc      # Embedded test suite.
108311be35a1SLionel Sambuc      as_fn_append at_path "$at_top_build_prefix$as_dir$PATH_SEPARATOR"
108411be35a1SLionel Sambuc      as_fn_append at_path "$at_top_srcdir/$as_dir"
108511be35a1SLionel Sambuc    fi
108611be35a1SLionel Sambuc    ;;
108711be35a1SLionel Sambucesac
108811be35a1SLionel Sambuc  done
108911be35a1SLionel SambucIFS=$as_save_IFS
109011be35a1SLionel Sambuc
109111be35a1SLionel Sambuc
109211be35a1SLionel Sambuc# Now build and simplify PATH.
109311be35a1SLionel Sambuc#
109411be35a1SLionel Sambuc# There might be directories that don't exist, but don't redirect
109511be35a1SLionel Sambuc# builtins' (eg., cd) stderr directly: Ultrix's sh hates that.
109611be35a1SLionel Sambucat_new_path=
109711be35a1SLionel Sambucas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
109811be35a1SLionel Sambucfor as_dir in $at_path
109911be35a1SLionel Sambucdo
110011be35a1SLionel Sambuc  IFS=$as_save_IFS
110111be35a1SLionel Sambuc  test -z "$as_dir" && as_dir=.
110211be35a1SLionel Sambuc    test -d "$as_dir" || continue
110311be35a1SLionel Sambuccase $as_dir in
110411be35a1SLionel Sambuc  [\\/]* | ?:[\\/]* ) ;;
110511be35a1SLionel Sambuc  * ) as_dir=`(cd "$as_dir" && pwd) 2>/dev/null` ;;
110611be35a1SLionel Sambucesac
110711be35a1SLionel Sambuccase $PATH_SEPARATOR$at_new_path$PATH_SEPARATOR in
110811be35a1SLionel Sambuc  *$PATH_SEPARATOR$as_dir$PATH_SEPARATOR*) ;;
110911be35a1SLionel Sambuc  $PATH_SEPARATOR$PATH_SEPARATOR) at_new_path=$as_dir ;;
111011be35a1SLionel Sambuc  *) as_fn_append at_new_path "$PATH_SEPARATOR$as_dir" ;;
111111be35a1SLionel Sambucesac
111211be35a1SLionel Sambuc  done
111311be35a1SLionel SambucIFS=$as_save_IFS
111411be35a1SLionel Sambuc
111511be35a1SLionel SambucPATH=$at_new_path
111611be35a1SLionel Sambucexport PATH
111711be35a1SLionel Sambuc
111811be35a1SLionel Sambuc# Setting up the FDs.
111911be35a1SLionel Sambuc
112011be35a1SLionel Sambuc
112111be35a1SLionel Sambuc
112211be35a1SLionel Sambuc# 5 is the log file.  Not to be overwritten if `-d'.
112311be35a1SLionel Sambucif $at_debug_p; then
112411be35a1SLionel Sambuc  at_suite_log=/dev/null
112511be35a1SLionel Sambucelse
112611be35a1SLionel Sambuc  : >"$at_suite_log"
112711be35a1SLionel Sambucfi
112811be35a1SLionel Sambucexec 5>>"$at_suite_log"
112911be35a1SLionel Sambuc
113011be35a1SLionel Sambuc# Banners and logs.
113111be35a1SLionel Sambuc$as_echo "## ------------------------------------------------------------------ ##
1132*84d9c625SLionel Sambuc## Kyua - Command line interface 0.7 test suite: bootstrapping tests. ##
113311be35a1SLionel Sambuc## ------------------------------------------------------------------ ##"
113411be35a1SLionel Sambuc{
113511be35a1SLionel Sambuc  $as_echo "## ------------------------------------------------------------------ ##
1136*84d9c625SLionel Sambuc## Kyua - Command line interface 0.7 test suite: bootstrapping tests. ##
113711be35a1SLionel Sambuc## ------------------------------------------------------------------ ##"
113811be35a1SLionel Sambuc  echo
113911be35a1SLionel Sambuc
114011be35a1SLionel Sambuc  $as_echo "$as_me: command line was:"
114111be35a1SLionel Sambuc  $as_echo "  \$ $0 $at_cli_args"
114211be35a1SLionel Sambuc  echo
114311be35a1SLionel Sambuc
114411be35a1SLionel Sambuc  # If ChangeLog exists, list a few lines in case it might help determining
114511be35a1SLionel Sambuc  # the exact version.
114611be35a1SLionel Sambuc  if test -n "$at_top_srcdir" && test -f "$at_top_srcdir/ChangeLog"; then
114711be35a1SLionel Sambuc    $as_echo "## ---------- ##
114811be35a1SLionel Sambuc## ChangeLog. ##
114911be35a1SLionel Sambuc## ---------- ##"
115011be35a1SLionel Sambuc    echo
115111be35a1SLionel Sambuc    sed 's/^/| /;10q' "$at_top_srcdir/ChangeLog"
115211be35a1SLionel Sambuc    echo
115311be35a1SLionel Sambuc  fi
115411be35a1SLionel Sambuc
115511be35a1SLionel Sambuc  {
115611be35a1SLionel Sambuccat <<_ASUNAME
115711be35a1SLionel Sambuc## --------- ##
115811be35a1SLionel Sambuc## Platform. ##
115911be35a1SLionel Sambuc## --------- ##
116011be35a1SLionel Sambuc
116111be35a1SLionel Sambuchostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
116211be35a1SLionel Sambucuname -m = `(uname -m) 2>/dev/null || echo unknown`
116311be35a1SLionel Sambucuname -r = `(uname -r) 2>/dev/null || echo unknown`
116411be35a1SLionel Sambucuname -s = `(uname -s) 2>/dev/null || echo unknown`
116511be35a1SLionel Sambucuname -v = `(uname -v) 2>/dev/null || echo unknown`
116611be35a1SLionel Sambuc
116711be35a1SLionel Sambuc/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
116811be35a1SLionel Sambuc/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
116911be35a1SLionel Sambuc
117011be35a1SLionel Sambuc/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
117111be35a1SLionel Sambuc/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
117211be35a1SLionel Sambuc/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
117311be35a1SLionel Sambuc/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
117411be35a1SLionel Sambuc/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
117511be35a1SLionel Sambuc/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
117611be35a1SLionel Sambuc/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
117711be35a1SLionel Sambuc
117811be35a1SLionel Sambuc_ASUNAME
117911be35a1SLionel Sambuc
118011be35a1SLionel Sambucas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
118111be35a1SLionel Sambucfor as_dir in $PATH
118211be35a1SLionel Sambucdo
118311be35a1SLionel Sambuc  IFS=$as_save_IFS
118411be35a1SLionel Sambuc  test -z "$as_dir" && as_dir=.
118511be35a1SLionel Sambuc    $as_echo "PATH: $as_dir"
118611be35a1SLionel Sambuc  done
118711be35a1SLionel SambucIFS=$as_save_IFS
118811be35a1SLionel Sambuc
118911be35a1SLionel Sambuc}
119011be35a1SLionel Sambuc  echo
119111be35a1SLionel Sambuc
119211be35a1SLionel Sambuc  # Contents of the config files.
119311be35a1SLionel Sambuc  for at_file in atconfig atlocal
119411be35a1SLionel Sambuc  do
119511be35a1SLionel Sambuc    test -r $at_file || continue
119611be35a1SLionel Sambuc    $as_echo "$as_me: $at_file:"
119711be35a1SLionel Sambuc    sed 's/^/| /' $at_file
119811be35a1SLionel Sambuc    echo
119911be35a1SLionel Sambuc  done
120011be35a1SLionel Sambuc} >&5
120111be35a1SLionel Sambuc
120211be35a1SLionel Sambuc
120311be35a1SLionel Sambuc## ------------------------- ##
120411be35a1SLionel Sambuc## Autotest shell functions. ##
120511be35a1SLionel Sambuc## ------------------------- ##
120611be35a1SLionel Sambuc
120711be35a1SLionel Sambuc# at_fn_banner NUMBER
120811be35a1SLionel Sambuc# -------------------
120911be35a1SLionel Sambuc# Output banner NUMBER, provided the testsuite is running multiple groups and
121011be35a1SLionel Sambuc# this particular banner has not yet been printed.
121111be35a1SLionel Sambucat_fn_banner ()
121211be35a1SLionel Sambuc{
121311be35a1SLionel Sambuc  $at_print_banners || return 0
121411be35a1SLionel Sambuc  eval at_banner_text=\$at_banner_text_$1
121511be35a1SLionel Sambuc  test "x$at_banner_text" = "x " && return 0
121611be35a1SLionel Sambuc  eval "at_banner_text_$1=\" \""
121711be35a1SLionel Sambuc  if test -z "$at_banner_text"; then
121811be35a1SLionel Sambuc    $at_first || echo
121911be35a1SLionel Sambuc  else
122011be35a1SLionel Sambuc    $as_echo "$as_nl$at_banner_text$as_nl"
122111be35a1SLionel Sambuc  fi
122211be35a1SLionel Sambuc} # at_fn_banner
122311be35a1SLionel Sambuc
122411be35a1SLionel Sambuc# at_fn_check_prepare_notrace REASON LINE
122511be35a1SLionel Sambuc# ---------------------------------------
122611be35a1SLionel Sambuc# Perform AT_CHECK preparations for the command at LINE for an untraceable
122711be35a1SLionel Sambuc# command; REASON is the reason for disabling tracing.
122811be35a1SLionel Sambucat_fn_check_prepare_notrace ()
122911be35a1SLionel Sambuc{
123011be35a1SLionel Sambuc  $at_trace_echo "Not enabling shell tracing (command contains $1)"
123111be35a1SLionel Sambuc  $as_echo "$2" >"$at_check_line_file"
123211be35a1SLionel Sambuc  at_check_trace=: at_check_filter=:
123311be35a1SLionel Sambuc  : >"$at_stdout"; : >"$at_stderr"
123411be35a1SLionel Sambuc}
123511be35a1SLionel Sambuc
123611be35a1SLionel Sambuc# at_fn_check_prepare_trace LINE
123711be35a1SLionel Sambuc# ------------------------------
123811be35a1SLionel Sambuc# Perform AT_CHECK preparations for the command at LINE for a traceable
123911be35a1SLionel Sambuc# command.
124011be35a1SLionel Sambucat_fn_check_prepare_trace ()
124111be35a1SLionel Sambuc{
124211be35a1SLionel Sambuc  $as_echo "$1" >"$at_check_line_file"
124311be35a1SLionel Sambuc  at_check_trace=$at_traceon at_check_filter=$at_check_filter_trace
124411be35a1SLionel Sambuc  : >"$at_stdout"; : >"$at_stderr"
124511be35a1SLionel Sambuc}
124611be35a1SLionel Sambuc
124711be35a1SLionel Sambuc# at_fn_check_prepare_dynamic COMMAND LINE
124811be35a1SLionel Sambuc# ----------------------------------------
124911be35a1SLionel Sambuc# Decide if COMMAND at LINE is traceable at runtime, and call the appropriate
125011be35a1SLionel Sambuc# preparation function.
125111be35a1SLionel Sambucat_fn_check_prepare_dynamic ()
125211be35a1SLionel Sambuc{
125311be35a1SLionel Sambuc  case $1 in
125411be35a1SLionel Sambuc    *$as_nl*)
125511be35a1SLionel Sambuc      at_fn_check_prepare_notrace 'an embedded newline' "$2" ;;
125611be35a1SLionel Sambuc    *)
125711be35a1SLionel Sambuc      at_fn_check_prepare_trace "$2" ;;
125811be35a1SLionel Sambuc  esac
125911be35a1SLionel Sambuc}
126011be35a1SLionel Sambuc
126111be35a1SLionel Sambuc# at_fn_filter_trace
126211be35a1SLionel Sambuc# ------------------
126311be35a1SLionel Sambuc# Remove the lines in the file "$at_stderr" generated by "set -x" and print
126411be35a1SLionel Sambuc# them to stderr.
126511be35a1SLionel Sambucat_fn_filter_trace ()
126611be35a1SLionel Sambuc{
126711be35a1SLionel Sambuc  mv "$at_stderr" "$at_stder1"
126811be35a1SLionel Sambuc  grep '^ *+' "$at_stder1" >&2
126911be35a1SLionel Sambuc  grep -v '^ *+' "$at_stder1" >"$at_stderr"
127011be35a1SLionel Sambuc}
127111be35a1SLionel Sambuc
127211be35a1SLionel Sambuc# at_fn_log_failure FILE-LIST
127311be35a1SLionel Sambuc# ---------------------------
127411be35a1SLionel Sambuc# Copy the files in the list on stdout with a "> " prefix, and exit the shell
127511be35a1SLionel Sambuc# with a failure exit code.
127611be35a1SLionel Sambucat_fn_log_failure ()
127711be35a1SLionel Sambuc{
127811be35a1SLionel Sambuc  for file
127911be35a1SLionel Sambuc    do $as_echo "$file:"; sed 's/^/> /' "$file"; done
128011be35a1SLionel Sambuc  echo 1 > "$at_status_file"
128111be35a1SLionel Sambuc  exit 1
128211be35a1SLionel Sambuc}
128311be35a1SLionel Sambuc
128411be35a1SLionel Sambuc# at_fn_check_skip EXIT-CODE LINE
128511be35a1SLionel Sambuc# -------------------------------
128611be35a1SLionel Sambuc# Check whether EXIT-CODE is a special exit code (77 or 99), and if so exit
128711be35a1SLionel Sambuc# the test group subshell with that same exit code. Use LINE in any report
128811be35a1SLionel Sambuc# about test failure.
128911be35a1SLionel Sambucat_fn_check_skip ()
129011be35a1SLionel Sambuc{
129111be35a1SLionel Sambuc  case $1 in
129211be35a1SLionel Sambuc    99) echo 99 > "$at_status_file"; at_failed=:
129311be35a1SLionel Sambuc	$as_echo "$2: hard failure"; exit 99;;
129411be35a1SLionel Sambuc    77) echo 77 > "$at_status_file"; exit 77;;
129511be35a1SLionel Sambuc  esac
129611be35a1SLionel Sambuc}
129711be35a1SLionel Sambuc
129811be35a1SLionel Sambuc# at_fn_check_status EXPECTED EXIT-CODE LINE
129911be35a1SLionel Sambuc# ------------------------------------------
130011be35a1SLionel Sambuc# Check whether EXIT-CODE is the EXPECTED exit code, and if so do nothing.
130111be35a1SLionel Sambuc# Otherwise, if it is 77 or 99, exit the test group subshell with that same
130211be35a1SLionel Sambuc# exit code; if it is anything else print an error message referring to LINE,
130311be35a1SLionel Sambuc# and fail the test.
130411be35a1SLionel Sambucat_fn_check_status ()
130511be35a1SLionel Sambuc{
130611be35a1SLionel Sambuc  case $2 in
130711be35a1SLionel Sambuc    $1 ) ;;
130811be35a1SLionel Sambuc    77) echo 77 > "$at_status_file"; exit 77;;
130911be35a1SLionel Sambuc    99) echo 99 > "$at_status_file"; at_failed=:
131011be35a1SLionel Sambuc	$as_echo "$3: hard failure"; exit 99;;
131111be35a1SLionel Sambuc    *) $as_echo "$3: exit code was $2, expected $1"
131211be35a1SLionel Sambuc      at_failed=:;;
131311be35a1SLionel Sambuc  esac
131411be35a1SLionel Sambuc}
131511be35a1SLionel Sambuc
131611be35a1SLionel Sambuc# at_fn_diff_devnull FILE
131711be35a1SLionel Sambuc# -----------------------
131811be35a1SLionel Sambuc# Emit a diff between /dev/null and FILE. Uses "test -s" to avoid useless diff
131911be35a1SLionel Sambuc# invocations.
132011be35a1SLionel Sambucat_fn_diff_devnull ()
132111be35a1SLionel Sambuc{
132211be35a1SLionel Sambuc  test -s "$1" || return 0
132311be35a1SLionel Sambuc  $at_diff "$at_devnull" "$1"
132411be35a1SLionel Sambuc}
132511be35a1SLionel Sambuc
132611be35a1SLionel Sambuc# at_fn_test NUMBER
132711be35a1SLionel Sambuc# -----------------
132811be35a1SLionel Sambuc# Parse out test NUMBER from the tail of this file.
132911be35a1SLionel Sambucat_fn_test ()
133011be35a1SLionel Sambuc{
133111be35a1SLionel Sambuc  eval at_sed=\$at_sed$1
133211be35a1SLionel Sambuc  sed "$at_sed" "$at_myself" > "$at_test_source"
133311be35a1SLionel Sambuc}
133411be35a1SLionel Sambuc
133511be35a1SLionel Sambuc# at_fn_create_debugging_script
133611be35a1SLionel Sambuc# -----------------------------
133711be35a1SLionel Sambuc# Create the debugging script $at_group_dir/run which will reproduce the
133811be35a1SLionel Sambuc# current test group.
133911be35a1SLionel Sambucat_fn_create_debugging_script ()
134011be35a1SLionel Sambuc{
134111be35a1SLionel Sambuc  {
134211be35a1SLionel Sambuc    echo "#! /bin/sh" &&
134311be35a1SLionel Sambuc    echo 'test "${ZSH_VERSION+set}" = set && alias -g '\''${1+"$@"}'\''='\''"$@"'\''' &&
134411be35a1SLionel Sambuc    $as_echo "cd '$at_dir'" &&
134511be35a1SLionel Sambuc    $as_echo "exec \${CONFIG_SHELL-$SHELL} \"$at_myself\" -v -d $at_debug_args $at_group \${1+\"\$@\"}" &&
134611be35a1SLionel Sambuc    echo 'exit 1'
134711be35a1SLionel Sambuc  } >"$at_group_dir/run" &&
134811be35a1SLionel Sambuc  chmod +x "$at_group_dir/run"
134911be35a1SLionel Sambuc}
135011be35a1SLionel Sambuc
135111be35a1SLionel Sambuc## -------------------------------- ##
135211be35a1SLionel Sambuc## End of autotest shell functions. ##
135311be35a1SLionel Sambuc## -------------------------------- ##
135411be35a1SLionel Sambuc{
135511be35a1SLionel Sambuc  $as_echo "## ---------------- ##
135611be35a1SLionel Sambuc## Tested programs. ##
135711be35a1SLionel Sambuc## ---------------- ##"
135811be35a1SLionel Sambuc  echo
135911be35a1SLionel Sambuc} >&5
136011be35a1SLionel Sambuc
136111be35a1SLionel Sambuc# Report what programs are being tested.
136211be35a1SLionel Sambucfor at_program in : $at_tested
136311be35a1SLionel Sambucdo
136411be35a1SLionel Sambuc  test "$at_program" = : && continue
136511be35a1SLionel Sambuc  case $at_program in
136611be35a1SLionel Sambuc    [\\/]* | ?:[\\/]* ) $at_program_=$at_program ;;
136711be35a1SLionel Sambuc    * )
136811be35a1SLionel Sambuc    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
136911be35a1SLionel Sambucfor as_dir in $PATH
137011be35a1SLionel Sambucdo
137111be35a1SLionel Sambuc  IFS=$as_save_IFS
137211be35a1SLionel Sambuc  test -z "$as_dir" && as_dir=.
137311be35a1SLionel Sambuc    test -f "$as_dir/$at_program" && break
137411be35a1SLionel Sambuc  done
137511be35a1SLionel SambucIFS=$as_save_IFS
137611be35a1SLionel Sambuc
137711be35a1SLionel Sambuc    at_program_=$as_dir/$at_program ;;
137811be35a1SLionel Sambuc  esac
137911be35a1SLionel Sambuc  if test -f "$at_program_"; then
138011be35a1SLionel Sambuc    {
138111be35a1SLionel Sambuc      $as_echo "$at_srcdir/testsuite.at:29: $at_program_ --version"
138211be35a1SLionel Sambuc      "$at_program_" --version </dev/null
138311be35a1SLionel Sambuc      echo
138411be35a1SLionel Sambuc    } >&5 2>&1
138511be35a1SLionel Sambuc  else
138611be35a1SLionel Sambuc    as_fn_error $? "cannot find $at_program" "$LINENO" 5
138711be35a1SLionel Sambuc  fi
138811be35a1SLionel Sambucdone
138911be35a1SLionel Sambuc
139011be35a1SLionel Sambuc{
139111be35a1SLionel Sambuc  $as_echo "## ------------------ ##
139211be35a1SLionel Sambuc## Running the tests. ##
139311be35a1SLionel Sambuc## ------------------ ##"
139411be35a1SLionel Sambuc} >&5
139511be35a1SLionel Sambuc
139611be35a1SLionel Sambucat_start_date=`date`
139711be35a1SLionel Sambucat_start_time=`date +%s 2>/dev/null`
139811be35a1SLionel Sambuc$as_echo "$as_me: starting at: $at_start_date" >&5
139911be35a1SLionel Sambuc
140011be35a1SLionel Sambuc# Create the master directory if it doesn't already exist.
140111be35a1SLionel Sambucas_dir="$at_suite_dir"; as_fn_mkdir_p ||
140211be35a1SLionel Sambuc  as_fn_error $? "cannot create \`$at_suite_dir'" "$LINENO" 5
140311be35a1SLionel Sambuc
140411be35a1SLionel Sambuc# Can we diff with `/dev/null'?  DU 5.0 refuses.
140511be35a1SLionel Sambucif diff /dev/null /dev/null >/dev/null 2>&1; then
140611be35a1SLionel Sambuc  at_devnull=/dev/null
140711be35a1SLionel Sambucelse
140811be35a1SLionel Sambuc  at_devnull=$at_suite_dir/devnull
140911be35a1SLionel Sambuc  >"$at_devnull"
141011be35a1SLionel Sambucfi
141111be35a1SLionel Sambuc
141211be35a1SLionel Sambuc# Use `diff -u' when possible.
141311be35a1SLionel Sambucif at_diff=`diff -u "$at_devnull" "$at_devnull" 2>&1` && test -z "$at_diff"
141411be35a1SLionel Sambucthen
141511be35a1SLionel Sambuc  at_diff='diff -u'
141611be35a1SLionel Sambucelse
141711be35a1SLionel Sambuc  at_diff=diff
141811be35a1SLionel Sambucfi
141911be35a1SLionel Sambuc
142011be35a1SLionel Sambuc# Get the last needed group.
142111be35a1SLionel Sambucfor at_group in : $at_groups; do :; done
142211be35a1SLionel Sambuc
142311be35a1SLionel Sambuc# Extract the start and end lines of each test group at the tail
142411be35a1SLionel Sambuc# of this file
142511be35a1SLionel Sambucawk '
142611be35a1SLionel SambucBEGIN { FS="" }
142711be35a1SLionel Sambuc/^#AT_START_/ {
142811be35a1SLionel Sambuc  start = NR
142911be35a1SLionel Sambuc}
143011be35a1SLionel Sambuc/^#AT_STOP_/ {
143111be35a1SLionel Sambuc  test = substr ($ 0, 10)
143211be35a1SLionel Sambuc  print "at_sed" test "=\"1," start "d;" (NR-1) "q\""
143311be35a1SLionel Sambuc  if (test == "'"$at_group"'") exit
143411be35a1SLionel Sambuc}' "$at_myself" > "$at_suite_dir/at-source-lines" &&
143511be35a1SLionel Sambuc. "$at_suite_dir/at-source-lines" ||
143611be35a1SLionel Sambuc  as_fn_error $? "cannot create test line number cache" "$LINENO" 5
143711be35a1SLionel Sambucrm -f "$at_suite_dir/at-source-lines"
143811be35a1SLionel Sambuc
143911be35a1SLionel Sambuc# Set number of jobs for `-j'; avoid more jobs than test groups.
144011be35a1SLionel Sambucset X $at_groups; shift; at_max_jobs=$#
144111be35a1SLionel Sambucif test $at_max_jobs -eq 0; then
144211be35a1SLionel Sambuc  at_jobs=1
144311be35a1SLionel Sambucfi
144411be35a1SLionel Sambucif test $at_jobs -ne 1 &&
144511be35a1SLionel Sambuc   { test $at_jobs -eq 0 || test $at_jobs -gt $at_max_jobs; }; then
144611be35a1SLionel Sambuc  at_jobs=$at_max_jobs
144711be35a1SLionel Sambucfi
144811be35a1SLionel Sambuc
144911be35a1SLionel Sambuc# If parallel mode, don't output banners, don't split summary lines.
145011be35a1SLionel Sambucif test $at_jobs -ne 1; then
145111be35a1SLionel Sambuc  at_print_banners=false
145211be35a1SLionel Sambuc  at_quiet=:
145311be35a1SLionel Sambucfi
145411be35a1SLionel Sambuc
145511be35a1SLionel Sambuc# Set up helper dirs.
145611be35a1SLionel Sambucrm -rf "$at_helper_dir" &&
145711be35a1SLionel Sambucmkdir "$at_helper_dir" &&
145811be35a1SLionel Sambuccd "$at_helper_dir" &&
145911be35a1SLionel Sambuc{ test -z "$at_groups" || mkdir $at_groups; } ||
146011be35a1SLionel Sambucas_fn_error $? "testsuite directory setup failed" "$LINENO" 5
146111be35a1SLionel Sambuc
146211be35a1SLionel Sambuc# Functions for running a test group.  We leave the actual
146311be35a1SLionel Sambuc# test group execution outside of a shell function in order
146411be35a1SLionel Sambuc# to avoid hitting zsh 4.x exit status bugs.
146511be35a1SLionel Sambuc
146611be35a1SLionel Sambuc# at_fn_group_prepare
146711be35a1SLionel Sambuc# -------------------
146811be35a1SLionel Sambuc# Prepare for running a test group.
146911be35a1SLionel Sambucat_fn_group_prepare ()
147011be35a1SLionel Sambuc{
147111be35a1SLionel Sambuc  # The directory for additional per-group helper files.
147211be35a1SLionel Sambuc  at_job_dir=$at_helper_dir/$at_group
147311be35a1SLionel Sambuc  # The file containing the location of the last AT_CHECK.
147411be35a1SLionel Sambuc  at_check_line_file=$at_job_dir/check-line
147511be35a1SLionel Sambuc  # The file containing the exit status of the last command.
147611be35a1SLionel Sambuc  at_status_file=$at_job_dir/status
147711be35a1SLionel Sambuc  # The files containing the output of the tested commands.
147811be35a1SLionel Sambuc  at_stdout=$at_job_dir/stdout
147911be35a1SLionel Sambuc  at_stder1=$at_job_dir/stder1
148011be35a1SLionel Sambuc  at_stderr=$at_job_dir/stderr
148111be35a1SLionel Sambuc  # The file containing the code for a test group.
148211be35a1SLionel Sambuc  at_test_source=$at_job_dir/test-source
148311be35a1SLionel Sambuc  # The file containing dates.
148411be35a1SLionel Sambuc  at_times_file=$at_job_dir/times
148511be35a1SLionel Sambuc
148611be35a1SLionel Sambuc  # Be sure to come back to the top test directory.
148711be35a1SLionel Sambuc  cd "$at_suite_dir"
148811be35a1SLionel Sambuc
148911be35a1SLionel Sambuc  # Clearly separate the test groups when verbose.
149011be35a1SLionel Sambuc  $at_first || $at_verbose echo
149111be35a1SLionel Sambuc
149211be35a1SLionel Sambuc  at_group_normalized=$at_group
149311be35a1SLionel Sambuc
149411be35a1SLionel Sambuc  eval 'while :; do
149511be35a1SLionel Sambuc    case $at_group_normalized in #(
149611be35a1SLionel Sambuc    '"$at_format"'*) break;;
149711be35a1SLionel Sambuc    esac
149811be35a1SLionel Sambuc    at_group_normalized=0$at_group_normalized
149911be35a1SLionel Sambuc  done'
150011be35a1SLionel Sambuc
150111be35a1SLionel Sambuc
150211be35a1SLionel Sambuc  # Create a fresh directory for the next test group, and enter.
150311be35a1SLionel Sambuc  # If one already exists, the user may have invoked ./run from
150411be35a1SLionel Sambuc  # within that directory; we remove the contents, but not the
150511be35a1SLionel Sambuc  # directory itself, so that we aren't pulling the rug out from
150611be35a1SLionel Sambuc  # under the shell's notion of the current directory.
150711be35a1SLionel Sambuc  at_group_dir=$at_suite_dir/$at_group_normalized
150811be35a1SLionel Sambuc  at_group_log=$at_group_dir/$as_me.log
150911be35a1SLionel Sambuc  if test -d "$at_group_dir"; then
151011be35a1SLionel Sambuc  find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx {} \;
151111be35a1SLionel Sambuc  rm -fr "$at_group_dir"/* "$at_group_dir"/.[!.] "$at_group_dir"/.??*
151211be35a1SLionel Sambucfi ||
151311be35a1SLionel Sambuc    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: test directory for $at_group_normalized could not be cleaned" >&5
151411be35a1SLionel Sambuc$as_echo "$as_me: WARNING: test directory for $at_group_normalized could not be cleaned" >&2;}
151511be35a1SLionel Sambuc  # Be tolerant if the above `rm' was not able to remove the directory.
151611be35a1SLionel Sambuc  as_dir="$at_group_dir"; as_fn_mkdir_p
151711be35a1SLionel Sambuc
151811be35a1SLionel Sambuc  echo 0 > "$at_status_file"
151911be35a1SLionel Sambuc
152011be35a1SLionel Sambuc  # In verbose mode, append to the log file *and* show on
152111be35a1SLionel Sambuc  # the standard output; in quiet mode only write to the log.
152211be35a1SLionel Sambuc  if test -z "$at_verbose"; then
152311be35a1SLionel Sambuc    at_tee_pipe='tee -a "$at_group_log"'
152411be35a1SLionel Sambuc  else
152511be35a1SLionel Sambuc    at_tee_pipe='cat >> "$at_group_log"'
152611be35a1SLionel Sambuc  fi
152711be35a1SLionel Sambuc}
152811be35a1SLionel Sambuc
152911be35a1SLionel Sambuc# at_fn_group_banner ORDINAL LINE DESC PAD [BANNER]
153011be35a1SLionel Sambuc# -------------------------------------------------
153111be35a1SLionel Sambuc# Declare the test group ORDINAL, located at LINE with group description DESC,
153211be35a1SLionel Sambuc# and residing under BANNER. Use PAD to align the status column.
153311be35a1SLionel Sambucat_fn_group_banner ()
153411be35a1SLionel Sambuc{
153511be35a1SLionel Sambuc  at_setup_line="$2"
153611be35a1SLionel Sambuc  test -n "$5" && at_fn_banner $5
153711be35a1SLionel Sambuc  at_desc="$3"
153811be35a1SLionel Sambuc  case $1 in
153911be35a1SLionel Sambuc    [0-9])      at_desc_line="  $1: ";;
154011be35a1SLionel Sambuc    [0-9][0-9]) at_desc_line=" $1: " ;;
154111be35a1SLionel Sambuc    *)          at_desc_line="$1: "  ;;
154211be35a1SLionel Sambuc  esac
154311be35a1SLionel Sambuc  as_fn_append at_desc_line "$3$4"
154411be35a1SLionel Sambuc  $at_quiet $as_echo_n "$at_desc_line"
154511be35a1SLionel Sambuc  echo "#                             -*- compilation -*-" >> "$at_group_log"
154611be35a1SLionel Sambuc}
154711be35a1SLionel Sambuc
154811be35a1SLionel Sambuc# at_fn_group_postprocess
154911be35a1SLionel Sambuc# -----------------------
155011be35a1SLionel Sambuc# Perform cleanup after running a test group.
155111be35a1SLionel Sambucat_fn_group_postprocess ()
155211be35a1SLionel Sambuc{
155311be35a1SLionel Sambuc  # Be sure to come back to the suite directory, in particular
155411be35a1SLionel Sambuc  # since below we might `rm' the group directory we are in currently.
155511be35a1SLionel Sambuc  cd "$at_suite_dir"
155611be35a1SLionel Sambuc
155711be35a1SLionel Sambuc  if test ! -f "$at_check_line_file"; then
155811be35a1SLionel Sambuc    sed "s/^ */$as_me: WARNING: /" <<_ATEOF
155911be35a1SLionel Sambuc      A failure happened in a test group before any test could be
156011be35a1SLionel Sambuc      run. This means that test suite is improperly designed.  Please
156111be35a1SLionel Sambuc      report this failure to <kyua-discuss@googlegroups.com>.
156211be35a1SLionel Sambuc_ATEOF
156311be35a1SLionel Sambuc    $as_echo "$at_setup_line" >"$at_check_line_file"
156411be35a1SLionel Sambuc    at_status=99
156511be35a1SLionel Sambuc  fi
156611be35a1SLionel Sambuc  $at_verbose $as_echo_n "$at_group. $at_setup_line: "
156711be35a1SLionel Sambuc  $as_echo_n "$at_group. $at_setup_line: " >> "$at_group_log"
156811be35a1SLionel Sambuc  case $at_xfail:$at_status in
156911be35a1SLionel Sambuc    yes:0)
157011be35a1SLionel Sambuc	at_msg="UNEXPECTED PASS"
157111be35a1SLionel Sambuc	at_res=xpass
157211be35a1SLionel Sambuc	at_errexit=$at_errexit_p
157311be35a1SLionel Sambuc	at_color=$at_red
157411be35a1SLionel Sambuc	;;
157511be35a1SLionel Sambuc    no:0)
157611be35a1SLionel Sambuc	at_msg="ok"
157711be35a1SLionel Sambuc	at_res=pass
157811be35a1SLionel Sambuc	at_errexit=false
157911be35a1SLionel Sambuc	at_color=$at_grn
158011be35a1SLionel Sambuc	;;
158111be35a1SLionel Sambuc    *:77)
158211be35a1SLionel Sambuc	at_msg='skipped ('`cat "$at_check_line_file"`')'
158311be35a1SLionel Sambuc	at_res=skip
158411be35a1SLionel Sambuc	at_errexit=false
158511be35a1SLionel Sambuc	at_color=$at_blu
158611be35a1SLionel Sambuc	;;
158711be35a1SLionel Sambuc    no:* | *:99)
158811be35a1SLionel Sambuc	at_msg='FAILED ('`cat "$at_check_line_file"`')'
158911be35a1SLionel Sambuc	at_res=fail
159011be35a1SLionel Sambuc	at_errexit=$at_errexit_p
159111be35a1SLionel Sambuc	at_color=$at_red
159211be35a1SLionel Sambuc	;;
159311be35a1SLionel Sambuc    yes:*)
159411be35a1SLionel Sambuc	at_msg='expected failure ('`cat "$at_check_line_file"`')'
159511be35a1SLionel Sambuc	at_res=xfail
159611be35a1SLionel Sambuc	at_errexit=false
159711be35a1SLionel Sambuc	at_color=$at_lgn
159811be35a1SLionel Sambuc	;;
159911be35a1SLionel Sambuc  esac
160011be35a1SLionel Sambuc  echo "$at_res" > "$at_job_dir/$at_res"
160111be35a1SLionel Sambuc  # In parallel mode, output the summary line only afterwards.
160211be35a1SLionel Sambuc  if test $at_jobs -ne 1 && test -n "$at_verbose"; then
160311be35a1SLionel Sambuc    $as_echo "$at_desc_line $at_color$at_msg$at_std"
160411be35a1SLionel Sambuc  else
160511be35a1SLionel Sambuc    # Make sure there is a separator even with long titles.
160611be35a1SLionel Sambuc    $as_echo " $at_color$at_msg$at_std"
160711be35a1SLionel Sambuc  fi
160811be35a1SLionel Sambuc  at_log_msg="$at_group. $at_desc ($at_setup_line): $at_msg"
160911be35a1SLionel Sambuc  case $at_status in
161011be35a1SLionel Sambuc    0|77)
161111be35a1SLionel Sambuc      # $at_times_file is only available if the group succeeded.
161211be35a1SLionel Sambuc      # We're not including the group log, so the success message
161311be35a1SLionel Sambuc      # is written in the global log separately.  But we also
161411be35a1SLionel Sambuc      # write to the group log in case they're using -d.
161511be35a1SLionel Sambuc      if test -f "$at_times_file"; then
161611be35a1SLionel Sambuc	at_log_msg="$at_log_msg     ("`sed 1d "$at_times_file"`')'
161711be35a1SLionel Sambuc	rm -f "$at_times_file"
161811be35a1SLionel Sambuc      fi
161911be35a1SLionel Sambuc      $as_echo "$at_log_msg" >> "$at_group_log"
162011be35a1SLionel Sambuc      $as_echo "$at_log_msg" >&5
162111be35a1SLionel Sambuc
162211be35a1SLionel Sambuc      # Cleanup the group directory, unless the user wants the files
162311be35a1SLionel Sambuc      # or the success was unexpected.
162411be35a1SLionel Sambuc      if $at_debug_p || test $at_res = xpass; then
162511be35a1SLionel Sambuc	at_fn_create_debugging_script
162611be35a1SLionel Sambuc	if test $at_res = xpass && $at_errexit; then
162711be35a1SLionel Sambuc	  echo stop > "$at_stop_file"
162811be35a1SLionel Sambuc	fi
162911be35a1SLionel Sambuc      else
163011be35a1SLionel Sambuc	if test -d "$at_group_dir"; then
163111be35a1SLionel Sambuc	  find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \;
163211be35a1SLionel Sambuc	  rm -fr "$at_group_dir"
163311be35a1SLionel Sambuc	fi
163411be35a1SLionel Sambuc	rm -f "$at_test_source"
163511be35a1SLionel Sambuc      fi
163611be35a1SLionel Sambuc      ;;
163711be35a1SLionel Sambuc    *)
163811be35a1SLionel Sambuc      # Upon failure, include the log into the testsuite's global
163911be35a1SLionel Sambuc      # log.  The failure message is written in the group log.  It
164011be35a1SLionel Sambuc      # is later included in the global log.
164111be35a1SLionel Sambuc      $as_echo "$at_log_msg" >> "$at_group_log"
164211be35a1SLionel Sambuc
164311be35a1SLionel Sambuc      # Upon failure, keep the group directory for autopsy, and create
164411be35a1SLionel Sambuc      # the debugging script.  With -e, do not start any further tests.
164511be35a1SLionel Sambuc      at_fn_create_debugging_script
164611be35a1SLionel Sambuc      if $at_errexit; then
164711be35a1SLionel Sambuc	echo stop > "$at_stop_file"
164811be35a1SLionel Sambuc      fi
164911be35a1SLionel Sambuc      ;;
165011be35a1SLionel Sambuc  esac
165111be35a1SLionel Sambuc}
165211be35a1SLionel Sambuc
165311be35a1SLionel Sambuc
165411be35a1SLionel Sambuc## ------------ ##
165511be35a1SLionel Sambuc## Driver loop. ##
165611be35a1SLionel Sambuc## ------------ ##
165711be35a1SLionel Sambuc
165811be35a1SLionel Sambuc
165911be35a1SLionel Sambucif (set -m && set +m && set +b) >/dev/null 2>&1; then
166011be35a1SLionel Sambuc  set +b
166111be35a1SLionel Sambuc  at_job_control_on='set -m' at_job_control_off='set +m' at_job_group=-
166211be35a1SLionel Sambucelse
166311be35a1SLionel Sambuc  at_job_control_on=: at_job_control_off=: at_job_group=
166411be35a1SLionel Sambucfi
166511be35a1SLionel Sambuc
166611be35a1SLionel Sambucfor at_signal in 1 2 15; do
166711be35a1SLionel Sambuc  trap 'set +x; set +e
166811be35a1SLionel Sambuc	$at_job_control_off
166911be35a1SLionel Sambuc	at_signal='"$at_signal"'
167011be35a1SLionel Sambuc	echo stop > "$at_stop_file"
167111be35a1SLionel Sambuc	trap "" $at_signal
167211be35a1SLionel Sambuc	at_pgids=
167311be35a1SLionel Sambuc	for at_pgid in `jobs -p 2>/dev/null`; do
167411be35a1SLionel Sambuc	  at_pgids="$at_pgids $at_job_group$at_pgid"
167511be35a1SLionel Sambuc	done
167611be35a1SLionel Sambuc	test -z "$at_pgids" || kill -$at_signal $at_pgids 2>/dev/null
167711be35a1SLionel Sambuc	wait
167811be35a1SLionel Sambuc	if test "$at_jobs" -eq 1 || test -z "$at_verbose"; then
167911be35a1SLionel Sambuc	  echo >&2
168011be35a1SLionel Sambuc	fi
168111be35a1SLionel Sambuc	at_signame=`kill -l $at_signal 2>&1 || echo $at_signal`
168211be35a1SLionel Sambuc	set x $at_signame
168311be35a1SLionel Sambuc	test 1 -gt 2 && at_signame=$at_signal
168411be35a1SLionel Sambuc	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: caught signal $at_signame, bailing out" >&5
168511be35a1SLionel Sambuc$as_echo "$as_me: WARNING: caught signal $at_signame, bailing out" >&2;}
168611be35a1SLionel Sambuc	as_fn_arith 128 + $at_signal && exit_status=$as_val
168711be35a1SLionel Sambuc	as_fn_exit $exit_status' $at_signal
168811be35a1SLionel Sambucdone
168911be35a1SLionel Sambuc
169011be35a1SLionel Sambucrm -f "$at_stop_file"
169111be35a1SLionel Sambucat_first=:
169211be35a1SLionel Sambuc
169311be35a1SLionel Sambucif test $at_jobs -ne 1 &&
169411be35a1SLionel Sambuc     rm -f "$at_job_fifo" &&
169511be35a1SLionel Sambuc     test -n "$at_job_group" &&
169611be35a1SLionel Sambuc     ( mkfifo "$at_job_fifo" && trap 'exit 1' PIPE STOP TSTP ) 2>/dev/null
169711be35a1SLionel Sambucthen
169811be35a1SLionel Sambuc  # FIFO job dispatcher.
169911be35a1SLionel Sambuc
170011be35a1SLionel Sambuc  trap 'at_pids=
170111be35a1SLionel Sambuc	for at_pid in `jobs -p`; do
170211be35a1SLionel Sambuc	  at_pids="$at_pids $at_job_group$at_pid"
170311be35a1SLionel Sambuc	done
170411be35a1SLionel Sambuc	if test -n "$at_pids"; then
170511be35a1SLionel Sambuc	  at_sig=TSTP
170611be35a1SLionel Sambuc	  test "${TMOUT+set}" = set && at_sig=STOP
170711be35a1SLionel Sambuc	  kill -$at_sig $at_pids 2>/dev/null
170811be35a1SLionel Sambuc	fi
170911be35a1SLionel Sambuc	kill -STOP $$
171011be35a1SLionel Sambuc	test -z "$at_pids" || kill -CONT $at_pids 2>/dev/null' TSTP
171111be35a1SLionel Sambuc
171211be35a1SLionel Sambuc  echo
171311be35a1SLionel Sambuc  # Turn jobs into a list of numbers, starting from 1.
171411be35a1SLionel Sambuc  at_joblist=`$as_echo "$at_groups" | sed -n 1,${at_jobs}p`
171511be35a1SLionel Sambuc
171611be35a1SLionel Sambuc  set X $at_joblist
171711be35a1SLionel Sambuc  shift
171811be35a1SLionel Sambuc  for at_group in $at_groups; do
171911be35a1SLionel Sambuc    $at_job_control_on 2>/dev/null
172011be35a1SLionel Sambuc    (
172111be35a1SLionel Sambuc      # Start one test group.
172211be35a1SLionel Sambuc      $at_job_control_off
172311be35a1SLionel Sambuc      if $at_first; then
172411be35a1SLionel Sambuc	exec 7>"$at_job_fifo"
172511be35a1SLionel Sambuc      else
172611be35a1SLionel Sambuc	exec 6<&-
172711be35a1SLionel Sambuc      fi
172811be35a1SLionel Sambuc      trap 'set +x; set +e
172911be35a1SLionel Sambuc	    trap "" PIPE
173011be35a1SLionel Sambuc	    echo stop > "$at_stop_file"
173111be35a1SLionel Sambuc	    echo >&7
173211be35a1SLionel Sambuc	    as_fn_exit 141' PIPE
173311be35a1SLionel Sambuc      at_fn_group_prepare
173411be35a1SLionel Sambuc      if cd "$at_group_dir" &&
173511be35a1SLionel Sambuc	 at_fn_test $at_group &&
173611be35a1SLionel Sambuc	 . "$at_test_source"
173711be35a1SLionel Sambuc      then :; else
173811be35a1SLionel Sambuc	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5
173911be35a1SLionel Sambuc$as_echo "$as_me: WARNING: unable to parse test group: $at_group" >&2;}
174011be35a1SLionel Sambuc	at_failed=:
174111be35a1SLionel Sambuc      fi
174211be35a1SLionel Sambuc      at_fn_group_postprocess
174311be35a1SLionel Sambuc      echo >&7
174411be35a1SLionel Sambuc    ) &
174511be35a1SLionel Sambuc    $at_job_control_off
174611be35a1SLionel Sambuc    if $at_first; then
174711be35a1SLionel Sambuc      at_first=false
174811be35a1SLionel Sambuc      exec 6<"$at_job_fifo" 7>"$at_job_fifo"
174911be35a1SLionel Sambuc    fi
175011be35a1SLionel Sambuc    shift # Consume one token.
175111be35a1SLionel Sambuc    if test $# -gt 0; then :; else
175211be35a1SLionel Sambuc      read at_token <&6 || break
175311be35a1SLionel Sambuc      set x $*
175411be35a1SLionel Sambuc    fi
175511be35a1SLionel Sambuc    test -f "$at_stop_file" && break
175611be35a1SLionel Sambuc  done
175711be35a1SLionel Sambuc  exec 7>&-
175811be35a1SLionel Sambuc  # Read back the remaining ($at_jobs - 1) tokens.
175911be35a1SLionel Sambuc  set X $at_joblist
176011be35a1SLionel Sambuc  shift
176111be35a1SLionel Sambuc  if test $# -gt 0; then
176211be35a1SLionel Sambuc    shift
176311be35a1SLionel Sambuc    for at_job
176411be35a1SLionel Sambuc    do
176511be35a1SLionel Sambuc      read at_token
176611be35a1SLionel Sambuc    done <&6
176711be35a1SLionel Sambuc  fi
176811be35a1SLionel Sambuc  exec 6<&-
176911be35a1SLionel Sambuc  wait
177011be35a1SLionel Sambucelse
177111be35a1SLionel Sambuc  # Run serially, avoid forks and other potential surprises.
177211be35a1SLionel Sambuc  for at_group in $at_groups; do
177311be35a1SLionel Sambuc    at_fn_group_prepare
177411be35a1SLionel Sambuc    if cd "$at_group_dir" &&
177511be35a1SLionel Sambuc       at_fn_test $at_group &&
177611be35a1SLionel Sambuc       . "$at_test_source"; then :; else
177711be35a1SLionel Sambuc      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5
177811be35a1SLionel Sambuc$as_echo "$as_me: WARNING: unable to parse test group: $at_group" >&2;}
177911be35a1SLionel Sambuc      at_failed=:
178011be35a1SLionel Sambuc    fi
178111be35a1SLionel Sambuc    at_fn_group_postprocess
178211be35a1SLionel Sambuc    test -f "$at_stop_file" && break
178311be35a1SLionel Sambuc    at_first=false
178411be35a1SLionel Sambuc  done
178511be35a1SLionel Sambucfi
178611be35a1SLionel Sambuc
178711be35a1SLionel Sambuc# Wrap up the test suite with summary statistics.
178811be35a1SLionel Sambuccd "$at_helper_dir"
178911be35a1SLionel Sambuc
179011be35a1SLionel Sambuc# Use ?..???? when the list must remain sorted, the faster * otherwise.
179111be35a1SLionel Sambucat_pass_list=`for f in */pass; do echo $f; done | sed '/\*/d; s,/pass,,'`
179211be35a1SLionel Sambucat_skip_list=`for f in */skip; do echo $f; done | sed '/\*/d; s,/skip,,'`
179311be35a1SLionel Sambucat_xfail_list=`for f in */xfail; do echo $f; done | sed '/\*/d; s,/xfail,,'`
179411be35a1SLionel Sambucat_xpass_list=`for f in ?/xpass ??/xpass ???/xpass ????/xpass; do
179511be35a1SLionel Sambuc		 echo $f; done | sed '/?/d; s,/xpass,,'`
179611be35a1SLionel Sambucat_fail_list=`for f in ?/fail ??/fail ???/fail ????/fail; do
179711be35a1SLionel Sambuc		echo $f; done | sed '/?/d; s,/fail,,'`
179811be35a1SLionel Sambuc
179911be35a1SLionel Sambucset X $at_pass_list $at_xpass_list $at_xfail_list $at_fail_list $at_skip_list
180011be35a1SLionel Sambucshift; at_group_count=$#
180111be35a1SLionel Sambucset X $at_xpass_list; shift; at_xpass_count=$#; at_xpass_list=$*
180211be35a1SLionel Sambucset X $at_xfail_list; shift; at_xfail_count=$#
180311be35a1SLionel Sambucset X $at_fail_list; shift; at_fail_count=$#; at_fail_list=$*
180411be35a1SLionel Sambucset X $at_skip_list; shift; at_skip_count=$#
180511be35a1SLionel Sambuc
180611be35a1SLionel Sambucas_fn_arith $at_group_count - $at_skip_count && at_run_count=$as_val
180711be35a1SLionel Sambucas_fn_arith $at_xpass_count + $at_fail_count && at_unexpected_count=$as_val
180811be35a1SLionel Sambucas_fn_arith $at_xfail_count + $at_fail_count && at_total_fail_count=$as_val
180911be35a1SLionel Sambuc
181011be35a1SLionel Sambuc# Back to the top directory.
181111be35a1SLionel Sambuccd "$at_dir"
181211be35a1SLionel Sambucrm -rf "$at_helper_dir"
181311be35a1SLionel Sambuc
181411be35a1SLionel Sambuc# Compute the duration of the suite.
181511be35a1SLionel Sambucat_stop_date=`date`
181611be35a1SLionel Sambucat_stop_time=`date +%s 2>/dev/null`
181711be35a1SLionel Sambuc$as_echo "$as_me: ending at: $at_stop_date" >&5
181811be35a1SLionel Sambuccase $at_start_time,$at_stop_time in
181911be35a1SLionel Sambuc  [0-9]*,[0-9]*)
182011be35a1SLionel Sambuc    as_fn_arith $at_stop_time - $at_start_time && at_duration_s=$as_val
182111be35a1SLionel Sambuc    as_fn_arith $at_duration_s / 60 && at_duration_m=$as_val
182211be35a1SLionel Sambuc    as_fn_arith $at_duration_m / 60 && at_duration_h=$as_val
182311be35a1SLionel Sambuc    as_fn_arith $at_duration_s % 60 && at_duration_s=$as_val
182411be35a1SLionel Sambuc    as_fn_arith $at_duration_m % 60 && at_duration_m=$as_val
182511be35a1SLionel Sambuc    at_duration="${at_duration_h}h ${at_duration_m}m ${at_duration_s}s"
182611be35a1SLionel Sambuc    $as_echo "$as_me: test suite duration: $at_duration" >&5
182711be35a1SLionel Sambuc    ;;
182811be35a1SLionel Sambucesac
182911be35a1SLionel Sambuc
183011be35a1SLionel Sambucecho
183111be35a1SLionel Sambuc$as_echo "## ------------- ##
183211be35a1SLionel Sambuc## Test results. ##
183311be35a1SLionel Sambuc## ------------- ##"
183411be35a1SLionel Sambucecho
183511be35a1SLionel Sambuc{
183611be35a1SLionel Sambuc  echo
183711be35a1SLionel Sambuc  $as_echo "## ------------- ##
183811be35a1SLionel Sambuc## Test results. ##
183911be35a1SLionel Sambuc## ------------- ##"
184011be35a1SLionel Sambuc  echo
184111be35a1SLionel Sambuc} >&5
184211be35a1SLionel Sambuc
184311be35a1SLionel Sambucif test $at_run_count = 1; then
184411be35a1SLionel Sambuc  at_result="1 test"
184511be35a1SLionel Sambuc  at_were=was
184611be35a1SLionel Sambucelse
184711be35a1SLionel Sambuc  at_result="$at_run_count tests"
184811be35a1SLionel Sambuc  at_were=were
184911be35a1SLionel Sambucfi
185011be35a1SLionel Sambucif $at_errexit_p && test $at_unexpected_count != 0; then
185111be35a1SLionel Sambuc  if test $at_xpass_count = 1; then
185211be35a1SLionel Sambuc    at_result="$at_result $at_were run, one passed"
185311be35a1SLionel Sambuc  else
185411be35a1SLionel Sambuc    at_result="$at_result $at_were run, one failed"
185511be35a1SLionel Sambuc  fi
185611be35a1SLionel Sambuc  at_result="$at_result unexpectedly and inhibited subsequent tests."
185711be35a1SLionel Sambuc  at_color=$at_red
185811be35a1SLionel Sambucelse
185911be35a1SLionel Sambuc  # Don't you just love exponential explosion of the number of cases?
186011be35a1SLionel Sambuc  at_color=$at_red
186111be35a1SLionel Sambuc  case $at_xpass_count:$at_fail_count:$at_xfail_count in
186211be35a1SLionel Sambuc    # So far, so good.
186311be35a1SLionel Sambuc    0:0:0) at_result="$at_result $at_were successful." at_color=$at_grn ;;
186411be35a1SLionel Sambuc    0:0:*) at_result="$at_result behaved as expected." at_color=$at_lgn ;;
186511be35a1SLionel Sambuc
186611be35a1SLionel Sambuc    # Some unexpected failures
186711be35a1SLionel Sambuc    0:*:0) at_result="$at_result $at_were run,
186811be35a1SLionel Sambuc$at_fail_count failed unexpectedly." ;;
186911be35a1SLionel Sambuc
187011be35a1SLionel Sambuc    # Some failures, both expected and unexpected
187111be35a1SLionel Sambuc    0:*:1) at_result="$at_result $at_were run,
187211be35a1SLionel Sambuc$at_total_fail_count failed ($at_xfail_count expected failure)." ;;
187311be35a1SLionel Sambuc    0:*:*) at_result="$at_result $at_were run,
187411be35a1SLionel Sambuc$at_total_fail_count failed ($at_xfail_count expected failures)." ;;
187511be35a1SLionel Sambuc
187611be35a1SLionel Sambuc    # No unexpected failures, but some xpasses
187711be35a1SLionel Sambuc    *:0:*) at_result="$at_result $at_were run,
187811be35a1SLionel Sambuc$at_xpass_count passed unexpectedly." ;;
187911be35a1SLionel Sambuc
188011be35a1SLionel Sambuc    # No expected failures, but failures and xpasses
188111be35a1SLionel Sambuc    *:1:0) at_result="$at_result $at_were run,
188211be35a1SLionel Sambuc$at_unexpected_count did not behave as expected ($at_fail_count unexpected failure)." ;;
188311be35a1SLionel Sambuc    *:*:0) at_result="$at_result $at_were run,
188411be35a1SLionel Sambuc$at_unexpected_count did not behave as expected ($at_fail_count unexpected failures)." ;;
188511be35a1SLionel Sambuc
188611be35a1SLionel Sambuc    # All of them.
188711be35a1SLionel Sambuc    *:*:1) at_result="$at_result $at_were run,
188811be35a1SLionel Sambuc$at_xpass_count passed unexpectedly,
188911be35a1SLionel Sambuc$at_total_fail_count failed ($at_xfail_count expected failure)." ;;
189011be35a1SLionel Sambuc    *:*:*) at_result="$at_result $at_were run,
189111be35a1SLionel Sambuc$at_xpass_count passed unexpectedly,
189211be35a1SLionel Sambuc$at_total_fail_count failed ($at_xfail_count expected failures)." ;;
189311be35a1SLionel Sambuc  esac
189411be35a1SLionel Sambuc
189511be35a1SLionel Sambuc  if test $at_skip_count = 0 && test $at_run_count -gt 1; then
189611be35a1SLionel Sambuc    at_result="All $at_result"
189711be35a1SLionel Sambuc  fi
189811be35a1SLionel Sambucfi
189911be35a1SLionel Sambuc
190011be35a1SLionel Sambuc# Now put skips in the mix.
190111be35a1SLionel Sambuccase $at_skip_count in
190211be35a1SLionel Sambuc  0) ;;
190311be35a1SLionel Sambuc  1) at_result="$at_result
190411be35a1SLionel Sambuc1 test was skipped." ;;
190511be35a1SLionel Sambuc  *) at_result="$at_result
190611be35a1SLionel Sambuc$at_skip_count tests were skipped." ;;
190711be35a1SLionel Sambucesac
190811be35a1SLionel Sambuc
190911be35a1SLionel Sambucif test $at_unexpected_count = 0; then
191011be35a1SLionel Sambuc  echo "$at_color$at_result$at_std"
191111be35a1SLionel Sambuc  echo "$at_result" >&5
191211be35a1SLionel Sambucelse
191311be35a1SLionel Sambuc  echo "${at_color}ERROR: $at_result$at_std" >&2
191411be35a1SLionel Sambuc  echo "ERROR: $at_result" >&5
191511be35a1SLionel Sambuc  {
191611be35a1SLionel Sambuc    echo
191711be35a1SLionel Sambuc    $as_echo "## ------------------------ ##
191811be35a1SLionel Sambuc## Summary of the failures. ##
191911be35a1SLionel Sambuc## ------------------------ ##"
192011be35a1SLionel Sambuc
192111be35a1SLionel Sambuc    # Summary of failed and skipped tests.
192211be35a1SLionel Sambuc    if test $at_fail_count != 0; then
192311be35a1SLionel Sambuc      echo "Failed tests:"
192411be35a1SLionel Sambuc      $SHELL "$at_myself" $at_fail_list --list
192511be35a1SLionel Sambuc      echo
192611be35a1SLionel Sambuc    fi
192711be35a1SLionel Sambuc    if test $at_skip_count != 0; then
192811be35a1SLionel Sambuc      echo "Skipped tests:"
192911be35a1SLionel Sambuc      $SHELL "$at_myself" $at_skip_list --list
193011be35a1SLionel Sambuc      echo
193111be35a1SLionel Sambuc    fi
193211be35a1SLionel Sambuc    if test $at_xpass_count != 0; then
193311be35a1SLionel Sambuc      echo "Unexpected passes:"
193411be35a1SLionel Sambuc      $SHELL "$at_myself" $at_xpass_list --list
193511be35a1SLionel Sambuc      echo
193611be35a1SLionel Sambuc    fi
193711be35a1SLionel Sambuc    if test $at_fail_count != 0; then
193811be35a1SLionel Sambuc      $as_echo "## ---------------------- ##
193911be35a1SLionel Sambuc## Detailed failed tests. ##
194011be35a1SLionel Sambuc## ---------------------- ##"
194111be35a1SLionel Sambuc      echo
194211be35a1SLionel Sambuc      for at_group in $at_fail_list
194311be35a1SLionel Sambuc      do
194411be35a1SLionel Sambuc	at_group_normalized=$at_group
194511be35a1SLionel Sambuc
194611be35a1SLionel Sambuc  eval 'while :; do
194711be35a1SLionel Sambuc    case $at_group_normalized in #(
194811be35a1SLionel Sambuc    '"$at_format"'*) break;;
194911be35a1SLionel Sambuc    esac
195011be35a1SLionel Sambuc    at_group_normalized=0$at_group_normalized
195111be35a1SLionel Sambuc  done'
195211be35a1SLionel Sambuc
195311be35a1SLionel Sambuc	cat "$at_suite_dir/$at_group_normalized/$as_me.log"
195411be35a1SLionel Sambuc	echo
195511be35a1SLionel Sambuc      done
195611be35a1SLionel Sambuc      echo
195711be35a1SLionel Sambuc    fi
195811be35a1SLionel Sambuc    if test -n "$at_top_srcdir"; then
195911be35a1SLionel Sambuc      sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
196011be35a1SLionel Sambuc## ${at_top_build_prefix}config.log ##
196111be35a1SLionel Sambuc_ASBOX
196211be35a1SLionel Sambuc      sed 's/^/| /' ${at_top_build_prefix}config.log
196311be35a1SLionel Sambuc      echo
196411be35a1SLionel Sambuc    fi
196511be35a1SLionel Sambuc  } >&5
196611be35a1SLionel Sambuc
196711be35a1SLionel Sambuc  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
196811be35a1SLionel Sambuc## $as_me.log was created. ##
196911be35a1SLionel Sambuc_ASBOX
197011be35a1SLionel Sambuc
197111be35a1SLionel Sambuc  echo
197211be35a1SLionel Sambuc  if $at_debug_p; then
197311be35a1SLionel Sambuc    at_msg='per-test log files'
197411be35a1SLionel Sambuc  else
197511be35a1SLionel Sambuc    at_msg="\`${at_testdir+${at_testdir}/}$as_me.log'"
197611be35a1SLionel Sambuc  fi
197711be35a1SLionel Sambuc  $as_echo "Please send $at_msg and all information you think might help:
197811be35a1SLionel Sambuc
197911be35a1SLionel Sambuc   To: <kyua-discuss@googlegroups.com>
1980*84d9c625SLionel Sambuc   Subject: [Kyua - Command line interface 0.7] $as_me: $at_fail_list${at_fail_list:+ failed${at_xpass_list:+, }}$at_xpass_list${at_xpass_list:+ passed unexpectedly}
198111be35a1SLionel Sambuc
198211be35a1SLionel SambucYou may investigate any problem if you feel able to do so, in which
198311be35a1SLionel Sambuccase the test suite provides a good starting point.  Its output may
198411be35a1SLionel Sambucbe found below \`${at_testdir+${at_testdir}/}$as_me.dir'.
198511be35a1SLionel Sambuc"
198611be35a1SLionel Sambuc  exit 1
198711be35a1SLionel Sambucfi
198811be35a1SLionel Sambuc
198911be35a1SLionel Sambucexit 0
199011be35a1SLionel Sambuc
199111be35a1SLionel Sambuc## ------------- ##
199211be35a1SLionel Sambuc## Actual tests. ##
199311be35a1SLionel Sambuc## ------------- ##
199411be35a1SLionel Sambuc#AT_START_1
199511be35a1SLionel Sambucat_fn_group_banner 1 'testsuite.at:70' \
199611be35a1SLionel Sambuc  "test program crashes in test list" "              "
199711be35a1SLionel Sambucat_xfail=no
199811be35a1SLionel Sambuc(
199911be35a1SLionel Sambuc  $as_echo "1. $at_setup_line: testing $at_desc ..."
200011be35a1SLionel Sambuc  $at_traceon
200111be35a1SLionel Sambuc
200211be35a1SLionel Sambuc
200311be35a1SLionel Sambuc
200411be35a1SLionel Sambuc
200511be35a1SLionel Sambuc    cat >Kyuafile <<'_ATEOF'
200611be35a1SLionel Sambuc
200711be35a1SLionel Sambucsyntax(2)
200811be35a1SLionel Sambuctest_suite("bootstrap")
200911be35a1SLionel Sambucatf_test_program{name="plain_helpers"}
201011be35a1SLionel Sambuc_ATEOF
201111be35a1SLionel Sambuc
201211be35a1SLionel Sambuc    ln -s $({
201311be35a1SLionel Sambuc    old=$(pwd)
201411be35a1SLionel Sambuc    cd "${at_suite_dir}"
201511be35a1SLionel Sambuc    # We need to locate a build product, not a source file, because the
201611be35a1SLionel Sambuc    # test suite may be run outside of the source tree (think distcheck).
201711be35a1SLionel Sambuc    while test $(pwd) != '/' -a ! -e engine/test_case_test; do
201811be35a1SLionel Sambuc        cd ..
201911be35a1SLionel Sambuc    done
202011be35a1SLionel Sambuc    topdir=$(pwd)
202111be35a1SLionel Sambuc    cd ${old}
202211be35a1SLionel Sambuc    echo ${topdir}
202311be35a1SLionel Sambuc})/bootstrap/plain_helpers plain_helpers
202411be35a1SLionel Sambuc
202511be35a1SLionel Sambuc{ set +x
202611be35a1SLionel Sambuc$as_echo "$at_srcdir/testsuite.at:74: HOME=\$(pwd) HELPER=\"abort_test_cases_list\" kyua --config=none test --store=bootstrap.db"
202711be35a1SLionel Sambucat_fn_check_prepare_notrace 'a $(...) command substitution' "testsuite.at:74"
202811be35a1SLionel Sambuc( $at_check_trace; HOME=$(pwd) HELPER="abort_test_cases_list" kyua --config=none test --store=bootstrap.db
202911be35a1SLionel Sambuc) >>"$at_stdout" 2>>"$at_stderr" 5>&-
203011be35a1SLionel Sambucat_status=$? at_failed=false
203111be35a1SLionel Sambuc$at_check_filter
203211be35a1SLionel Sambucat_fn_diff_devnull "$at_stderr" || at_failed=:
203311be35a1SLionel Sambucecho stdout:; tee stdout <"$at_stdout"
203411be35a1SLionel Sambucat_fn_check_status 1 $at_status "$at_srcdir/testsuite.at:74"
203511be35a1SLionel Sambuc$at_failed && at_fn_log_failure
203611be35a1SLionel Sambuc$at_traceon; }
203711be35a1SLionel Sambuc
203811be35a1SLionel Sambucre='plain_helpers:__test_cases_list__.*broken.*Test program list did not return success'
203911be35a1SLionel Sambuc{ set +x
204011be35a1SLionel Sambuc$as_echo "$at_srcdir/testsuite.at:76: grep \"\${re}\" stdout"
204111be35a1SLionel Sambucat_fn_check_prepare_notrace 'a ${...} parameter expansion' "testsuite.at:76"
204211be35a1SLionel Sambuc( $at_check_trace; grep "${re}" stdout
204311be35a1SLionel Sambuc) >>"$at_stdout" 2>>"$at_stderr" 5>&-
204411be35a1SLionel Sambucat_status=$? at_failed=false
204511be35a1SLionel Sambuc$at_check_filter
204611be35a1SLionel Sambucat_fn_diff_devnull "$at_stderr" || at_failed=:
204711be35a1SLionel Sambucecho stdout:; cat "$at_stdout"
204811be35a1SLionel Sambucat_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:76"
204911be35a1SLionel Sambuc$at_failed && at_fn_log_failure
205011be35a1SLionel Sambuc$at_traceon; }
205111be35a1SLionel Sambuc
205211be35a1SLionel Sambuc
205311be35a1SLionel Sambuc  set +x
205411be35a1SLionel Sambuc  $at_times_p && times >"$at_times_file"
205511be35a1SLionel Sambuc) 5>&1 2>&1 7>&- | eval $at_tee_pipe
205611be35a1SLionel Sambucread at_status <"$at_status_file"
205711be35a1SLionel Sambuc#AT_STOP_1
205811be35a1SLionel Sambuc#AT_START_2
205911be35a1SLionel Sambucat_fn_group_banner 2 'testsuite.at:81' \
206011be35a1SLionel Sambuc  "test program prints an empty test list" "         "
206111be35a1SLionel Sambucat_xfail=no
206211be35a1SLionel Sambuc(
206311be35a1SLionel Sambuc  $as_echo "2. $at_setup_line: testing $at_desc ..."
206411be35a1SLionel Sambuc  $at_traceon
206511be35a1SLionel Sambuc
206611be35a1SLionel Sambuc
206711be35a1SLionel Sambuc
206811be35a1SLionel Sambuc
206911be35a1SLionel Sambuc    cat >Kyuafile <<'_ATEOF'
207011be35a1SLionel Sambuc
207111be35a1SLionel Sambucsyntax(2)
207211be35a1SLionel Sambuctest_suite("bootstrap")
207311be35a1SLionel Sambucatf_test_program{name="plain_helpers"}
207411be35a1SLionel Sambuc_ATEOF
207511be35a1SLionel Sambuc
207611be35a1SLionel Sambuc    ln -s $({
207711be35a1SLionel Sambuc    old=$(pwd)
207811be35a1SLionel Sambuc    cd "${at_suite_dir}"
207911be35a1SLionel Sambuc    # We need to locate a build product, not a source file, because the
208011be35a1SLionel Sambuc    # test suite may be run outside of the source tree (think distcheck).
208111be35a1SLionel Sambuc    while test $(pwd) != '/' -a ! -e engine/test_case_test; do
208211be35a1SLionel Sambuc        cd ..
208311be35a1SLionel Sambuc    done
208411be35a1SLionel Sambuc    topdir=$(pwd)
208511be35a1SLionel Sambuc    cd ${old}
208611be35a1SLionel Sambuc    echo ${topdir}
208711be35a1SLionel Sambuc})/bootstrap/plain_helpers plain_helpers
208811be35a1SLionel Sambuc
208911be35a1SLionel Sambuc{ set +x
209011be35a1SLionel Sambuc$as_echo "$at_srcdir/testsuite.at:85: HOME=\$(pwd) HELPER=\"empty_test_cases_list\" kyua --config=none test --store=bootstrap.db"
209111be35a1SLionel Sambucat_fn_check_prepare_notrace 'a $(...) command substitution' "testsuite.at:85"
209211be35a1SLionel Sambuc( $at_check_trace; HOME=$(pwd) HELPER="empty_test_cases_list" kyua --config=none test --store=bootstrap.db
209311be35a1SLionel Sambuc) >>"$at_stdout" 2>>"$at_stderr" 5>&-
209411be35a1SLionel Sambucat_status=$? at_failed=false
209511be35a1SLionel Sambuc$at_check_filter
209611be35a1SLionel Sambucat_fn_diff_devnull "$at_stderr" || at_failed=:
209711be35a1SLionel Sambucecho stdout:; tee stdout <"$at_stdout"
209811be35a1SLionel Sambucat_fn_check_status 1 $at_status "$at_srcdir/testsuite.at:85"
209911be35a1SLionel Sambuc$at_failed && at_fn_log_failure
210011be35a1SLionel Sambuc$at_traceon; }
210111be35a1SLionel Sambuc
210211be35a1SLionel Sambucre='plain_helpers:__test_cases_list__.*broken.*failed to read.*unexpected EOF'
210311be35a1SLionel Sambuc{ set +x
210411be35a1SLionel Sambuc$as_echo "$at_srcdir/testsuite.at:87: grep \"\${re}\" stdout"
210511be35a1SLionel Sambucat_fn_check_prepare_notrace 'a ${...} parameter expansion' "testsuite.at:87"
210611be35a1SLionel Sambuc( $at_check_trace; grep "${re}" stdout
210711be35a1SLionel Sambuc) >>"$at_stdout" 2>>"$at_stderr" 5>&-
210811be35a1SLionel Sambucat_status=$? at_failed=false
210911be35a1SLionel Sambuc$at_check_filter
211011be35a1SLionel Sambucat_fn_diff_devnull "$at_stderr" || at_failed=:
211111be35a1SLionel Sambucecho stdout:; cat "$at_stdout"
211211be35a1SLionel Sambucat_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:87"
211311be35a1SLionel Sambuc$at_failed && at_fn_log_failure
211411be35a1SLionel Sambuc$at_traceon; }
211511be35a1SLionel Sambuc
211611be35a1SLionel Sambuc
211711be35a1SLionel Sambuc  set +x
211811be35a1SLionel Sambuc  $at_times_p && times >"$at_times_file"
211911be35a1SLionel Sambuc) 5>&1 2>&1 7>&- | eval $at_tee_pipe
212011be35a1SLionel Sambucread at_status <"$at_status_file"
212111be35a1SLionel Sambuc#AT_STOP_2
212211be35a1SLionel Sambuc#AT_START_3
212311be35a1SLionel Sambucat_fn_group_banner 3 'testsuite.at:92' \
212411be35a1SLionel Sambuc  "test program with zero test cases" "              "
212511be35a1SLionel Sambucat_xfail=no
212611be35a1SLionel Sambuc(
212711be35a1SLionel Sambuc  $as_echo "3. $at_setup_line: testing $at_desc ..."
212811be35a1SLionel Sambuc  $at_traceon
212911be35a1SLionel Sambuc
213011be35a1SLionel Sambuc
213111be35a1SLionel Sambuc
213211be35a1SLionel Sambuc
213311be35a1SLionel Sambuc    cat >Kyuafile <<'_ATEOF'
213411be35a1SLionel Sambuc
213511be35a1SLionel Sambucsyntax(2)
213611be35a1SLionel Sambuctest_suite("bootstrap")
213711be35a1SLionel Sambucatf_test_program{name="plain_helpers"}
213811be35a1SLionel Sambuc_ATEOF
213911be35a1SLionel Sambuc
214011be35a1SLionel Sambuc    ln -s $({
214111be35a1SLionel Sambuc    old=$(pwd)
214211be35a1SLionel Sambuc    cd "${at_suite_dir}"
214311be35a1SLionel Sambuc    # We need to locate a build product, not a source file, because the
214411be35a1SLionel Sambuc    # test suite may be run outside of the source tree (think distcheck).
214511be35a1SLionel Sambuc    while test $(pwd) != '/' -a ! -e engine/test_case_test; do
214611be35a1SLionel Sambuc        cd ..
214711be35a1SLionel Sambuc    done
214811be35a1SLionel Sambuc    topdir=$(pwd)
214911be35a1SLionel Sambuc    cd ${old}
215011be35a1SLionel Sambuc    echo ${topdir}
215111be35a1SLionel Sambuc})/bootstrap/plain_helpers plain_helpers
215211be35a1SLionel Sambuc
215311be35a1SLionel Sambuc{ set +x
215411be35a1SLionel Sambuc$as_echo "$at_srcdir/testsuite.at:96: HOME=\$(pwd) HELPER=\"zero_test_cases\" kyua --config=none test --store=bootstrap.db"
215511be35a1SLionel Sambucat_fn_check_prepare_notrace 'a $(...) command substitution' "testsuite.at:96"
215611be35a1SLionel Sambuc( $at_check_trace; HOME=$(pwd) HELPER="zero_test_cases" kyua --config=none test --store=bootstrap.db
215711be35a1SLionel Sambuc) >>"$at_stdout" 2>>"$at_stderr" 5>&-
215811be35a1SLionel Sambucat_status=$? at_failed=false
215911be35a1SLionel Sambuc$at_check_filter
216011be35a1SLionel Sambucat_fn_diff_devnull "$at_stderr" || at_failed=:
216111be35a1SLionel Sambucecho stdout:; tee stdout <"$at_stdout"
216211be35a1SLionel Sambucat_fn_check_status 1 $at_status "$at_srcdir/testsuite.at:96"
216311be35a1SLionel Sambuc$at_failed && at_fn_log_failure
216411be35a1SLionel Sambuc$at_traceon; }
216511be35a1SLionel Sambuc
216611be35a1SLionel Sambucre='plain_helpers:__test_cases_list__.*broken.*Empty test cases list'
216711be35a1SLionel Sambuc{ set +x
216811be35a1SLionel Sambuc$as_echo "$at_srcdir/testsuite.at:98: grep \"\${re}\" stdout"
216911be35a1SLionel Sambucat_fn_check_prepare_notrace 'a ${...} parameter expansion' "testsuite.at:98"
217011be35a1SLionel Sambuc( $at_check_trace; grep "${re}" stdout
217111be35a1SLionel Sambuc) >>"$at_stdout" 2>>"$at_stderr" 5>&-
217211be35a1SLionel Sambucat_status=$? at_failed=false
217311be35a1SLionel Sambuc$at_check_filter
217411be35a1SLionel Sambucat_fn_diff_devnull "$at_stderr" || at_failed=:
217511be35a1SLionel Sambucecho stdout:; cat "$at_stdout"
217611be35a1SLionel Sambucat_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:98"
217711be35a1SLionel Sambuc$at_failed && at_fn_log_failure
217811be35a1SLionel Sambuc$at_traceon; }
217911be35a1SLionel Sambuc
218011be35a1SLionel Sambuc
218111be35a1SLionel Sambuc  set +x
218211be35a1SLionel Sambuc  $at_times_p && times >"$at_times_file"
218311be35a1SLionel Sambuc) 5>&1 2>&1 7>&- | eval $at_tee_pipe
218411be35a1SLionel Sambucread at_status <"$at_status_file"
218511be35a1SLionel Sambuc#AT_STOP_3
218611be35a1SLionel Sambuc#AT_START_4
218711be35a1SLionel Sambucat_fn_group_banner 4 'testsuite.at:103' \
218811be35a1SLionel Sambuc  "run test case that passes" "                      "
218911be35a1SLionel Sambucat_xfail=no
219011be35a1SLionel Sambuc(
219111be35a1SLionel Sambuc  $as_echo "4. $at_setup_line: testing $at_desc ..."
219211be35a1SLionel Sambuc  $at_traceon
219311be35a1SLionel Sambuc
219411be35a1SLionel Sambuc
219511be35a1SLionel Sambuc
219611be35a1SLionel Sambuc
219711be35a1SLionel Sambuc    cat >Kyuafile <<'_ATEOF'
219811be35a1SLionel Sambuc
219911be35a1SLionel Sambucsyntax(2)
220011be35a1SLionel Sambuctest_suite("bootstrap")
220111be35a1SLionel Sambucatf_test_program{name="atf_helpers"}
220211be35a1SLionel Sambuc_ATEOF
220311be35a1SLionel Sambuc
220411be35a1SLionel Sambuc    ln -s $({
220511be35a1SLionel Sambuc    old=$(pwd)
220611be35a1SLionel Sambuc    cd "${at_suite_dir}"
220711be35a1SLionel Sambuc    # We need to locate a build product, not a source file, because the
220811be35a1SLionel Sambuc    # test suite may be run outside of the source tree (think distcheck).
220911be35a1SLionel Sambuc    while test $(pwd) != '/' -a ! -e engine/test_case_test; do
221011be35a1SLionel Sambuc        cd ..
221111be35a1SLionel Sambuc    done
221211be35a1SLionel Sambuc    topdir=$(pwd)
221311be35a1SLionel Sambuc    cd ${old}
221411be35a1SLionel Sambuc    echo ${topdir}
221511be35a1SLionel Sambuc})/bootstrap/atf_helpers atf_helpers
221611be35a1SLionel Sambuc
221711be35a1SLionel Sambuc{ set +x
221811be35a1SLionel Sambuc$as_echo "$at_srcdir/testsuite.at:107: HOME=\$(pwd) TESTS=\"passes\" kyua --config=none test --store=bootstrap.db "
221911be35a1SLionel Sambucat_fn_check_prepare_notrace 'a $(...) command substitution' "testsuite.at:107"
222011be35a1SLionel Sambuc( $at_check_trace; HOME=$(pwd) TESTS="passes" kyua --config=none test --store=bootstrap.db
222111be35a1SLionel Sambuc) >>"$at_stdout" 2>>"$at_stderr" 5>&-
222211be35a1SLionel Sambucat_status=$? at_failed=false
222311be35a1SLionel Sambuc$at_check_filter
222411be35a1SLionel Sambucat_fn_diff_devnull "$at_stderr" || at_failed=:
222511be35a1SLionel Sambucecho stdout:; tee stdout <"$at_stdout"
222611be35a1SLionel Sambucat_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:107"
222711be35a1SLionel Sambuc$at_failed && at_fn_log_failure
222811be35a1SLionel Sambuc$at_traceon; }
222911be35a1SLionel Sambuc
223011be35a1SLionel Sambuc{ set +x
223111be35a1SLionel Sambuc$as_echo "$at_srcdir/testsuite.at:108: grep \"atf_helpers:fails\" stdout"
223211be35a1SLionel Sambucat_fn_check_prepare_trace "testsuite.at:108"
223311be35a1SLionel Sambuc( $at_check_trace; grep "atf_helpers:fails" stdout
223411be35a1SLionel Sambuc) >>"$at_stdout" 2>>"$at_stderr" 5>&-
223511be35a1SLionel Sambucat_status=$? at_failed=false
223611be35a1SLionel Sambuc$at_check_filter
223711be35a1SLionel Sambucat_fn_diff_devnull "$at_stderr" || at_failed=:
223811be35a1SLionel Sambucat_fn_diff_devnull "$at_stdout" || at_failed=:
223911be35a1SLionel Sambucat_fn_check_status 1 $at_status "$at_srcdir/testsuite.at:108"
224011be35a1SLionel Sambuc$at_failed && at_fn_log_failure
224111be35a1SLionel Sambuc$at_traceon; }
224211be35a1SLionel Sambuc
224311be35a1SLionel Sambuc{ set +x
224411be35a1SLionel Sambuc$as_echo "$at_srcdir/testsuite.at:109: grep \"atf_helpers:passes.*passed\" stdout"
224511be35a1SLionel Sambucat_fn_check_prepare_trace "testsuite.at:109"
224611be35a1SLionel Sambuc( $at_check_trace; grep "atf_helpers:passes.*passed" stdout
224711be35a1SLionel Sambuc) >>"$at_stdout" 2>>"$at_stderr" 5>&-
224811be35a1SLionel Sambucat_status=$? at_failed=false
224911be35a1SLionel Sambuc$at_check_filter
225011be35a1SLionel Sambucat_fn_diff_devnull "$at_stderr" || at_failed=:
225111be35a1SLionel Sambucecho stdout:; cat "$at_stdout"
225211be35a1SLionel Sambucat_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:109"
225311be35a1SLionel Sambuc$at_failed && at_fn_log_failure
225411be35a1SLionel Sambuc$at_traceon; }
225511be35a1SLionel Sambuc
225611be35a1SLionel Sambuc{ set +x
225711be35a1SLionel Sambuc$as_echo "$at_srcdir/testsuite.at:110: grep \"atf_helpers:skips\" stdout"
225811be35a1SLionel Sambucat_fn_check_prepare_trace "testsuite.at:110"
225911be35a1SLionel Sambuc( $at_check_trace; grep "atf_helpers:skips" stdout
226011be35a1SLionel Sambuc) >>"$at_stdout" 2>>"$at_stderr" 5>&-
226111be35a1SLionel Sambucat_status=$? at_failed=false
226211be35a1SLionel Sambuc$at_check_filter
226311be35a1SLionel Sambucat_fn_diff_devnull "$at_stderr" || at_failed=:
226411be35a1SLionel Sambucat_fn_diff_devnull "$at_stdout" || at_failed=:
226511be35a1SLionel Sambucat_fn_check_status 1 $at_status "$at_srcdir/testsuite.at:110"
226611be35a1SLionel Sambuc$at_failed && at_fn_log_failure
226711be35a1SLionel Sambuc$at_traceon; }
226811be35a1SLionel Sambuc
226911be35a1SLionel Sambuc
227011be35a1SLionel Sambuc  set +x
227111be35a1SLionel Sambuc  $at_times_p && times >"$at_times_file"
227211be35a1SLionel Sambuc) 5>&1 2>&1 7>&- | eval $at_tee_pipe
227311be35a1SLionel Sambucread at_status <"$at_status_file"
227411be35a1SLionel Sambuc#AT_STOP_4
227511be35a1SLionel Sambuc#AT_START_5
227611be35a1SLionel Sambucat_fn_group_banner 5 'testsuite.at:115' \
227711be35a1SLionel Sambuc  "run test case that fails" "                       "
227811be35a1SLionel Sambucat_xfail=no
227911be35a1SLionel Sambuc(
228011be35a1SLionel Sambuc  $as_echo "5. $at_setup_line: testing $at_desc ..."
228111be35a1SLionel Sambuc  $at_traceon
228211be35a1SLionel Sambuc
228311be35a1SLionel Sambuc
228411be35a1SLionel Sambuc
228511be35a1SLionel Sambuc
228611be35a1SLionel Sambuc    cat >Kyuafile <<'_ATEOF'
228711be35a1SLionel Sambuc
228811be35a1SLionel Sambucsyntax(2)
228911be35a1SLionel Sambuctest_suite("bootstrap")
229011be35a1SLionel Sambucatf_test_program{name="atf_helpers"}
229111be35a1SLionel Sambuc_ATEOF
229211be35a1SLionel Sambuc
229311be35a1SLionel Sambuc    ln -s $({
229411be35a1SLionel Sambuc    old=$(pwd)
229511be35a1SLionel Sambuc    cd "${at_suite_dir}"
229611be35a1SLionel Sambuc    # We need to locate a build product, not a source file, because the
229711be35a1SLionel Sambuc    # test suite may be run outside of the source tree (think distcheck).
229811be35a1SLionel Sambuc    while test $(pwd) != '/' -a ! -e engine/test_case_test; do
229911be35a1SLionel Sambuc        cd ..
230011be35a1SLionel Sambuc    done
230111be35a1SLionel Sambuc    topdir=$(pwd)
230211be35a1SLionel Sambuc    cd ${old}
230311be35a1SLionel Sambuc    echo ${topdir}
230411be35a1SLionel Sambuc})/bootstrap/atf_helpers atf_helpers
230511be35a1SLionel Sambuc
230611be35a1SLionel Sambuc{ set +x
230711be35a1SLionel Sambuc$as_echo "$at_srcdir/testsuite.at:119: HOME=\$(pwd) TESTS=\"fails\" kyua --config=none test --store=bootstrap.db "
230811be35a1SLionel Sambucat_fn_check_prepare_notrace 'a $(...) command substitution' "testsuite.at:119"
230911be35a1SLionel Sambuc( $at_check_trace; HOME=$(pwd) TESTS="fails" kyua --config=none test --store=bootstrap.db
231011be35a1SLionel Sambuc) >>"$at_stdout" 2>>"$at_stderr" 5>&-
231111be35a1SLionel Sambucat_status=$? at_failed=false
231211be35a1SLionel Sambuc$at_check_filter
231311be35a1SLionel Sambucat_fn_diff_devnull "$at_stderr" || at_failed=:
231411be35a1SLionel Sambucecho stdout:; tee stdout <"$at_stdout"
231511be35a1SLionel Sambucat_fn_check_status 1 $at_status "$at_srcdir/testsuite.at:119"
231611be35a1SLionel Sambuc$at_failed && at_fn_log_failure
231711be35a1SLionel Sambuc$at_traceon; }
231811be35a1SLionel Sambuc
231911be35a1SLionel Sambuc{ set +x
232011be35a1SLionel Sambuc$as_echo "$at_srcdir/testsuite.at:120: grep \"atf_helpers:fails.*failed.*Failed on purpose\" stdout"
232111be35a1SLionel Sambucat_fn_check_prepare_trace "testsuite.at:120"
232211be35a1SLionel Sambuc( $at_check_trace; grep "atf_helpers:fails.*failed.*Failed on purpose" stdout
232311be35a1SLionel Sambuc) >>"$at_stdout" 2>>"$at_stderr" 5>&-
232411be35a1SLionel Sambucat_status=$? at_failed=false
232511be35a1SLionel Sambuc$at_check_filter
232611be35a1SLionel Sambucat_fn_diff_devnull "$at_stderr" || at_failed=:
232711be35a1SLionel Sambucecho stdout:; cat "$at_stdout"
232811be35a1SLionel Sambucat_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:120"
232911be35a1SLionel Sambuc$at_failed && at_fn_log_failure
233011be35a1SLionel Sambuc$at_traceon; }
233111be35a1SLionel Sambuc
233211be35a1SLionel Sambuc{ set +x
233311be35a1SLionel Sambuc$as_echo "$at_srcdir/testsuite.at:122: grep \"atf_helpers:passes\" stdout"
233411be35a1SLionel Sambucat_fn_check_prepare_trace "testsuite.at:122"
233511be35a1SLionel Sambuc( $at_check_trace; grep "atf_helpers:passes" stdout
233611be35a1SLionel Sambuc) >>"$at_stdout" 2>>"$at_stderr" 5>&-
233711be35a1SLionel Sambucat_status=$? at_failed=false
233811be35a1SLionel Sambuc$at_check_filter
233911be35a1SLionel Sambucat_fn_diff_devnull "$at_stderr" || at_failed=:
234011be35a1SLionel Sambucat_fn_diff_devnull "$at_stdout" || at_failed=:
234111be35a1SLionel Sambucat_fn_check_status 1 $at_status "$at_srcdir/testsuite.at:122"
234211be35a1SLionel Sambuc$at_failed && at_fn_log_failure
234311be35a1SLionel Sambuc$at_traceon; }
234411be35a1SLionel Sambuc
234511be35a1SLionel Sambuc{ set +x
234611be35a1SLionel Sambuc$as_echo "$at_srcdir/testsuite.at:123: grep \"atf_helpers:skips\" stdout"
234711be35a1SLionel Sambucat_fn_check_prepare_trace "testsuite.at:123"
234811be35a1SLionel Sambuc( $at_check_trace; grep "atf_helpers:skips" stdout
234911be35a1SLionel Sambuc) >>"$at_stdout" 2>>"$at_stderr" 5>&-
235011be35a1SLionel Sambucat_status=$? at_failed=false
235111be35a1SLionel Sambuc$at_check_filter
235211be35a1SLionel Sambucat_fn_diff_devnull "$at_stderr" || at_failed=:
235311be35a1SLionel Sambucat_fn_diff_devnull "$at_stdout" || at_failed=:
235411be35a1SLionel Sambucat_fn_check_status 1 $at_status "$at_srcdir/testsuite.at:123"
235511be35a1SLionel Sambuc$at_failed && at_fn_log_failure
235611be35a1SLionel Sambuc$at_traceon; }
235711be35a1SLionel Sambuc
235811be35a1SLionel Sambuc
235911be35a1SLionel Sambuc  set +x
236011be35a1SLionel Sambuc  $at_times_p && times >"$at_times_file"
236111be35a1SLionel Sambuc) 5>&1 2>&1 7>&- | eval $at_tee_pipe
236211be35a1SLionel Sambucread at_status <"$at_status_file"
236311be35a1SLionel Sambuc#AT_STOP_5
236411be35a1SLionel Sambuc#AT_START_6
236511be35a1SLionel Sambucat_fn_group_banner 6 'testsuite.at:128' \
236611be35a1SLionel Sambuc  "run test case that skips" "                       "
236711be35a1SLionel Sambucat_xfail=no
236811be35a1SLionel Sambuc(
236911be35a1SLionel Sambuc  $as_echo "6. $at_setup_line: testing $at_desc ..."
237011be35a1SLionel Sambuc  $at_traceon
237111be35a1SLionel Sambuc
237211be35a1SLionel Sambuc
237311be35a1SLionel Sambuc
237411be35a1SLionel Sambuc
237511be35a1SLionel Sambuc    cat >Kyuafile <<'_ATEOF'
237611be35a1SLionel Sambuc
237711be35a1SLionel Sambucsyntax(2)
237811be35a1SLionel Sambuctest_suite("bootstrap")
237911be35a1SLionel Sambucatf_test_program{name="atf_helpers"}
238011be35a1SLionel Sambuc_ATEOF
238111be35a1SLionel Sambuc
238211be35a1SLionel Sambuc    ln -s $({
238311be35a1SLionel Sambuc    old=$(pwd)
238411be35a1SLionel Sambuc    cd "${at_suite_dir}"
238511be35a1SLionel Sambuc    # We need to locate a build product, not a source file, because the
238611be35a1SLionel Sambuc    # test suite may be run outside of the source tree (think distcheck).
238711be35a1SLionel Sambuc    while test $(pwd) != '/' -a ! -e engine/test_case_test; do
238811be35a1SLionel Sambuc        cd ..
238911be35a1SLionel Sambuc    done
239011be35a1SLionel Sambuc    topdir=$(pwd)
239111be35a1SLionel Sambuc    cd ${old}
239211be35a1SLionel Sambuc    echo ${topdir}
239311be35a1SLionel Sambuc})/bootstrap/atf_helpers atf_helpers
239411be35a1SLionel Sambuc
239511be35a1SLionel Sambuc{ set +x
239611be35a1SLionel Sambuc$as_echo "$at_srcdir/testsuite.at:132: HOME=\$(pwd) TESTS=\"skips\" kyua --config=none test --store=bootstrap.db "
239711be35a1SLionel Sambucat_fn_check_prepare_notrace 'a $(...) command substitution' "testsuite.at:132"
239811be35a1SLionel Sambuc( $at_check_trace; HOME=$(pwd) TESTS="skips" kyua --config=none test --store=bootstrap.db
239911be35a1SLionel Sambuc) >>"$at_stdout" 2>>"$at_stderr" 5>&-
240011be35a1SLionel Sambucat_status=$? at_failed=false
240111be35a1SLionel Sambuc$at_check_filter
240211be35a1SLionel Sambucat_fn_diff_devnull "$at_stderr" || at_failed=:
240311be35a1SLionel Sambucecho stdout:; tee stdout <"$at_stdout"
240411be35a1SLionel Sambucat_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:132"
240511be35a1SLionel Sambuc$at_failed && at_fn_log_failure
240611be35a1SLionel Sambuc$at_traceon; }
240711be35a1SLionel Sambuc
240811be35a1SLionel Sambuc{ set +x
240911be35a1SLionel Sambuc$as_echo "$at_srcdir/testsuite.at:133: grep \"atf_helpers:fails\" stdout"
241011be35a1SLionel Sambucat_fn_check_prepare_trace "testsuite.at:133"
241111be35a1SLionel Sambuc( $at_check_trace; grep "atf_helpers:fails" stdout
241211be35a1SLionel Sambuc) >>"$at_stdout" 2>>"$at_stderr" 5>&-
241311be35a1SLionel Sambucat_status=$? at_failed=false
241411be35a1SLionel Sambuc$at_check_filter
241511be35a1SLionel Sambucat_fn_diff_devnull "$at_stderr" || at_failed=:
241611be35a1SLionel Sambucat_fn_diff_devnull "$at_stdout" || at_failed=:
241711be35a1SLionel Sambucat_fn_check_status 1 $at_status "$at_srcdir/testsuite.at:133"
241811be35a1SLionel Sambuc$at_failed && at_fn_log_failure
241911be35a1SLionel Sambuc$at_traceon; }
242011be35a1SLionel Sambuc
242111be35a1SLionel Sambuc{ set +x
242211be35a1SLionel Sambuc$as_echo "$at_srcdir/testsuite.at:134: grep \"atf_helpers:passes\" stdout"
242311be35a1SLionel Sambucat_fn_check_prepare_trace "testsuite.at:134"
242411be35a1SLionel Sambuc( $at_check_trace; grep "atf_helpers:passes" stdout
242511be35a1SLionel Sambuc) >>"$at_stdout" 2>>"$at_stderr" 5>&-
242611be35a1SLionel Sambucat_status=$? at_failed=false
242711be35a1SLionel Sambuc$at_check_filter
242811be35a1SLionel Sambucat_fn_diff_devnull "$at_stderr" || at_failed=:
242911be35a1SLionel Sambucat_fn_diff_devnull "$at_stdout" || at_failed=:
243011be35a1SLionel Sambucat_fn_check_status 1 $at_status "$at_srcdir/testsuite.at:134"
243111be35a1SLionel Sambuc$at_failed && at_fn_log_failure
243211be35a1SLionel Sambuc$at_traceon; }
243311be35a1SLionel Sambuc
243411be35a1SLionel Sambuc{ set +x
243511be35a1SLionel Sambuc$as_echo "$at_srcdir/testsuite.at:135: grep \"atf_helpers:skips.*skipped.*Skipped on purpose\" stdout"
243611be35a1SLionel Sambucat_fn_check_prepare_trace "testsuite.at:135"
243711be35a1SLionel Sambuc( $at_check_trace; grep "atf_helpers:skips.*skipped.*Skipped on purpose" stdout
243811be35a1SLionel Sambuc) >>"$at_stdout" 2>>"$at_stderr" 5>&-
243911be35a1SLionel Sambucat_status=$? at_failed=false
244011be35a1SLionel Sambuc$at_check_filter
244111be35a1SLionel Sambucat_fn_diff_devnull "$at_stderr" || at_failed=:
244211be35a1SLionel Sambucecho stdout:; cat "$at_stdout"
244311be35a1SLionel Sambucat_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:135"
244411be35a1SLionel Sambuc$at_failed && at_fn_log_failure
244511be35a1SLionel Sambuc$at_traceon; }
244611be35a1SLionel Sambuc
244711be35a1SLionel Sambuc
244811be35a1SLionel Sambuc  set +x
244911be35a1SLionel Sambuc  $at_times_p && times >"$at_times_file"
245011be35a1SLionel Sambuc) 5>&1 2>&1 7>&- | eval $at_tee_pipe
245111be35a1SLionel Sambucread at_status <"$at_status_file"
245211be35a1SLionel Sambuc#AT_STOP_6
245311be35a1SLionel Sambuc#AT_START_7
245411be35a1SLionel Sambucat_fn_group_banner 7 'testsuite.at:141' \
245511be35a1SLionel Sambuc  "run two test cases, success" "                    "
245611be35a1SLionel Sambucat_xfail=no
245711be35a1SLionel Sambuc(
245811be35a1SLionel Sambuc  $as_echo "7. $at_setup_line: testing $at_desc ..."
245911be35a1SLionel Sambuc  $at_traceon
246011be35a1SLionel Sambuc
246111be35a1SLionel Sambuc
246211be35a1SLionel Sambuc
246311be35a1SLionel Sambuc
246411be35a1SLionel Sambuc    cat >Kyuafile <<'_ATEOF'
246511be35a1SLionel Sambuc
246611be35a1SLionel Sambucsyntax(2)
246711be35a1SLionel Sambuctest_suite("bootstrap")
246811be35a1SLionel Sambucatf_test_program{name="atf_helpers"}
246911be35a1SLionel Sambuc_ATEOF
247011be35a1SLionel Sambuc
247111be35a1SLionel Sambuc    ln -s $({
247211be35a1SLionel Sambuc    old=$(pwd)
247311be35a1SLionel Sambuc    cd "${at_suite_dir}"
247411be35a1SLionel Sambuc    # We need to locate a build product, not a source file, because the
247511be35a1SLionel Sambuc    # test suite may be run outside of the source tree (think distcheck).
247611be35a1SLionel Sambuc    while test $(pwd) != '/' -a ! -e engine/test_case_test; do
247711be35a1SLionel Sambuc        cd ..
247811be35a1SLionel Sambuc    done
247911be35a1SLionel Sambuc    topdir=$(pwd)
248011be35a1SLionel Sambuc    cd ${old}
248111be35a1SLionel Sambuc    echo ${topdir}
248211be35a1SLionel Sambuc})/bootstrap/atf_helpers atf_helpers
248311be35a1SLionel Sambuc
248411be35a1SLionel Sambuc{ set +x
248511be35a1SLionel Sambuc$as_echo "$at_srcdir/testsuite.at:145: HOME=\$(pwd) TESTS=\"passes skips\" kyua --config=none test --store=bootstrap.db "
248611be35a1SLionel Sambucat_fn_check_prepare_notrace 'a $(...) command substitution' "testsuite.at:145"
248711be35a1SLionel Sambuc( $at_check_trace; HOME=$(pwd) TESTS="passes skips" kyua --config=none test --store=bootstrap.db
248811be35a1SLionel Sambuc) >>"$at_stdout" 2>>"$at_stderr" 5>&-
248911be35a1SLionel Sambucat_status=$? at_failed=false
249011be35a1SLionel Sambuc$at_check_filter
249111be35a1SLionel Sambucat_fn_diff_devnull "$at_stderr" || at_failed=:
249211be35a1SLionel Sambucecho stdout:; tee stdout <"$at_stdout"
249311be35a1SLionel Sambucat_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:145"
249411be35a1SLionel Sambuc$at_failed && at_fn_log_failure
249511be35a1SLionel Sambuc$at_traceon; }
249611be35a1SLionel Sambuc
249711be35a1SLionel Sambuc{ set +x
249811be35a1SLionel Sambuc$as_echo "$at_srcdir/testsuite.at:146: grep \"atf_helpers:fails\" stdout"
249911be35a1SLionel Sambucat_fn_check_prepare_trace "testsuite.at:146"
250011be35a1SLionel Sambuc( $at_check_trace; grep "atf_helpers:fails" stdout
250111be35a1SLionel Sambuc) >>"$at_stdout" 2>>"$at_stderr" 5>&-
250211be35a1SLionel Sambucat_status=$? at_failed=false
250311be35a1SLionel Sambuc$at_check_filter
250411be35a1SLionel Sambucat_fn_diff_devnull "$at_stderr" || at_failed=:
250511be35a1SLionel Sambucat_fn_diff_devnull "$at_stdout" || at_failed=:
250611be35a1SLionel Sambucat_fn_check_status 1 $at_status "$at_srcdir/testsuite.at:146"
250711be35a1SLionel Sambuc$at_failed && at_fn_log_failure
250811be35a1SLionel Sambuc$at_traceon; }
250911be35a1SLionel Sambuc
251011be35a1SLionel Sambuc{ set +x
251111be35a1SLionel Sambuc$as_echo "$at_srcdir/testsuite.at:147: grep \"atf_helpers:passes.*passed\" stdout"
251211be35a1SLionel Sambucat_fn_check_prepare_trace "testsuite.at:147"
251311be35a1SLionel Sambuc( $at_check_trace; grep "atf_helpers:passes.*passed" stdout
251411be35a1SLionel Sambuc) >>"$at_stdout" 2>>"$at_stderr" 5>&-
251511be35a1SLionel Sambucat_status=$? at_failed=false
251611be35a1SLionel Sambuc$at_check_filter
251711be35a1SLionel Sambucat_fn_diff_devnull "$at_stderr" || at_failed=:
251811be35a1SLionel Sambucecho stdout:; cat "$at_stdout"
251911be35a1SLionel Sambucat_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:147"
252011be35a1SLionel Sambuc$at_failed && at_fn_log_failure
252111be35a1SLionel Sambuc$at_traceon; }
252211be35a1SLionel Sambuc
252311be35a1SLionel Sambuc{ set +x
252411be35a1SLionel Sambuc$as_echo "$at_srcdir/testsuite.at:148: grep \"atf_helpers:skips.*skipped.*Skipped on purpose\" stdout"
252511be35a1SLionel Sambucat_fn_check_prepare_trace "testsuite.at:148"
252611be35a1SLionel Sambuc( $at_check_trace; grep "atf_helpers:skips.*skipped.*Skipped on purpose" stdout
252711be35a1SLionel Sambuc) >>"$at_stdout" 2>>"$at_stderr" 5>&-
252811be35a1SLionel Sambucat_status=$? at_failed=false
252911be35a1SLionel Sambuc$at_check_filter
253011be35a1SLionel Sambucat_fn_diff_devnull "$at_stderr" || at_failed=:
253111be35a1SLionel Sambucecho stdout:; cat "$at_stdout"
253211be35a1SLionel Sambucat_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:148"
253311be35a1SLionel Sambuc$at_failed && at_fn_log_failure
253411be35a1SLionel Sambuc$at_traceon; }
253511be35a1SLionel Sambuc
253611be35a1SLionel Sambuc
253711be35a1SLionel Sambuc  set +x
253811be35a1SLionel Sambuc  $at_times_p && times >"$at_times_file"
253911be35a1SLionel Sambuc) 5>&1 2>&1 7>&- | eval $at_tee_pipe
254011be35a1SLionel Sambucread at_status <"$at_status_file"
254111be35a1SLionel Sambuc#AT_STOP_7
254211be35a1SLionel Sambuc#AT_START_8
254311be35a1SLionel Sambucat_fn_group_banner 8 'testsuite.at:154' \
254411be35a1SLionel Sambuc  "run two test cases, failure" "                    "
254511be35a1SLionel Sambucat_xfail=no
254611be35a1SLionel Sambuc(
254711be35a1SLionel Sambuc  $as_echo "8. $at_setup_line: testing $at_desc ..."
254811be35a1SLionel Sambuc  $at_traceon
254911be35a1SLionel Sambuc
255011be35a1SLionel Sambuc
255111be35a1SLionel Sambuc
255211be35a1SLionel Sambuc
255311be35a1SLionel Sambuc    cat >Kyuafile <<'_ATEOF'
255411be35a1SLionel Sambuc
255511be35a1SLionel Sambucsyntax(2)
255611be35a1SLionel Sambuctest_suite("bootstrap")
255711be35a1SLionel Sambucatf_test_program{name="atf_helpers"}
255811be35a1SLionel Sambuc_ATEOF
255911be35a1SLionel Sambuc
256011be35a1SLionel Sambuc    ln -s $({
256111be35a1SLionel Sambuc    old=$(pwd)
256211be35a1SLionel Sambuc    cd "${at_suite_dir}"
256311be35a1SLionel Sambuc    # We need to locate a build product, not a source file, because the
256411be35a1SLionel Sambuc    # test suite may be run outside of the source tree (think distcheck).
256511be35a1SLionel Sambuc    while test $(pwd) != '/' -a ! -e engine/test_case_test; do
256611be35a1SLionel Sambuc        cd ..
256711be35a1SLionel Sambuc    done
256811be35a1SLionel Sambuc    topdir=$(pwd)
256911be35a1SLionel Sambuc    cd ${old}
257011be35a1SLionel Sambuc    echo ${topdir}
257111be35a1SLionel Sambuc})/bootstrap/atf_helpers atf_helpers
257211be35a1SLionel Sambuc
257311be35a1SLionel Sambuc{ set +x
257411be35a1SLionel Sambuc$as_echo "$at_srcdir/testsuite.at:158: HOME=\$(pwd) TESTS=\"fails passes\" kyua --config=none test --store=bootstrap.db "
257511be35a1SLionel Sambucat_fn_check_prepare_notrace 'a $(...) command substitution' "testsuite.at:158"
257611be35a1SLionel Sambuc( $at_check_trace; HOME=$(pwd) TESTS="fails passes" kyua --config=none test --store=bootstrap.db
257711be35a1SLionel Sambuc) >>"$at_stdout" 2>>"$at_stderr" 5>&-
257811be35a1SLionel Sambucat_status=$? at_failed=false
257911be35a1SLionel Sambuc$at_check_filter
258011be35a1SLionel Sambucat_fn_diff_devnull "$at_stderr" || at_failed=:
258111be35a1SLionel Sambucecho stdout:; tee stdout <"$at_stdout"
258211be35a1SLionel Sambucat_fn_check_status 1 $at_status "$at_srcdir/testsuite.at:158"
258311be35a1SLionel Sambuc$at_failed && at_fn_log_failure
258411be35a1SLionel Sambuc$at_traceon; }
258511be35a1SLionel Sambuc
258611be35a1SLionel Sambuc{ set +x
258711be35a1SLionel Sambuc$as_echo "$at_srcdir/testsuite.at:159: grep \"atf_helpers:fails.*failure.*Failed on purpose\" stdout"
258811be35a1SLionel Sambucat_fn_check_prepare_trace "testsuite.at:159"
258911be35a1SLionel Sambuc( $at_check_trace; grep "atf_helpers:fails.*failure.*Failed on purpose" stdout
259011be35a1SLionel Sambuc) >>"$at_stdout" 2>>"$at_stderr" 5>&-
259111be35a1SLionel Sambucat_status=$? at_failed=false
259211be35a1SLionel Sambuc$at_check_filter
259311be35a1SLionel Sambucat_fn_diff_devnull "$at_stderr" || at_failed=:
259411be35a1SLionel Sambucat_fn_diff_devnull "$at_stdout" || at_failed=:
259511be35a1SLionel Sambucat_fn_check_status 1 $at_status "$at_srcdir/testsuite.at:159"
259611be35a1SLionel Sambuc$at_failed && at_fn_log_failure
259711be35a1SLionel Sambuc$at_traceon; }
259811be35a1SLionel Sambuc
259911be35a1SLionel Sambuc{ set +x
260011be35a1SLionel Sambuc$as_echo "$at_srcdir/testsuite.at:161: grep \"atf_helpers:passes.*passed\" stdout"
260111be35a1SLionel Sambucat_fn_check_prepare_trace "testsuite.at:161"
260211be35a1SLionel Sambuc( $at_check_trace; grep "atf_helpers:passes.*passed" stdout
260311be35a1SLionel Sambuc) >>"$at_stdout" 2>>"$at_stderr" 5>&-
260411be35a1SLionel Sambucat_status=$? at_failed=false
260511be35a1SLionel Sambuc$at_check_filter
260611be35a1SLionel Sambucat_fn_diff_devnull "$at_stderr" || at_failed=:
260711be35a1SLionel Sambucecho stdout:; cat "$at_stdout"
260811be35a1SLionel Sambucat_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:161"
260911be35a1SLionel Sambuc$at_failed && at_fn_log_failure
261011be35a1SLionel Sambuc$at_traceon; }
261111be35a1SLionel Sambuc
261211be35a1SLionel Sambuc{ set +x
261311be35a1SLionel Sambuc$as_echo "$at_srcdir/testsuite.at:162: grep \"atf_helpers:skips\" stdout"
261411be35a1SLionel Sambucat_fn_check_prepare_trace "testsuite.at:162"
261511be35a1SLionel Sambuc( $at_check_trace; grep "atf_helpers:skips" stdout
261611be35a1SLionel Sambuc) >>"$at_stdout" 2>>"$at_stderr" 5>&-
261711be35a1SLionel Sambucat_status=$? at_failed=false
261811be35a1SLionel Sambuc$at_check_filter
261911be35a1SLionel Sambucat_fn_diff_devnull "$at_stderr" || at_failed=:
262011be35a1SLionel Sambucat_fn_diff_devnull "$at_stdout" || at_failed=:
262111be35a1SLionel Sambucat_fn_check_status 1 $at_status "$at_srcdir/testsuite.at:162"
262211be35a1SLionel Sambuc$at_failed && at_fn_log_failure
262311be35a1SLionel Sambuc$at_traceon; }
262411be35a1SLionel Sambuc
262511be35a1SLionel Sambuc
262611be35a1SLionel Sambuc  set +x
262711be35a1SLionel Sambuc  $at_times_p && times >"$at_times_file"
262811be35a1SLionel Sambuc) 5>&1 2>&1 7>&- | eval $at_tee_pipe
262911be35a1SLionel Sambucread at_status <"$at_status_file"
263011be35a1SLionel Sambuc#AT_STOP_8
263111be35a1SLionel Sambuc#AT_START_9
263211be35a1SLionel Sambucat_fn_group_banner 9 'testsuite.at:167' \
263311be35a1SLionel Sambuc  "run mixed test cases" "                           "
263411be35a1SLionel Sambucat_xfail=no
263511be35a1SLionel Sambuc(
263611be35a1SLionel Sambuc  $as_echo "9. $at_setup_line: testing $at_desc ..."
263711be35a1SLionel Sambuc  $at_traceon
263811be35a1SLionel Sambuc
263911be35a1SLionel Sambuc
264011be35a1SLionel Sambuc
264111be35a1SLionel Sambuc
264211be35a1SLionel Sambuc    cat >Kyuafile <<'_ATEOF'
264311be35a1SLionel Sambuc
264411be35a1SLionel Sambucsyntax(2)
264511be35a1SLionel Sambuctest_suite("bootstrap")
264611be35a1SLionel Sambucatf_test_program{name="atf_helpers"}
264711be35a1SLionel Sambuc_ATEOF
264811be35a1SLionel Sambuc
264911be35a1SLionel Sambuc    ln -s $({
265011be35a1SLionel Sambuc    old=$(pwd)
265111be35a1SLionel Sambuc    cd "${at_suite_dir}"
265211be35a1SLionel Sambuc    # We need to locate a build product, not a source file, because the
265311be35a1SLionel Sambuc    # test suite may be run outside of the source tree (think distcheck).
265411be35a1SLionel Sambuc    while test $(pwd) != '/' -a ! -e engine/test_case_test; do
265511be35a1SLionel Sambuc        cd ..
265611be35a1SLionel Sambuc    done
265711be35a1SLionel Sambuc    topdir=$(pwd)
265811be35a1SLionel Sambuc    cd ${old}
265911be35a1SLionel Sambuc    echo ${topdir}
266011be35a1SLionel Sambuc})/bootstrap/atf_helpers atf_helpers
266111be35a1SLionel Sambuc
266211be35a1SLionel Sambuc{ set +x
266311be35a1SLionel Sambuc$as_echo "$at_srcdir/testsuite.at:171: HOME=\$(pwd) TESTS=\"fails passes skips\" kyua --config=none test --store=bootstrap.db "
266411be35a1SLionel Sambucat_fn_check_prepare_notrace 'a $(...) command substitution' "testsuite.at:171"
266511be35a1SLionel Sambuc( $at_check_trace; HOME=$(pwd) TESTS="fails passes skips" kyua --config=none test --store=bootstrap.db
266611be35a1SLionel Sambuc) >>"$at_stdout" 2>>"$at_stderr" 5>&-
266711be35a1SLionel Sambucat_status=$? at_failed=false
266811be35a1SLionel Sambuc$at_check_filter
266911be35a1SLionel Sambucat_fn_diff_devnull "$at_stderr" || at_failed=:
267011be35a1SLionel Sambucecho stdout:; tee stdout <"$at_stdout"
267111be35a1SLionel Sambucat_fn_check_status 1 $at_status "$at_srcdir/testsuite.at:171"
267211be35a1SLionel Sambuc$at_failed && at_fn_log_failure
267311be35a1SLionel Sambuc$at_traceon; }
267411be35a1SLionel Sambuc
267511be35a1SLionel Sambuc{ set +x
267611be35a1SLionel Sambuc$as_echo "$at_srcdir/testsuite.at:172: grep \"atf_helpers:fails.*failure.*Failed on purpose\" stdout"
267711be35a1SLionel Sambucat_fn_check_prepare_trace "testsuite.at:172"
267811be35a1SLionel Sambuc( $at_check_trace; grep "atf_helpers:fails.*failure.*Failed on purpose" stdout
267911be35a1SLionel Sambuc) >>"$at_stdout" 2>>"$at_stderr" 5>&-
268011be35a1SLionel Sambucat_status=$? at_failed=false
268111be35a1SLionel Sambuc$at_check_filter
268211be35a1SLionel Sambucat_fn_diff_devnull "$at_stderr" || at_failed=:
268311be35a1SLionel Sambucat_fn_diff_devnull "$at_stdout" || at_failed=:
268411be35a1SLionel Sambucat_fn_check_status 1 $at_status "$at_srcdir/testsuite.at:172"
268511be35a1SLionel Sambuc$at_failed && at_fn_log_failure
268611be35a1SLionel Sambuc$at_traceon; }
268711be35a1SLionel Sambuc
268811be35a1SLionel Sambuc{ set +x
268911be35a1SLionel Sambuc$as_echo "$at_srcdir/testsuite.at:174: grep \"atf_helpers:passes.*passed\" stdout"
269011be35a1SLionel Sambucat_fn_check_prepare_trace "testsuite.at:174"
269111be35a1SLionel Sambuc( $at_check_trace; grep "atf_helpers:passes.*passed" stdout
269211be35a1SLionel Sambuc) >>"$at_stdout" 2>>"$at_stderr" 5>&-
269311be35a1SLionel Sambucat_status=$? at_failed=false
269411be35a1SLionel Sambuc$at_check_filter
269511be35a1SLionel Sambucat_fn_diff_devnull "$at_stderr" || at_failed=:
269611be35a1SLionel Sambucecho stdout:; cat "$at_stdout"
269711be35a1SLionel Sambucat_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:174"
269811be35a1SLionel Sambuc$at_failed && at_fn_log_failure
269911be35a1SLionel Sambuc$at_traceon; }
270011be35a1SLionel Sambuc
270111be35a1SLionel Sambuc{ set +x
270211be35a1SLionel Sambuc$as_echo "$at_srcdir/testsuite.at:175: grep \"atf_helpers:skips.*skipped.*Skipped on purpose\" stdout"
270311be35a1SLionel Sambucat_fn_check_prepare_trace "testsuite.at:175"
270411be35a1SLionel Sambuc( $at_check_trace; grep "atf_helpers:skips.*skipped.*Skipped on purpose" stdout
270511be35a1SLionel Sambuc) >>"$at_stdout" 2>>"$at_stderr" 5>&-
270611be35a1SLionel Sambucat_status=$? at_failed=false
270711be35a1SLionel Sambuc$at_check_filter
270811be35a1SLionel Sambucat_fn_diff_devnull "$at_stderr" || at_failed=:
270911be35a1SLionel Sambucecho stdout:; cat "$at_stdout"
271011be35a1SLionel Sambucat_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:175"
271111be35a1SLionel Sambuc$at_failed && at_fn_log_failure
271211be35a1SLionel Sambuc$at_traceon; }
271311be35a1SLionel Sambuc
271411be35a1SLionel Sambuc
271511be35a1SLionel Sambuc  set +x
271611be35a1SLionel Sambuc  $at_times_p && times >"$at_times_file"
271711be35a1SLionel Sambuc) 5>&1 2>&1 7>&- | eval $at_tee_pipe
271811be35a1SLionel Sambucread at_status <"$at_status_file"
271911be35a1SLionel Sambuc#AT_STOP_9
272011be35a1SLionel Sambuc#AT_START_10
272111be35a1SLionel Sambucat_fn_group_banner 10 'testsuite.at:181' \
272211be35a1SLionel Sambuc  "run tests from build directories" "               "
272311be35a1SLionel Sambucat_xfail=no
272411be35a1SLionel Sambuc(
272511be35a1SLionel Sambuc  $as_echo "10. $at_setup_line: testing $at_desc ..."
272611be35a1SLionel Sambuc  $at_traceon
272711be35a1SLionel Sambuc
272811be35a1SLionel Sambuc
272911be35a1SLionel Sambuc
273011be35a1SLionel Sambuc
273111be35a1SLionel Sambuc    cat >Kyuafile <<'_ATEOF'
273211be35a1SLionel Sambuc
273311be35a1SLionel Sambucsyntax(2)
273411be35a1SLionel Sambuctest_suite("bootstrap")
273511be35a1SLionel Sambucatf_test_program{name="atf_helpers"}
273611be35a1SLionel Sambuc_ATEOF
273711be35a1SLionel Sambuc
273811be35a1SLionel Sambuc    ln -s $({
273911be35a1SLionel Sambuc    old=$(pwd)
274011be35a1SLionel Sambuc    cd "${at_suite_dir}"
274111be35a1SLionel Sambuc    # We need to locate a build product, not a source file, because the
274211be35a1SLionel Sambuc    # test suite may be run outside of the source tree (think distcheck).
274311be35a1SLionel Sambuc    while test $(pwd) != '/' -a ! -e engine/test_case_test; do
274411be35a1SLionel Sambuc        cd ..
274511be35a1SLionel Sambuc    done
274611be35a1SLionel Sambuc    topdir=$(pwd)
274711be35a1SLionel Sambuc    cd ${old}
274811be35a1SLionel Sambuc    echo ${topdir}
274911be35a1SLionel Sambuc})/bootstrap/atf_helpers atf_helpers
275011be35a1SLionel Sambuc
275111be35a1SLionel Sambuc{ set +x
275211be35a1SLionel Sambuc$as_echo "$at_srcdir/testsuite.at:185: mkdir src"
275311be35a1SLionel Sambucat_fn_check_prepare_trace "testsuite.at:185"
275411be35a1SLionel Sambuc( $at_check_trace; mkdir src
275511be35a1SLionel Sambuc) >>"$at_stdout" 2>>"$at_stderr" 5>&-
275611be35a1SLionel Sambucat_status=$? at_failed=false
275711be35a1SLionel Sambuc$at_check_filter
275811be35a1SLionel Sambucat_fn_diff_devnull "$at_stderr" || at_failed=:
275911be35a1SLionel Sambucat_fn_diff_devnull "$at_stdout" || at_failed=:
276011be35a1SLionel Sambucat_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:185"
276111be35a1SLionel Sambuc$at_failed && at_fn_log_failure
276211be35a1SLionel Sambuc$at_traceon; }
276311be35a1SLionel Sambuc
276411be35a1SLionel Sambuc{ set +x
276511be35a1SLionel Sambuc$as_echo "$at_srcdir/testsuite.at:186: mv Kyuafile src"
276611be35a1SLionel Sambucat_fn_check_prepare_trace "testsuite.at:186"
276711be35a1SLionel Sambuc( $at_check_trace; mv Kyuafile src
276811be35a1SLionel Sambuc) >>"$at_stdout" 2>>"$at_stderr" 5>&-
276911be35a1SLionel Sambucat_status=$? at_failed=false
277011be35a1SLionel Sambuc$at_check_filter
277111be35a1SLionel Sambucat_fn_diff_devnull "$at_stderr" || at_failed=:
277211be35a1SLionel Sambucat_fn_diff_devnull "$at_stdout" || at_failed=:
277311be35a1SLionel Sambucat_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:186"
277411be35a1SLionel Sambuc$at_failed && at_fn_log_failure
277511be35a1SLionel Sambuc$at_traceon; }
277611be35a1SLionel Sambuc
277711be35a1SLionel Sambuc{ set +x
277811be35a1SLionel Sambuc$as_echo "$at_srcdir/testsuite.at:187: mkdir obj"
277911be35a1SLionel Sambucat_fn_check_prepare_trace "testsuite.at:187"
278011be35a1SLionel Sambuc( $at_check_trace; mkdir obj
278111be35a1SLionel Sambuc) >>"$at_stdout" 2>>"$at_stderr" 5>&-
278211be35a1SLionel Sambucat_status=$? at_failed=false
278311be35a1SLionel Sambuc$at_check_filter
278411be35a1SLionel Sambucat_fn_diff_devnull "$at_stderr" || at_failed=:
278511be35a1SLionel Sambucat_fn_diff_devnull "$at_stdout" || at_failed=:
278611be35a1SLionel Sambucat_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:187"
278711be35a1SLionel Sambuc$at_failed && at_fn_log_failure
278811be35a1SLionel Sambuc$at_traceon; }
278911be35a1SLionel Sambuc
279011be35a1SLionel Sambuc{ set +x
279111be35a1SLionel Sambuc$as_echo "$at_srcdir/testsuite.at:188: mv atf_helpers obj"
279211be35a1SLionel Sambucat_fn_check_prepare_trace "testsuite.at:188"
279311be35a1SLionel Sambuc( $at_check_trace; mv atf_helpers obj
279411be35a1SLionel Sambuc) >>"$at_stdout" 2>>"$at_stderr" 5>&-
279511be35a1SLionel Sambucat_status=$? at_failed=false
279611be35a1SLionel Sambuc$at_check_filter
279711be35a1SLionel Sambucat_fn_diff_devnull "$at_stderr" || at_failed=:
279811be35a1SLionel Sambucat_fn_diff_devnull "$at_stdout" || at_failed=:
279911be35a1SLionel Sambucat_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:188"
280011be35a1SLionel Sambuc$at_failed && at_fn_log_failure
280111be35a1SLionel Sambuc$at_traceon; }
280211be35a1SLionel Sambuc
280311be35a1SLionel Sambuc{ set +x
280411be35a1SLionel Sambuc$as_echo "$at_srcdir/testsuite.at:189: HOME=\$(pwd) TESTS=\"fails passes skips\" kyua --config=none test --store=bootstrap.db --kyuafile=src/Kyuafile --build-root=obj"
280511be35a1SLionel Sambucat_fn_check_prepare_notrace 'a $(...) command substitution' "testsuite.at:189"
280611be35a1SLionel Sambuc( $at_check_trace; HOME=$(pwd) TESTS="fails passes skips" kyua --config=none test --store=bootstrap.db --kyuafile=src/Kyuafile --build-root=obj
280711be35a1SLionel Sambuc) >>"$at_stdout" 2>>"$at_stderr" 5>&-
280811be35a1SLionel Sambucat_status=$? at_failed=false
280911be35a1SLionel Sambuc$at_check_filter
281011be35a1SLionel Sambucat_fn_diff_devnull "$at_stderr" || at_failed=:
281111be35a1SLionel Sambucecho stdout:; tee stdout <"$at_stdout"
281211be35a1SLionel Sambucat_fn_check_status 1 $at_status "$at_srcdir/testsuite.at:189"
281311be35a1SLionel Sambuc$at_failed && at_fn_log_failure
281411be35a1SLionel Sambuc$at_traceon; }
281511be35a1SLionel Sambuc
281611be35a1SLionel Sambuc{ set +x
281711be35a1SLionel Sambuc$as_echo "$at_srcdir/testsuite.at:192: grep \"atf_helpers:fails.*failure.*Failed on purpose\" stdout"
281811be35a1SLionel Sambucat_fn_check_prepare_trace "testsuite.at:192"
281911be35a1SLionel Sambuc( $at_check_trace; grep "atf_helpers:fails.*failure.*Failed on purpose" stdout
282011be35a1SLionel Sambuc) >>"$at_stdout" 2>>"$at_stderr" 5>&-
282111be35a1SLionel Sambucat_status=$? at_failed=false
282211be35a1SLionel Sambuc$at_check_filter
282311be35a1SLionel Sambucat_fn_diff_devnull "$at_stderr" || at_failed=:
282411be35a1SLionel Sambucat_fn_diff_devnull "$at_stdout" || at_failed=:
282511be35a1SLionel Sambucat_fn_check_status 1 $at_status "$at_srcdir/testsuite.at:192"
282611be35a1SLionel Sambuc$at_failed && at_fn_log_failure
282711be35a1SLionel Sambuc$at_traceon; }
282811be35a1SLionel Sambuc
282911be35a1SLionel Sambuc{ set +x
283011be35a1SLionel Sambuc$as_echo "$at_srcdir/testsuite.at:194: grep \"atf_helpers:passes.*passed\" stdout"
283111be35a1SLionel Sambucat_fn_check_prepare_trace "testsuite.at:194"
283211be35a1SLionel Sambuc( $at_check_trace; grep "atf_helpers:passes.*passed" stdout
283311be35a1SLionel Sambuc) >>"$at_stdout" 2>>"$at_stderr" 5>&-
283411be35a1SLionel Sambucat_status=$? at_failed=false
283511be35a1SLionel Sambuc$at_check_filter
283611be35a1SLionel Sambucat_fn_diff_devnull "$at_stderr" || at_failed=:
283711be35a1SLionel Sambucecho stdout:; cat "$at_stdout"
283811be35a1SLionel Sambucat_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:194"
283911be35a1SLionel Sambuc$at_failed && at_fn_log_failure
284011be35a1SLionel Sambuc$at_traceon; }
284111be35a1SLionel Sambuc
284211be35a1SLionel Sambuc{ set +x
284311be35a1SLionel Sambuc$as_echo "$at_srcdir/testsuite.at:195: grep \"atf_helpers:skips.*skipped.*Skipped on purpose\" stdout"
284411be35a1SLionel Sambucat_fn_check_prepare_trace "testsuite.at:195"
284511be35a1SLionel Sambuc( $at_check_trace; grep "atf_helpers:skips.*skipped.*Skipped on purpose" stdout
284611be35a1SLionel Sambuc) >>"$at_stdout" 2>>"$at_stderr" 5>&-
284711be35a1SLionel Sambucat_status=$? at_failed=false
284811be35a1SLionel Sambuc$at_check_filter
284911be35a1SLionel Sambucat_fn_diff_devnull "$at_stderr" || at_failed=:
285011be35a1SLionel Sambucecho stdout:; cat "$at_stdout"
285111be35a1SLionel Sambucat_fn_check_status 0 $at_status "$at_srcdir/testsuite.at:195"
285211be35a1SLionel Sambuc$at_failed && at_fn_log_failure
285311be35a1SLionel Sambuc$at_traceon; }
285411be35a1SLionel Sambuc
285511be35a1SLionel Sambuc
285611be35a1SLionel Sambuc  set +x
285711be35a1SLionel Sambuc  $at_times_p && times >"$at_times_file"
285811be35a1SLionel Sambuc) 5>&1 2>&1 7>&- | eval $at_tee_pipe
285911be35a1SLionel Sambucread at_status <"$at_status_file"
286011be35a1SLionel Sambuc#AT_STOP_10
2861