@@ -6,8 +6,10 @@ include ../../run-make-fulldeps/tools.mk
6
6
7
7
SYSROOT: =$(shell $(RUSTC ) --print sysroot)
8
8
FAKEROOT =$(TMPDIR ) /fakeroot
9
+ RUSTC_LOG: =rustc_error_messages
10
+ export RUSTC_TRANSLATION_NO_DEBUG_ASSERT: =1
9
11
10
- all : normal custom sysroot
12
+ all : normal custom missing broken sysroot sysroot-invalid sysroot-missing
11
13
12
14
# Check that the test works normally, using the built-in fallback bundle.
13
15
normal : test.rs
@@ -32,6 +34,7 @@ broken: test.rs broken.ftl
32
34
# identifier by making a local copy of the sysroot and adding the custom locale
33
35
# to it.
34
36
sysroot : test.rs working.ftl
37
+ rm -rf $(FAKEROOT )
35
38
mkdir $(FAKEROOT )
36
39
ln -s $(SYSROOT ) /* $(FAKEROOT )
37
40
rm -f $(FAKEROOT ) /lib
@@ -51,12 +54,12 @@ sysroot: test.rs working.ftl
51
54
# found. This test might start failing if there actually exists a Klingon
52
55
# translation of rustc's error messages.
53
56
sysroot-missing :
54
- $(RUSTC ) $< -Ztranslate-lang=tlh 2>&1 || grep " missing locale directory"
57
+ $(RUSTC ) $< -Ztranslate-lang=tlh 2>&1 | grep " missing locale directory"
55
58
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.
59
61
sysroot-invalid : test.rs working.ftl
62
+ rm -rf $(FAKEROOT )
60
63
mkdir $(FAKEROOT )
61
64
ln -s $(SYSROOT ) /* $(FAKEROOT )
62
65
rm -f $(FAKEROOT ) /lib
@@ -68,5 +71,6 @@ sysroot-invalid: test.rs working.ftl
68
71
rm -f $(FAKEROOT ) /lib/rustlib/src
69
72
mkdir $(FAKEROOT ) /lib/rustlib/src
70
73
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