126 |
m4_define([AT_INIT], |
m4_define([AT_INIT], |
127 |
[m4_pattern_forbid([^_?AT_]) |
[m4_pattern_forbid([^_?AT_]) |
128 |
m4_define([AT_TESTSUITE_NAME], |
m4_define([AT_TESTSUITE_NAME], |
129 |
m4_defn([AT_PACKAGE_STRING])[ test suite]m4_ifval([$1], [: $1])) |
m4_defn([AT_PACKAGE_STRING])[ test suite]m4_ifval([$1], [: $1])) |
130 |
m4_define([AT_ordinal], 0) |
m4_define([AT_ordinal], 0) |
131 |
m4_define([AT_banner_ordinal], 0) |
m4_define([AT_banner_ordinal], 0) |
132 |
AS_INIT |
AS_INIT |
224 |
|
|
225 |
case $at_option in |
case $at_option in |
226 |
--help | -h ) |
--help | -h ) |
227 |
at_help_p=: |
at_help_p=: |
228 |
;; |
;; |
229 |
|
|
230 |
--list | -l ) |
--list | -l ) |
231 |
at_list_p=: |
at_list_p=: |
232 |
;; |
;; |
233 |
|
|
234 |
--version | -V ) |
--version | -V ) |
235 |
echo "$as_me (AT_PACKAGE_STRING)" |
echo "$as_me (AT_PACKAGE_STRING)" |
236 |
exit 0 |
exit 0 |
237 |
;; |
;; |
238 |
|
|
239 |
--clean | -c ) |
--clean | -c ) |
240 |
rm -rf $at_suite_dir $as_me.log |
rm -rf $at_suite_dir $as_me.log |
241 |
exit 0 |
exit 0 |
242 |
;; |
;; |
243 |
|
|
244 |
--debug | -d ) |
--debug | -d ) |
245 |
at_debug_p=: |
at_debug_p=: |
246 |
;; |
;; |
247 |
|
|
248 |
--errexit | -e ) |
--errexit | -e ) |
249 |
at_debug_p=: |
at_debug_p=: |
250 |
at_errexit_p=: |
at_errexit_p=: |
251 |
;; |
;; |
252 |
|
|
253 |
--verbose | -v ) |
--verbose | -v ) |
254 |
at_verbose=echo; at_quiet=: |
at_verbose=echo; at_quiet=: |
255 |
;; |
;; |
256 |
|
|
257 |
--trace | -x ) |
--trace | -x ) |
258 |
at_traceon='set -vx'; at_traceoff='set +vx' |
at_traceon='set -vx'; at_traceoff='set +vx' |
259 |
;; |
;; |
260 |
|
|
261 |
[[0-9] | [0-9][0-9] | [0-9][0-9][0-9] | [0-9][0-9][0-9][0-9]]) |
[[0-9] | [0-9][0-9] | [0-9][0-9][0-9] | [0-9][0-9][0-9][0-9]]) |
262 |
at_groups="$at_groups$at_option " |
at_groups="$at_groups$at_option " |
263 |
;; |
;; |
264 |
|
|
265 |
# Ranges |
# Ranges |
266 |
[[0-9]- | [0-9][0-9]- | [0-9][0-9][0-9]- | [0-9][0-9][0-9][0-9]-]) |
[[0-9]- | [0-9][0-9]- | [0-9][0-9][0-9]- | [0-9][0-9][0-9][0-9]-]) |
267 |
at_range_start=`echo $at_option |tr -d '-'` |
at_range_start=`echo $at_option |tr -d '-'` |
268 |
at_range=`echo " $at_groups_all " | \ |
at_range=`echo " $at_groups_all " | \ |
269 |
sed -e 's,^.* '$at_range_start' ,'$at_range_start' ,'` |
sed -e 's,^.* '$at_range_start' ,'$at_range_start' ,'` |
270 |
at_groups="$at_groups$at_range " |
at_groups="$at_groups$at_range " |
271 |
;; |
;; |
272 |
|
|
273 |
[-[0-9] | -[0-9][0-9] | -[0-9][0-9][0-9] | -[0-9][0-9][0-9][0-9]]) |
[-[0-9] | -[0-9][0-9] | -[0-9][0-9][0-9] | -[0-9][0-9][0-9][0-9]]) |
274 |
at_range_end=`echo $at_option |tr -d '-'` |
at_range_end=`echo $at_option |tr -d '-'` |
275 |
at_range=`echo " $at_groups_all " | \ |
at_range=`echo " $at_groups_all " | \ |
276 |
sed -e 's, '$at_range_end' .*$, '$at_range_end','` |
sed -e 's, '$at_range_end' .*$, '$at_range_end','` |
277 |
at_groups="$at_groups$at_range " |
at_groups="$at_groups$at_range " |
278 |
;; |
;; |
279 |
|
|
280 |
[[0-9]-[0-9] | [0-9]-[0-9][0-9] | [0-9]-[0-9][0-9][0-9]] | \ |
[[0-9]-[0-9] | [0-9]-[0-9][0-9] | [0-9]-[0-9][0-9][0-9]] | \ |
281 |
[[0-9]-[0-9][0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9]] | \ |
[[0-9]-[0-9][0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9]] | \ |
283 |
[[0-9][0-9][0-9]-[0-9][0-9][0-9]] | \ |
[[0-9][0-9][0-9]-[0-9][0-9][0-9]] | \ |
284 |
[[0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]] | \ |
[[0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]] | \ |
285 |
[[0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]] ) |
[[0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]] ) |
286 |
at_range_start=`echo $at_option |sed 's,-.*,,'` |
at_range_start=`echo $at_option |sed 's,-.*,,'` |
287 |
at_range_end=`echo $at_option |sed 's,.*-,,'` |
at_range_end=`echo $at_option |sed 's,.*-,,'` |
288 |
# FIXME: Maybe test to make sure start <= end? |
# FIXME: Maybe test to make sure start <= end? |
289 |
at_range=`echo " $at_groups_all " | \ |
at_range=`echo " $at_groups_all " | \ |
290 |
sed -e 's,^.* '$at_range_start' ,'$at_range_start' ,' \ |
sed -e 's,^.* '$at_range_start' ,'$at_range_start' ,' \ |
291 |
-e 's, '$at_range_end' .*$, '$at_range_end','` |
-e 's, '$at_range_end' .*$, '$at_range_end','` |
292 |
at_groups="$at_groups$at_range " |
at_groups="$at_groups$at_range " |
293 |
;; |
;; |
294 |
|
|
295 |
# Keywords. |
# Keywords. |
296 |
--keywords | -k ) |
--keywords | -k ) |
316 |
;; |
;; |
317 |
|
|
318 |
*) echo "$as_me: invalid option: $at_option" >&2 |
*) echo "$as_me: invalid option: $at_option" >&2 |
319 |
echo "Try \`$[0] --help' for more information." >&2 |
echo "Try \`$[0] --help' for more information." >&2 |
320 |
exit 1 |
exit 1 |
321 |
;; |
;; |
322 |
esac |
esac |
323 |
done |
done |
324 |
|
|
377 |
|
|
378 |
Execution tuning: |
Execution tuning: |
379 |
-k, --keywords=KEYWORDS |
-k, --keywords=KEYWORDS |
380 |
select the tests matching all the comma separated KEYWORDS |
select the tests matching all the comma separated KEYWORDS |
381 |
accumulates |
accumulates |
382 |
-e, --errexit abort as soon as a test fails; implies --debug |
-e, --errexit abort as soon as a test fails; implies --debug |
383 |
-v, --verbose force more detailed output |
-v, --verbose force more detailed output |
384 |
default for debugging scripts |
default for debugging scripts |
385 |
-d, --debug inhibit clean up and debug script creation |
-d, --debug inhibit clean up and debug script creation |
386 |
default for debugging scripts |
default for debugging scripts |
387 |
-x, --trace enable tests shell tracing |
-x, --trace enable tests shell tracing |
388 |
_ATEOF |
_ATEOF |
389 |
m4_divert_pop([HELP_TUNING])dnl |
m4_divert_pop([HELP_TUNING])dnl |
408 |
at_groups_pattern=`echo "$at_groups" | sed 's/^ *//;s/ *$//;s/ */|/g'` |
at_groups_pattern=`echo "$at_groups" | sed 's/^ *//;s/ *$//;s/ */|/g'` |
409 |
echo "$at_help_all" | |
echo "$at_help_all" | |
410 |
awk 'BEGIN { FS = ";" } |
awk 'BEGIN { FS = ";" } |
411 |
{ if ($[1] !~ /^('"$at_groups_pattern"')$/) next } |
{ if ($[1] !~ /^('"$at_groups_pattern"')$/) next } |
412 |
{ if ($[1]) printf " %3d: %-18s %s\n", $[1], $[2], $[3] |
{ if ($[1]) printf " %3d: %-18s %s\n", $[1], $[2], $[3] |
413 |
if ($[4]) printf " %s\n", $[4] } ' |
if ($[4]) printf " %s\n", $[4] } ' |
414 |
exit 0 |
exit 0 |
415 |
fi |
fi |
416 |
m4_divert_pop([HELP_END])dnl |
m4_divert_pop([HELP_END])dnl |
451 |
[as_dir=`(cd "$as_dir" && pwd) 2>/dev/null` |
[as_dir=`(cd "$as_dir" && pwd) 2>/dev/null` |
452 |
test -d "$as_dir" || continue |
test -d "$as_dir" || continue |
453 |
case $PATH in |
case $PATH in |
454 |
$as_dir | \ |
$as_dir | \ |
455 |
$as_dir$PATH_SEPARATOR* | \ |
$as_dir$PATH_SEPARATOR* | \ |
456 |
*$PATH_SEPARATOR$as_dir | \ |
*$PATH_SEPARATOR$as_dir | \ |
457 |
*$PATH_SEPARATOR$as_dir$PATH_SEPARATOR* ) ;; |
*$PATH_SEPARATOR$as_dir$PATH_SEPARATOR* ) ;; |
458 |
|
|
617 |
banner-*) ;; |
banner-*) ;; |
618 |
*) |
*) |
619 |
if test ! -f $at_check_line_file; then |
if test ! -f $at_check_line_file; then |
620 |
sed "s/^ */$as_me: warning: /" <<_ATEOF |
sed "s/^ */$as_me: warning: /" <<_ATEOF |
621 |
A failure happened in a test group before any test could be |
A failure happened in a test group before any test could be |
622 |
run. This means that test suite is improperly designed. Please |
run. This means that test suite is improperly designed. Please |
623 |
report this failure to <AT_PACKAGE_BUGREPORT>. |
report this failure to <AT_PACKAGE_BUGREPORT>. |
624 |
_ATEOF |
_ATEOF |
625 |
echo "$at_setup_line" >$at_check_line_file |
echo "$at_setup_line" >$at_check_line_file |
626 |
fi |
fi |
627 |
at_group_count=`expr 1 + $at_group_count` |
at_group_count=`expr 1 + $at_group_count` |
628 |
$at_verbose $ECHO_N "$at_group. $at_setup_line: $ECHO_C" |
$at_verbose $ECHO_N "$at_group. $at_setup_line: $ECHO_C" |
629 |
case $at_status in |
case $at_status in |
630 |
0) at_msg="ok" |
0) at_msg="ok" |
631 |
at_pass_list="$at_pass_list $at_group" |
at_pass_list="$at_pass_list $at_group" |
632 |
# Cleanup the group directory, unless the user wants the files. |
# Cleanup the group directory, unless the user wants the files. |
633 |
$at_debug_p || rm -rf $at_group_dir |
$at_debug_p || rm -rf $at_group_dir |
634 |
;; |
;; |
635 |
77) at_msg="ok (skipped near \``cat $at_check_line_file`')" |
77) at_msg="ok (skipped near \``cat $at_check_line_file`')" |
636 |
at_skip_list="$at_skip_list $at_group" |
at_skip_list="$at_skip_list $at_group" |
637 |
# Cleanup the group directory, unless the user wants the files. |
# Cleanup the group directory, unless the user wants the files. |
638 |
$at_debug_p || rm -rf $at_group_dir |
$at_debug_p || rm -rf $at_group_dir |
639 |
;; |
;; |
640 |
*) at_msg="FAILED near \``cat $at_check_line_file`'" |
*) at_msg="FAILED near \``cat $at_check_line_file`'" |
641 |
at_fail_list="$at_fail_list $at_group" |
at_fail_list="$at_fail_list $at_group" |
642 |
# Up failure, keep the group directory for autopsy. |
# Up failure, keep the group directory for autopsy. |
643 |
# Create the debugging script. |
# Create the debugging script. |
644 |
{ |
{ |
645 |
echo "#! /bin/sh" |
echo "#! /bin/sh" |
646 |
echo 'test "${ZSH_VERSION+set}" = set && alias -g '\''${1+"$[@]"}'\''='\''"$[@]"'\''' |
echo 'test "${ZSH_VERSION+set}" = set && alias -g '\''${1+"$[@]"}'\''='\''"$[@]"'\''' |
647 |
echo "cd $at_dir" |
echo "cd $at_dir" |
648 |
echo 'exec ${CONFIG_SHELL-'"$SHELL"'}' "$[0]" \ |
echo 'exec ${CONFIG_SHELL-'"$SHELL"'}' "$[0]" \ |
649 |
'-v -d' "$at_debug_args" "$at_group" '${1+"$[@]"}' |
'-v -d' "$at_debug_args" "$at_group" '${1+"$[@]"}' |
650 |
echo 'exit 1' |
echo 'exit 1' |
651 |
} >$at_group_dir/run |
} >$at_group_dir/run |
652 |
chmod +x $at_group_dir/run |
chmod +x $at_group_dir/run |
653 |
;; |
;; |
654 |
esac |
esac |
655 |
echo $at_msg |
echo $at_msg |
656 |
at_log_msg="$at_group. $at_setup_line: $at_msg" |
at_log_msg="$at_group. $at_setup_line: $at_msg" |
657 |
# If the group failed, $at_times_file is not available. |
# If the group failed, $at_times_file is not available. |
658 |
test -f $at_times_file && |
test -f $at_times_file && |
659 |
at_log_msg="$at_log_msg (`sed 1d $at_times_file`)" |
at_log_msg="$at_log_msg (`sed 1d $at_times_file`)" |
660 |
echo "$at_log_msg" >&AS_MESSAGE_LOG_FD |
echo "$at_log_msg" >&AS_MESSAGE_LOG_FD |
661 |
$at_errexit_p && test -n "$at_fail_list" && break |
$at_errexit_p && test -n "$at_fail_list" && break |
662 |
;; |
;; |
791 |
at_setup_line='m4_defn([AT_line])' |
at_setup_line='m4_defn([AT_line])' |
792 |
$at_verbose "AT_ordinal. m4_defn([AT_line]): testing $1..." |
$at_verbose "AT_ordinal. m4_defn([AT_line]): testing $1..." |
793 |
$at_quiet $ECHO_N "m4_format([[%3d: %-18s]], |
$at_quiet $ECHO_N "m4_format([[%3d: %-18s]], |
794 |
AT_ordinal, m4_defn([AT_line]))[]$ECHO_C" |
AT_ordinal, m4_defn([AT_line]))[]$ECHO_C" |
795 |
( |
( |
796 |
$at_traceon |
$at_traceon |
797 |
]) |
]) |
928 |
at_failed=false |
at_failed=false |
929 |
dnl Check stderr. |
dnl Check stderr. |
930 |
m4_case([$4], |
m4_case([$4], |
931 |
stderr, [(echo stderr:; tee stderr <$at_stderr) >&5], |
stderr, [(echo stderr:; tee stderr <$at_stderr) >&5], |
932 |
ignore, [(echo stderr:; cat $at_stderr) >&5], |
ignore, [(echo stderr:; cat $at_stderr) >&5], |
933 |
experr, [$at_diff experr $at_stderr >&5 || at_failed=:], |
experr, [$at_diff experr $at_stderr >&5 || at_failed=:], |
934 |
[], [$at_diff $at_devnull $at_stderr >&5 || at_failed=:], |
[], [$at_diff $at_devnull $at_stderr >&5 || at_failed=:], |
935 |
[echo >>$at_stderr; echo "AS_ESCAPE([$4])" | $at_diff - $at_stderr >&5 || at_failed=:]) |
[echo >>$at_stderr; echo "AS_ESCAPE([$4])" | $at_diff - $at_stderr >&5 || at_failed=:]) |
936 |
dnl Check stdout. |
dnl Check stdout. |
937 |
m4_case([$3], |
m4_case([$3], |
938 |
stdout, [(echo stdout:; tee stdout <$at_stdout) >&5], |
stdout, [(echo stdout:; tee stdout <$at_stdout) >&5], |
939 |
ignore, [(echo stdout:; cat $at_stdout) >&5], |
ignore, [(echo stdout:; cat $at_stdout) >&5], |
940 |
expout, [$at_diff expout $at_stdout >&5 || at_failed=:], |
expout, [$at_diff expout $at_stdout >&5 || at_failed=:], |
941 |
[], [$at_diff $at_devnull $at_stdout >&5 || at_failed=:], |
[], [$at_diff $at_devnull $at_stdout >&5 || at_failed=:], |
942 |
[echo >>$at_stdout; echo "AS_ESCAPE([$3])" | $at_diff - $at_stdout >&5 || at_failed=:]) |
[echo >>$at_stdout; echo "AS_ESCAPE([$3])" | $at_diff - $at_stdout >&5 || at_failed=:]) |
943 |
dnl Check exit val. Don't `skip' if we are precisely checking $? = 77. |
dnl Check exit val. Don't `skip' if we are precisely checking $? = 77. |
944 |
case $at_status in |
case $at_status in |
945 |
m4_case([$2], |
m4_case([$2], |