diff options
| author | bors <bors@rust-lang.org> | 2015-06-02 02:08:17 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-06-02 02:08:17 +0000 |
| commit | f813f9779722d3670bbfbd0a352b64fe4ae9ddbb (patch) | |
| tree | 8101f954fe1183830cc6f16ca1c9dbaca604f884 /src | |
| parent | 613e57b448c88591b6076a8cea9799f1f3876687 (diff) | |
| parent | a40bca29a818b4cbea072a295cb80aa9a4c43d52 (diff) | |
| download | rust-f813f9779722d3670bbfbd0a352b64fe4ae9ddbb.tar.gz rust-f813f9779722d3670bbfbd0a352b64fe4ae9ddbb.zip | |
Auto merge of #25654 - petrochenkov:encenv, r=alexcrichton
Fixes https://github.com/rust-lang/rust/issues/25268 and a couple of similar test errors r? @alexcrichton
Diffstat (limited to 'src')
| -rw-r--r-- | src/etc/check-sanitycheck.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/etc/check-sanitycheck.py b/src/etc/check-sanitycheck.py index fc8ed7b383e..0e103fbcffb 100644 --- a/src/etc/check-sanitycheck.py +++ b/src/etc/check-sanitycheck.py @@ -11,19 +11,18 @@ # except according to those terms. import os +import subprocess import sys import functools STATUS = 0 - def error_unless_permitted(env_var, message): global STATUS if not os.getenv(env_var): sys.stderr.write(message) STATUS = 1 - def only_on(platforms): def decorator(func): @functools.wraps(func) @@ -33,8 +32,7 @@ def only_on(platforms): return inner return decorator - -@only_on(('linux', 'darwin', 'freebsd', 'openbsd')) +@only_on(['linux', 'darwin', 'freebsd', 'openbsd']) def check_rlimit_core(): import resource soft, hard = resource.getrlimit(resource.RLIMIT_CORE) @@ -45,8 +43,14 @@ will segfault many rustc's, creating many potentially large core files. set ALLOW_NONZERO_RLIMIT_CORE to ignore this warning """ % (soft)) +@only_on(['win32']) +def check_console_code_page(): + if '65001' not in subprocess.check_output(['cmd', '/c', 'chcp']): + sys.stderr.write('Warning: the console output code page is not UTF-8, \ +some tests may fail. Use `cmd /c "chcp 65001"` to setup UTF-8 code page.\n') def main(): + check_console_code_page() check_rlimit_core() if __name__ == '__main__': |
