@@ -6,8 +6,10 @@ include ../../run-make-fulldeps/tools.mk
66
77SYSROOT: =$(shell $(RUSTC ) --print sysroot)
88FAKEROOT =$(TMPDIR ) /fakeroot
9+ RUSTC_LOG: =rustc_error_messages
10+ export RUSTC_TRANSLATION_NO_DEBUG_ASSERT: =1
911
10- all : normal custom sysroot
12+ all : normal custom missing broken sysroot sysroot-invalid sysroot-missing
1113
1214# Check that the test works normally, using the built-in fallback bundle.
1315normal : test.rs
@@ -32,6 +34,7 @@ broken: test.rs broken.ftl
3234# identifier by making a local copy of the sysroot and adding the custom locale
3335# to it.
3436sysroot : test.rs working.ftl
37+ rm -rf $(FAKEROOT )
3538 mkdir $(FAKEROOT )
3639 ln -s $(SYSROOT ) /* $(FAKEROOT )
3740 rm -f $(FAKEROOT ) /lib
@@ -51,12 +54,12 @@ sysroot: test.rs working.ftl
5154# found. This test might start failing if there actually exists a Klingon
5255# translation of rustc's error messages.
5356sysroot-missing :
54- $(RUSTC ) $< -Ztranslate-lang=tlh 2>&1 || grep " missing locale directory"
57+ $(RUSTC ) $< -Ztranslate-lang=tlh 2>&1 | grep " missing locale directory"
5558
56- # Check that the compiler errors out when the sysroot requested cannot be
57- # found. This test might start failing if there actually exists a Klingon
58- # translation of rustc's error messages.
59+ # Check that the compiler errors out when the directory for the locale in the
60+ # sysroot is actually a file.
5961sysroot-invalid : test.rs working.ftl
62+ rm -rf $(FAKEROOT )
6063 mkdir $(FAKEROOT )
6164 ln -s $(SYSROOT ) /* $(FAKEROOT )
6265 rm -f $(FAKEROOT ) /lib
@@ -68,5 +71,6 @@ sysroot-invalid: test.rs working.ftl
6871 rm -f $(FAKEROOT ) /lib/rustlib/src
6972 mkdir $(FAKEROOT ) /lib/rustlib/src
7073 ln -s $(SYSROOT ) /lib/rustlib/src/* $(FAKEROOT ) /lib/rustlib/src
71- touch $(FAKEROOT ) /share/locale/zh-CN/
72- $(RUSTC ) $< --sysroot $(FAKEROOT ) -Ztranslate-lang=zh-CN 2>&1 || grep " ` \$ sysroot/share/locales/\$ locale` is not a directory"
74+ mkdir -p $(FAKEROOT ) /share/locale
75+ touch $(FAKEROOT ) /share/locale/zh-CN
76+ $(RUSTC ) $< --sysroot $(FAKEROOT ) -Ztranslate-lang=zh-CN 2>&1 | grep " ` \$ sysroot/share/locales/\$ locale` is not a directory"
0 commit comments