📄 general.m4
字号:
at_save_IFS=$IFS IFS=, set X $at_optarg shift IFS=$at_save_IFS for at_keyword do at_invert= case $at_keyword in '!'*) at_invert="-v" at_keyword=`expr "X$at_keyword" : 'X!\(.*\)'` ;; esac # It is on purpose that we match the test group titles too. at_groups_selected=`echo "$at_groups_selected" | grep -i $at_invert ["^[1-9][^;]*;.*[; ]$at_keyword[ ;]"]` done at_groups_selected=`echo "$at_groups_selected" | sed 's/;.*//'` # Smash the newlines. at_groups="$at_groups`echo $at_groups_selected` " ;;m4_divert_pop([PARSE_ARGS])dnldnl Process *=* last to allow for user specified --option=* type arguments.m4_divert_push([PARSE_ARGS_END])dnl *=*) at_envvar=`expr "x$at_option" : 'x\([[^=]]*\)='` # Reject names that are not valid shell variable names. expr "x$at_envvar" : "[.*[^_$as_cr_alnum]]" >/dev/null && AS_ERROR([invalid variable name: $at_envvar]) at_value=`echo "$at_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$at_envvar='$at_value'" export $at_envvar # Propagate to debug scripts. at_debug_args="$at_debug_args $at_envvar='$at_value'" ;; *) echo "$as_me: invalid option: $at_option" >&2 echo "Try \`$[0] --help' for more information." >&2 exit 1 ;; esacdone# Selected test groups.if test -z "$at_groups"; then at_groups=$at_groups_allelse # Sort the tests, removing duplicates: at_groups=`echo $at_groups | tr ' ' "$as_nl" | sort -nu` # and add banners. (Passing at_groups_all is tricky--see the comment # starting with "Passing at_groups is tricky.") at_groups=`echo "$at_groups$as_nl $at_groups_all" | awk ['BEGIN { FS = "@" } # Effectively switch off field splitting. /^$/ { next } # Ignore the empty line. !/ / { groups++; selected[$ 0] = 1; next } # The last line, containing at_groups_all. { n = split($ 0, a, " ") # If there are several tests, select their banners: if (groups > 1) { for (i = 1; i <= n; i++) { if (a[i] ~ /^banner-/) banner = a[i] else if (banner != "" && selected[a[i]] == 1) selected[banner] = 1 } } for (i = 1; i <= n; i++) if (selected[a[i]] == 1) list = list " " a[i] print list }']`fim4_divert_pop([PARSE_ARGS_END])dnlm4_divert_push([HELP])dnl# Help message.if $at_help_p; then cat <<_ATEOFUsage: $[0] [[OPTION]... [VARIABLE=VALUE]... [TESTS]]Run all the tests, or the selected TESTS, given by numeric ranges, andsave a detailed log file. Upon failure, create debugging scripts.You should not change environment variables unless explicitly passedas command line arguments. Set \`AUTOTEST_PATH' to select the executablesto exercise. Each relative directory is expanded as build and sourcedirectories relatively to the top level of this distribution. E.g., $ $[0] AUTOTEST_PATH=binpossibly amounts into PATH=/tmp/foo-1.0/bin:/src/foo-1.0/bin:\$PATH_ATEOFm4_divert_pop([HELP])dnlm4_divert_push([HELP_MODES])dnlcat <<_ATEOFOperation modes: -h, --help print the help message, then exit -V, --version print version number, then exit -c, --clean remove all the files this test suite might create and exit -l, --list describes all the tests, or the selected TESTS_ATEOFm4_divert_pop([HELP_MODES])dnlm4_divert_push([HELP_TUNING])dnlcat <<_ATEOFExecution tuning: -k, --keywords=KEYWORDS select the tests matching all the comma-separated KEYWORDS multiple \`-k' accumulate; prefixed \`!' negates a KEYWORD -e, --errexit abort as soon as a test fails; implies --debug -v, --verbose force more detailed output default for debugging scripts -d, --debug inhibit clean up and top-level logging default for debugging scripts -x, --trace enable tests shell tracing_ATEOFm4_divert_pop([HELP_TUNING])dnlm4_divert_push([HELP_END])dnlcat <<_ATEOFReport bugs to <AT_PACKAGE_BUGREPORT>._ATEOF exit 0fi# List of tests.if $at_list_p; then cat <<_ATEOFAT_TESTSUITE_NAME test groups: NUM: FILE-NAME:LINE TEST-GROUP-NAME KEYWORDS_ATEOF # Passing at_groups is tricky. We cannot use it to form a literal string # or regexp because of the limitation of AIX awk. And Solaris' awk # doesn't grok more than 99 fields in a record, so we have to use `split'. echo "$at_groups$as_nl$at_help_all" | awk 'BEGIN { FS = ";" } NR == 1 { for (n = split($ 0, a, " "); n; n--) selected[[a[n]]] = 1 next } { if (selected[[$ 1]]) { printf " %3d: %-18s %s\n", $ 1, $ 2, $ 3 if ($ 4) printf " %s\n", $ 4 } }' exit 0fim4_divert_pop([HELP_END])dnlm4_divert_push([VERSION])dnlif $at_version_p; then echo "$as_me (AT_PACKAGE_STRING)" cat <<\_ACEOFm4_divert_pop([VERSION])dnlm4_divert_push([VERSION_END])dnl_ACEOF exit 0fim4_divert_pop([VERSION_END])dnlm4_divert_push([PREPARE_TESTS])dnl# Don't take risks: use only absolute directories in PATH.## For stand-alone test suites, AUTOTEST_PATH is relative to `.'.## For embedded test suites, AUTOTEST_PATH is relative to the top level# of the package. Then expand it into build/src parts, since users# may create executables in both places.AUTOTEST_PATH=`echo $AUTOTEST_PATH | sed "s&:&$PATH_SEPARATOR&g"`at_path=_AS_PATH_WALK([$AUTOTEST_PATH $PATH],[test -n "$at_path" && at_path=$at_path$PATH_SEPARATORcase $as_dir in [[\\/]]* | ?:[[\\/]]* ) at_path=$at_path$as_dir ;; * ) if test -z "$at_top_build_prefix"; then # Stand-alone test suite. at_path=$at_path$as_dir else # Embedded test suite. at_path=$at_path$at_top_build_prefix$as_dir$PATH_SEPARATOR at_path=$at_path$at_top_srcdir/$as_dir fi ;;esac])# Now build and simplify PATH.## There might be directories that don't exist, but don't redirect# builtins' (eg., cd) stderr directly: Ultrix's sh hates that.PATH=_AS_PATH_WALK([$at_path],[as_dir=`(cd "$as_dir" && pwd) 2>/dev/null`test -d "$as_dir" || continuecase $PATH in $as_dir | \ $as_dir$PATH_SEPARATOR* | \ *$PATH_SEPARATOR$as_dir | \ *$PATH_SEPARATOR$as_dir$PATH_SEPARATOR* ) ;; '') PATH=$as_dir ;; *) PATH=$PATH$PATH_SEPARATOR$as_dir ;;esac])export PATH# Setting up the FDs.# 5 is the log file. Not to be overwritten if `-d'.m4_define([AS_MESSAGE_LOG_FD], [5])if $at_debug_p; then at_suite_log=/dev/nullelse : >"$at_suite_log"fiexec AS_MESSAGE_LOG_FD>>"$at_suite_log"# Banners and logs.AS_BOX(m4_defn([AT_TESTSUITE_NAME])[.]){ AS_BOX(m4_defn([AT_TESTSUITE_NAME])[.]) echo echo "$as_me: command line was:" echo " $ $[0] $at_cli_args" echo # Try to find a few ChangeLogs in case it might help determining the # exact version. Use the relative dir: if the top dir is a symlink, # find will not follow it (and options to follow the links are not # portable), which would result in no output here. if test -n "$at_top_srcdir"; then AS_BOX([ChangeLogs.]) echo for at_file in `find "$at_top_srcdir" -name ChangeLog -print` do echo "$as_me: $at_file:" sed 's/^/| /;10q' $at_file echo done AS_UNAME echo fi # Contents of the config files. for at_file in atconfig atlocal do test -r $at_file || continue echo "$as_me: $at_file:" sed 's/^/| /' $at_file echo done AS_BOX([Tested programs.]) echo} >&AS_MESSAGE_LOG_FD# Report what programs are being tested.for at_program in : $at_testeddo test "$at_program" = : && continue _AS_PATH_WALK([$PATH], [test -f "$as_dir/$at_program" && break]) if test -f "$as_dir/$at_program"; then { echo "$at_srcdir/AT_LINE: $as_dir/$at_program --version" "$as_dir/$at_program" --version echo } >&AS_MESSAGE_LOG_FD 2>&1 else AS_ERROR([cannot find $at_program]) fidone{ AS_BOX([Running the tests.])} >&AS_MESSAGE_LOG_FDat_start_date=`date`at_start_time=`date +%s 2>/dev/null`echo "$as_me: starting at: $at_start_date" >&AS_MESSAGE_LOG_FDat_xpass_list=at_xfail_list=at_pass_list=at_fail_list=at_skip_list=at_group_count=0m4_divert_pop([PREPARE_TESTS])dnlm4_divert_push([TESTS])dnl# Create the master directory if it doesn't already exist.test -d "$at_suite_dir" || mkdir "$at_suite_dir" || AS_ERROR([cannot create '$at_suite_dir'])# Can we diff with `/dev/null'? DU 5.0 refuses.if diff /dev/null /dev/null >/dev/null 2>&1; then at_devnull=/dev/nullelse at_devnull=$at_suite_dir/devnull >"$at_devnull"fi# Use `diff -u' when possible.if at_diff=`diff -u "$at_devnull" "$at_devnull" 2>&1` && test -z "$at_diff"then at_diff='diff -u'else at_diff=difffifor at_group in $at_groupsdo # Be sure to come back to the top test directory. cd "$at_suite_dir" case $at_group in banner-*) at_group_log=$at_suite_log ;; *) at_group_normalized=$at_group _AT_NORMALIZE_TEST_GROUP_NUMBER(at_group_normalized) # Create a fresh directory for the next test group, and enter. at_group_dir=$at_suite_dir/$at_group_normalized at_group_log=$at_group_dir/$as_me.log if test -d "$at_group_dir"; then find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \; rm -fr "$at_group_dir" fi # Be tolerant if the above `rm' was not able to remove the directory. AS_MKDIR_P([$at_group_dir]) cd $at_group_dir ;; esac echo 0 > "$at_status_file" # Clearly separate the test groups when verbose. test $at_group_count != 0 && $at_verbose # In verbose mode, append to the log file *and* show on # the standard output; in quiet mode only write to the log if test $at_verbose = echo; then at_tee_pipe='tee -a "$at_group_log"' else at_tee_pipe='cat >> "$at_group_log"' fi case $at_group indnl Test groups inserted here (TESTS).m4_divert_pop([TESTS])[]dnlm4_divert_push([TESTS_END])[]dnl * ) echo "$as_me: no such test group: $at_group" >&2 continue ;; esac # Be sure to come back to the suite directory, in particular # since below we might `rm' the group directory we are in currently. cd "$at_suite_dir" case $at_group in banner-*) ;; *) if test ! -f "$at_check_line_file"; then sed "s/^ */$as_me: warning: /" <<_ATEOF
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -