Adjust executable run tests to cwrapper changes.

* tests/testsuite.at (LT_AT_EXEC_CHECK): Accept fifth argument
ARGS-OR-STATUS-ADJUST, for command-line arguments and/or exit
status flattening.  Rewrite to prefer the executable with the
`.exe' prefix over one without.  Test exit status against
expected exit status, not against zero, when determining whether
this may be a cross-compilation-induced result.
(LT_AT_NOINST_EXEC_CHECK): Likewise.
* tests/static.at (static linking flags for programs): Adjust
calls.
Report by Roumen Petrov.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
This commit is contained in:
Ralf Wildenhues 2008-11-23 22:35:58 +01:00
parent c6d628415d
commit 2258787e02
3 changed files with 41 additions and 13 deletions

View File

@ -1,5 +1,17 @@
2008-11-23 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Adjust executable run tests to cwrapper changes.
* tests/testsuite.at (LT_AT_EXEC_CHECK): Accept fifth argument
ARGS-OR-STATUS-ADJUST, for command-line arguments and/or exit
status flattening. Rewrite to prefer the executable with the
`.exe' prefix over one without. Test exit status against
expected exit status, not against zero, when determining whether
this may be a cross-compilation-induced result.
(LT_AT_NOINST_EXEC_CHECK): Likewise.
* tests/static.at (static linking flags for programs): Adjust
calls.
Report by Roumen Petrov.
No trailing period in Autotest test group names.
* tests/link-order.at (Link order test): Drop trailing period
from test name.

View File

@ -194,11 +194,11 @@ func_test_exec_fail ()
for st
do
echo "# m$st"
LT_AT_EXEC_CHECK([./m$st || (exit 1)], [1], [], [ignore])
LT_AT_EXEC_CHECK([./m$st], [1], [], [ignore], [|| (exit 1)])
# For some per-deplib flag combinations there may be no installed program,
# because liba2 is not yet installed.
if test -f "$bindir/m$st"; then
LT_AT_EXEC_CHECK([$bindir/m$st || (exit 1)], [1], [], [ignore])
LT_AT_EXEC_CHECK([$bindir/m$st], [1], [], [ignore], [|| (exit 1)])
fi
done
fi

View File

@ -203,29 +203,45 @@ m4_define([_LT_AT_TRANSLATE_TEXT_OUTPUT],
esac])
# LT_AT_EXEC_CHECK(EXECUTABLE, [STATUS = 0], [STDOUT], [STDERR])
# LT_AT_EXEC_CHECK(EXECUTABLE, [STATUS = 0], [STDOUT], [STDERR],
# [ARGS-OR-STATUS-ADJUST])
# --------------------------------------------------------------
# Run EXECUTABLE ARGS-OR-STATUS-ADJUST. STATUS, STDOUT, and STDERR are
# handled as in AT_CHECK, but expout and experr get line endings
# translated.
# However, if we are cross-compiling, then SKIP instead of FAIL.
# ARGS-OR-STATUS-ADJUST can also contain code like `|| (exit 1)'
# to unify different possible exit status values.
m4_define([LT_AT_EXEC_CHECK],
[m4_if([$3], [expout], [_LT_AT_TRANSLATE_TEXT_OUTPUT([$3])])
m4_if([$4], [experr], [_LT_AT_TRANSLATE_TEXT_OUTPUT([$4])])
AT_CHECK([$1; lt_status=$?; if test $lt_status -eq 0; then :;
elif test "X$host" != "X$build" && \
{ test -x "$1" || test -x "$1"$EXEEXT; }
then (exit 77); else (exit $lt_status); fi],[$2],[$3],[$4])
lt_exe=$1; if test -f "$1$EXEEXT"; then lt_exe=$lt_exe$EXEEXT; fi
AT_CHECK([if "$lt_exe" $5; then :; else lt_status=$?; ]dnl
[ m4_ifval([$2], [test $lt_status != $2 && ])]dnl
[ test "X$host" != "X$build" && test -x "$lt_exe" && exit 77; ]dnl
[ exit $lt_status; fi],[$2],[$3],[$4])
])
# LT_AT_NOINST_EXEC_CHECK(EXECUTABLE, [NOINST-MODULES],
# [STATUS = 0], [STDOUT], [STDERR])
# [STATUS = 0], [STDOUT], [STDERR],
# [ARGS-OR-STATUS-ADJUST])
# ---------------------------------------------------------
# Run EXECUTABLE ARGS-OR-STATUS-ADJUST using `libtool --mode=execute'
# with `-dlopen' arguments in NOINST_MODULES. STATUS, STDOUT, and
# STDERR are handled as in AT_CHECK, but expout and experr get line
# endings translated.
# However, if we are cross-compiling, then SKIP instead of FAIL.
# ARGS-OR-STATUS-ADJUST can also contain code like `|| (exit 1)'
# to unify different possible exit status values.
m4_define([LT_AT_NOINST_EXEC_CHECK],
[m4_if([$4], [expout], [_LT_AT_TRANSLATE_TEXT_OUTPUT([$4])])
m4_if([$5], [experr], [_LT_AT_TRANSLATE_TEXT_OUTPUT([$5])])
AT_CHECK([$LIBTOOL --mode=execute $2 $1; lt_status=$?;
if test $lt_status -eq 0; then :;
elif test "X$host" != "X$build" && \
{ test -x "$1" || test -x "$1"$EXEEXT; }
then (exit 77); else (exit $lt_status); fi],[$3],[$4],[$5])
lt_exe=$1; if test -f "$1$EXEEXT"; then lt_exe=$lt_exe$EXEEXT; fi
AT_CHECK([if $LIBTOOL --mode=execute $2 "$lt_exe" $6; then :; else lt_status=$?; ]dnl
[ m4_ifval([$2], [test $lt_status != $2 && ])]dnl
[ test "X$host" != "X$build" && test -x "$lt_exe" && exit 77; ]dnl
[ exit $lt_status; fi],[$3],[$4],[$5])
])