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