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