From: Akim Demaille Date: Thu, 29 Jan 2009 17:39:58 +0000 (+0100) Subject: Normalize compiler output due to compiler wrappers. X-Git-Tag: v2.2.7b~126 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3e0beef8eb35a734514d5c4871f19a32c5edb145;p=thirdparty%2Flibtool.git Normalize compiler output due to compiler wrappers. * tests/testsuite.at (LT_AT_NORMALIZE_COMPILER_OUTPUT): New macro, to normalize ccache and distcc output. * tests/localization.at (localized compiler messages): Use it. Signed-off-by: Ralf Wildenhues --- diff --git a/ChangeLog b/ChangeLog index f7fd4d18b..3c2871dfc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-01-29 Akim Demaille + Ralf Wildenhues + + Normalize compiler output due to compiler wrappers. + * tests/testsuite.at (LT_AT_NORMALIZE_COMPILER_OUTPUT): New + macro, to normalize ccache and distcc output. + * tests/localization.at (localized compiler messages): Use it. + 2009-01-29 Peter Rosin Make modified libtool script in cwrapper test executable diff --git a/tests/localization.at b/tests/localization.at index 92b19ac14..119b38dac 100644 --- a/tests/localization.at +++ b/tests/localization.at @@ -43,15 +43,13 @@ AT_CHECK([$CC $CPPFLAGS $CFLAGS -c b.c || exit 77], [], [stdout], [stderr]) # Find out about expected output. AT_CHECK([$CC $CPPFLAGS $CFLAGS -c a.c || exit 1], [1], [stdout], [stderr]) -LT_AT_UNIFY_NL([stdout], [expected-stdout]) -LT_AT_UNIFY_NL([stderr], [expected-stderr]) +LT_AT_NORMALIZE_COMPILER_OUTPUT([stdout], [expected-stdout]) +LT_AT_NORMALIZE_COMPILER_OUTPUT([stderr], [expected-stderr]) AT_CHECK([$LIBTOOL --mode=compile --tag=CC $CC $CPPFLAGS $CFLAGS -c a.c || exit 1], [1], [stdout], [stderr]) -LT_AT_UNIFY_NL([stderr]) -AT_CHECK([diff expected-stderr stderr]) -LTBASE=`$ECHO "$LIBTOOL" | sed 's,^.*/,,'` -grep -v "^$LTBASE: compile" stdout > libtool-stdout -LT_AT_UNIFY_NL([libtool-stdout]) +LT_AT_NORMALIZE_COMPILER_OUTPUT([stdout], [libtool-stdout]) +LT_AT_NORMALIZE_COMPILER_OUTPUT([stderr], [libtool-stderr]) +AT_CHECK([diff expected-stderr libtool-stderr]) AT_CHECK([diff expected-stdout libtool-stdout]) # check that we get our quoting right. diff --git a/tests/testsuite.at b/tests/testsuite.at index 24e817466..92e786eff 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -218,6 +218,20 @@ m4_define([LT_AT_UNIFY_NL], esac]) +# LT_AT_NORMALIZE_COMPILER_OUTPUT(FILE, [RESULT-FILE]) +# ---------------------------------------------------- +# Normalize differences in compiler output stemming from, e.g., +# - distcc process numbers, +# - ccache file location, +# - newline encoding, +# - location of the libtool script. +m4_define([LT_AT_NORMALIZE_COMPILER_OUTPUT], +[_ltbase=`$ECHO "$LIBTOOL" | sed 's,^.*/,,'` +[sed "/^distcc\[[0-9]*\]/d; /^$_ltbase: compile/d" < $1 > $1.t] +LT_AT_UNIFY_NL([$1.t], [m4_default([$2], [$1])])[]dnl +]) + + # LT_AT_EXEC_CHECK(EXECUTABLE, [STATUS = 0], [STDOUT], [STDERR], # [ARGS-OR-STATUS-ADJUST]) # --------------------------------------------------------------