summaryrefslogtreecommitdiffstats
path: root/tests/run-make/translation/Makefile
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:41 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:41 +0000
commit4f9fe856a25ab29345b90e7725509e9ee38a37be (patch)
treee4ffd8a9374cae7b21f7cbfb352927e0e074aff6 /tests/run-make/translation/Makefile
parentAdding upstream version 1.68.2+dfsg1. (diff)
downloadrustc-4f9fe856a25ab29345b90e7725509e9ee38a37be.tar.xz
rustc-4f9fe856a25ab29345b90e7725509e9ee38a37be.zip
Adding upstream version 1.69.0+dfsg1.upstream/1.69.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/run-make/translation/Makefile')
-rw-r--r--tests/run-make/translation/Makefile18
1 files changed, 11 insertions, 7 deletions
diff --git a/tests/run-make/translation/Makefile b/tests/run-make/translation/Makefile
index 20e86c7f9..5b0b331ca 100644
--- a/tests/run-make/translation/Makefile
+++ b/tests/run-make/translation/Makefile
@@ -6,8 +6,10 @@ include ../../run-make-fulldeps/tools.mk
SYSROOT:=$(shell $(RUSTC) --print sysroot)
FAKEROOT=$(TMPDIR)/fakeroot
+RUSTC_LOG:=rustc_error_messages
+export RUSTC_TRANSLATION_NO_DEBUG_ASSERT:=1
-all: normal custom sysroot
+all: normal custom missing broken sysroot sysroot-invalid sysroot-missing
# Check that the test works normally, using the built-in fallback bundle.
normal: test.rs
@@ -32,6 +34,7 @@ broken: test.rs broken.ftl
# identifier by making a local copy of the sysroot and adding the custom locale
# to it.
sysroot: test.rs working.ftl
+ rm -rf $(FAKEROOT)
mkdir $(FAKEROOT)
ln -s $(SYSROOT)/* $(FAKEROOT)
rm -f $(FAKEROOT)/lib
@@ -51,12 +54,12 @@ sysroot: test.rs working.ftl
# found. This test might start failing if there actually exists a Klingon
# translation of rustc's error messages.
sysroot-missing:
- $(RUSTC) $< -Ztranslate-lang=tlh 2>&1 || grep "missing locale directory"
+ $(RUSTC) $< -Ztranslate-lang=tlh 2>&1 | grep "missing locale directory"
-# Check that the compiler errors out when the sysroot requested cannot be
-# found. This test might start failing if there actually exists a Klingon
-# translation of rustc's error messages.
+# Check that the compiler errors out when the directory for the locale in the
+# sysroot is actually a file.
sysroot-invalid: test.rs working.ftl
+ rm -rf $(FAKEROOT)
mkdir $(FAKEROOT)
ln -s $(SYSROOT)/* $(FAKEROOT)
rm -f $(FAKEROOT)/lib
@@ -68,5 +71,6 @@ sysroot-invalid: test.rs working.ftl
rm -f $(FAKEROOT)/lib/rustlib/src
mkdir $(FAKEROOT)/lib/rustlib/src
ln -s $(SYSROOT)/lib/rustlib/src/* $(FAKEROOT)/lib/rustlib/src
- touch $(FAKEROOT)/share/locale/zh-CN/
- $(RUSTC) $< --sysroot $(FAKEROOT) -Ztranslate-lang=zh-CN 2>&1 || grep "`\$sysroot/share/locales/\$locale` is not a directory"
+ mkdir -p $(FAKEROOT)/share/locale
+ touch $(FAKEROOT)/share/locale/zh-CN
+ $(RUSTC) $< --sysroot $(FAKEROOT) -Ztranslate-lang=zh-CN 2>&1 | grep "`\$sysroot/share/locales/\$locale` is not a directory"