diff options
Diffstat (limited to 'src/test/run-make/translation')
-rw-r--r-- | src/test/run-make/translation/Makefile | 72 | ||||
-rw-r--r-- | src/test/run-make/translation/broken.ftl | 3 | ||||
-rw-r--r-- | src/test/run-make/translation/missing.ftl | 3 | ||||
-rw-r--r-- | src/test/run-make/translation/test.rs | 18 | ||||
-rw-r--r-- | src/test/run-make/translation/working.ftl | 2 |
5 files changed, 0 insertions, 98 deletions
diff --git a/src/test/run-make/translation/Makefile b/src/test/run-make/translation/Makefile deleted file mode 100644 index 20e86c7f9..000000000 --- a/src/test/run-make/translation/Makefile +++ /dev/null @@ -1,72 +0,0 @@ -include ../../run-make-fulldeps/tools.mk - -# This test uses `ln -s` rather than copying to save testing time, but its -# usage doesn't work on Windows. -# ignore-windows - -SYSROOT:=$(shell $(RUSTC) --print sysroot) -FAKEROOT=$(TMPDIR)/fakeroot - -all: normal custom sysroot - -# Check that the test works normally, using the built-in fallback bundle. -normal: test.rs - $(RUSTC) $< 2>&1 | grep "struct literal body without path" - -# Check that a primary bundle can be loaded and will be preferentially used -# where possible. -custom: test.rs working.ftl - $(RUSTC) $< -Ztranslate-additional-ftl=$(CURDIR)/working.ftl 2>&1 | grep "this is a test message" - -# Check that a primary bundle with a broken message (e.g. a interpolated -# variable is missing) will use the fallback bundle. -missing: test.rs missing.ftl - $(RUSTC) $< -Ztranslate-additional-ftl=$(CURDIR)/missing.ftl 2>&1 | grep "struct literal body without path" - -# Check that a primary bundle without the desired message will use the fallback -# bundle. -broken: test.rs broken.ftl - $(RUSTC) $< -Ztranslate-additional-ftl=$(CURDIR)/broken.ftl 2>&1 | grep "struct literal body without path" - -# Check that a locale can be loaded from the sysroot given a language -# identifier by making a local copy of the sysroot and adding the custom locale -# to it. -sysroot: test.rs working.ftl - mkdir $(FAKEROOT) - ln -s $(SYSROOT)/* $(FAKEROOT) - rm -f $(FAKEROOT)/lib - mkdir $(FAKEROOT)/lib - ln -s $(SYSROOT)/lib/* $(FAKEROOT)/lib - rm -f $(FAKEROOT)/lib/rustlib - mkdir $(FAKEROOT)/lib/rustlib - ln -s $(SYSROOT)/lib/rustlib/* $(FAKEROOT)/lib/rustlib - rm -f $(FAKEROOT)/lib/rustlib/src - mkdir $(FAKEROOT)/lib/rustlib/src - ln -s $(SYSROOT)/lib/rustlib/src/* $(FAKEROOT)/lib/rustlib/src - mkdir -p $(FAKEROOT)/share/locale/zh-CN/ - ln -s $(CURDIR)/working.ftl $(FAKEROOT)/share/locale/zh-CN/basic-translation.ftl - $(RUSTC) $< --sysroot $(FAKEROOT) -Ztranslate-lang=zh-CN 2>&1 | grep "this is a test message" - -# 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. -sysroot-missing: - $(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. -sysroot-invalid: test.rs working.ftl - mkdir $(FAKEROOT) - ln -s $(SYSROOT)/* $(FAKEROOT) - rm -f $(FAKEROOT)/lib - mkdir $(FAKEROOT)/lib - ln -s $(SYSROOT)/lib/* $(FAKEROOT)/lib - rm -f $(FAKEROOT)/lib/rustlib - mkdir $(FAKEROOT)/lib/rustlib - ln -s $(SYSROOT)/lib/rustlib/* $(FAKEROOT)/lib/rustlib - 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" diff --git a/src/test/run-make/translation/broken.ftl b/src/test/run-make/translation/broken.ftl deleted file mode 100644 index f1dd6ff0b..000000000 --- a/src/test/run-make/translation/broken.ftl +++ /dev/null @@ -1,3 +0,0 @@ -# `foo` isn't provided by this diagnostic so it is expected that the fallback message is used. -parse_struct_literal_body_without_path = this is a {$foo} message - .suggestion = this is a test suggestion diff --git a/src/test/run-make/translation/missing.ftl b/src/test/run-make/translation/missing.ftl deleted file mode 100644 index 6be24dc7b..000000000 --- a/src/test/run-make/translation/missing.ftl +++ /dev/null @@ -1,3 +0,0 @@ -# `parse_struct_literal_body_without_path` isn't provided by this resource at all, so the -# fallback should be used. -foo = bar diff --git a/src/test/run-make/translation/test.rs b/src/test/run-make/translation/test.rs deleted file mode 100644 index b8f5bff31..000000000 --- a/src/test/run-make/translation/test.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Exact error being tested isn't relevant, it just needs to be known that it uses Fluent-backed -// diagnostics. - -struct Foo { - val: (), -} - -fn foo() -> Foo { - val: (), -} - -fn main() { - let x = foo(); - x.val == 42; - let x = { - val: (), - }; -} diff --git a/src/test/run-make/translation/working.ftl b/src/test/run-make/translation/working.ftl deleted file mode 100644 index 50d126e3f..000000000 --- a/src/test/run-make/translation/working.ftl +++ /dev/null @@ -1,2 +0,0 @@ -parse_struct_literal_body_without_path = this is a test message - .suggestion = this is a test suggestion |