diff options
| author | petrochenkov <vadim.petrochenkov@gmail.com> | 2015-05-30 19:22:12 +0300 |
|---|---|---|
| committer | petrochenkov <vadim.petrochenkov@gmail.com> | 2015-05-30 19:22:12 +0300 |
| commit | 8c86f8ff8c7cbbf0e87f0c7fe22e5596a4778bfc (patch) | |
| tree | 351e7a689db7a145dd677089154e3bcd58c7bdc5 /src | |
| parent | a97b3ff16ffb7370642b674ce154a827bf69b8d8 (diff) | |
| download | rust-8c86f8ff8c7cbbf0e87f0c7fe22e5596a4778bfc.tar.gz rust-8c86f8ff8c7cbbf0e87f0c7fe22e5596a4778bfc.zip | |
Warn if the test suite is run on Windows in console with non-UTF-8 code page
Diffstat (limited to 'src')
| -rw-r--r-- | src/etc/check-sanitycheck.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/etc/check-sanitycheck.py b/src/etc/check-sanitycheck.py index fc8ed7b383e..b3dc290e36b 100644 --- a/src/etc/check-sanitycheck.py +++ b/src/etc/check-sanitycheck.py @@ -11,6 +11,7 @@ # except according to those terms. import os +import subprocess import sys import functools @@ -45,8 +46,14 @@ will segfault many rustc's, creating many potentially large core files. set ALLOW_NONZERO_RLIMIT_CORE to ignore this warning """ % (soft)) +@only_on(('windows')) +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__': |
