]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
tests: fix localization test for GCC on HP-UX 11.00.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Wed, 1 Sep 2010 20:12:13 +0000 (22:12 +0200)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Wed, 1 Sep 2010 20:12:13 +0000 (22:12 +0200)
* tests/localization.at (localized compiler messages): Be sure
to switch the locale only for the actual compiler commands, so
we don't pick up warnings from helper tools such as diff which
may not have the locale installed.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
ChangeLog
tests/localization.at

index 230981ecbd093533c0ebf536bdc3a387b5eee889..344ba6643f948a6d5fc5ac21a358a86d05f66bbd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2010-09-01  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       tests: fix localization test for GCC on HP-UX 11.00.
+       * tests/localization.at (localized compiler messages): Be sure
+       to switch the locale only for the actual compiler commands, so
+       we don't pick up warnings from helper tools such as diff which
+       may not have the locale installed.
+
        Avoid leaking make flags into testsuite results.
        * tests/defs.m4sh: Unset MFLAGS, MAKEFLAGS, MAKELEVEL, __MKLVL__
        and MAKE_JOBS_FIFO.
index 71cdad4c2551d54e63f7ba570747584a20696f32..392511e38a9dc2bd77d62005b334e15ccb238851 100644 (file)
@@ -1,7 +1,6 @@
 # localization.at -- libtool and locales                -*- Autotest -*-
 #
-#   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
-#   Written by Ralf Wildenhues, 2008
+#   Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
 #
 #   This file is part of GNU Libtool.
 #
@@ -26,10 +25,8 @@ AT_SETUP([localized compiler messages])
 AT_KEYWORDS([libtool])
 
 # Let's try German locale.  :-)
-LANG=de_DE
-LANGUAGE=de_DE
-LC_ALL=de_DE
-export LANG LANGUAGE LC_ALL
+m4_pushdef([lt_localize],
+[LANG=de_DE LANGUAGE=de_DE LC_ALL=de_DE])
 
 AT_DATA([a.c],
 [[int x[-1];
@@ -39,13 +36,15 @@ AT_DATA([b.c],
 ]])
 
 # First see if setting a locale is accepted at all.
-AT_CHECK([$CC $CPPFLAGS $CFLAGS -c b.c || exit 77], [], [stdout], [stderr])
+AT_CHECK([(lt_localize $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])
+AT_CHECK([(lt_localize $CC $CPPFLAGS $CFLAGS -c a.c) || exit 1],
+        [1], [stdout], [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],
+AT_CHECK([(lt_localize $LIBTOOL --mode=compile --tag=CC $CC $CPPFLAGS $CFLAGS -c a.c) || exit 1],
         [1], [stdout], [stderr])
 LT_AT_NORMALIZE_COMPILER_OUTPUT([stdout], [libtool-stdout])
 LT_AT_NORMALIZE_COMPILER_OUTPUT([stderr], [libtool-stderr])
@@ -63,10 +62,12 @@ AT_CHECK([diff expected-stderr libtool-stderr])
 AT_CHECK([diff expected-stdout libtool-stdout])
 
 # check that we get our quoting right.
-LANGUAGE='a; nosuchprogram " '\''  & $x /#+*(){}|,:`\ !%'
-export LANGUAGE
-AT_CHECK([$LIBTOOL --mode=compile --tag=CC $CC $CPPFLAGS $CFLAGS -c b.c],
+m4_define([lt_localize],
+[[LANGUAGE='a; nosuchprogram " '\''  & $x /#+*(){}|,:`\ !%']])
+AT_CHECK([(lt_localize $LIBTOOL --mode=compile --tag=CC $CC $CPPFLAGS $CFLAGS -c b.c)],
         [0], [stdout], [stderr])
 AT_CHECK([grep nosuchprogram stdout stderr], [1])
 
+m4_popdef([lt_localize])
+
 AT_CLEANUP