summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2012-09-09 22:52:50 +0000
committerPaul Smith <psmith@gnu.org>2012-09-09 22:52:50 +0000
commit90ee335724c3165ae31bfc45486a1c185d85a19c (patch)
tree6875f7ba40d651ddd3888140cc3ca756510d7037 /tests
parent7d3743dfdc0de4d5867325ca8295034773ad26cf (diff)
downloadgunmake-90ee335724c3165ae31bfc45486a1c185d85a19c.tar.gz
Get error messages in the C locale for comparision with make output.
Fixes Savannah bug #35764.
Diffstat (limited to 'tests')
-rw-r--r--tests/ChangeLog3
-rw-r--r--tests/scripts/functions/file7
2 files changed, 10 insertions, 0 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog
index cc1724c..5e35053 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,5 +1,8 @@
2012-09-09 Paul Smith <psmith@gnu.org>
+ * scripts/functions/file: Get errors in the C locale, not the
+ current locale. Fixes Savannah bug #35764.
+
* scripts/features/escape: Check that backslashes before
non-special characters are not removed.
diff --git a/tests/scripts/functions/file b/tests/scripts/functions/file
index b994af8..9a4cd02 100644
--- a/tests/scripts/functions/file
+++ b/tests/scripts/functions/file
@@ -35,9 +35,16 @@ touch('file.out');
chmod(0444, 'file.out');
# Find the error that will be printed
+# This seems complicated, but we need the message from the C locale
+my $loc = undef;
+if ($has_POSIX) {
+ $loc = POSIX::setlocale(POSIX::LC_MESSAGES);
+ POSIX::setlocale(POSIX::LC_MESSAGES, 'C');
+}
my $e;
open(my $F, '>', 'file.out') and die "Opened read-only file!\n";
$e = "$!";
+$loc and POSIX::setlocale(POSIX::LC_MESSAGES, $loc);
run_make_test(q!
define A