diff options
author | Bruce Forstall <brucefo@microsoft.com> | 2019-02-05 11:02:50 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-05 11:02:50 -0800 |
commit | 1d3199d7d8a03c753d98e2366cf959e70f82b3dd (patch) | |
tree | 95aa88531a3c60bbedbe58e9f6a1a1e72502d1cc /tests | |
parent | 4052214dd4be021ed41680a43360fe886db73d61 (diff) | |
parent | 718e651e7ede620ef1ecbfc8ebe838db8f3dfa2f (diff) | |
download | coreclr-1d3199d7d8a03c753d98e2366cf959e70f82b3dd.tar.gz coreclr-1d3199d7d8a03c753d98e2366cf959e70f82b3dd.tar.bz2 coreclr-1d3199d7d8a03c753d98e2366cf959e70f82b3dd.zip |
Merge pull request #22416 from BruceForstall/FixRunTestOutput
Fix runtest.py output
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/runtest.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/runtest.py b/tests/runtest.py index c842627636..7d66a8310e 100755 --- a/tests/runtest.py +++ b/tests/runtest.py @@ -2225,18 +2225,25 @@ def print_summary(tests): # XUnit results are captured as escaped characters. test_output = test_output.replace("\\r", "\r") test_output = test_output.replace("\\n", "\n") - - print(test_output) test_output = test_output.replace("/r", "\r") test_output = test_output.replace("/n", "\n") + + # Replace CR/LF by just LF; Python "print", below, will map as necessary on the platform. + # If we don't do this, then Python on Windows will convert \r\n to \r\r\n on output. + test_output = test_output.replace("\r\n", "\n") + unicode_output = None if sys.version_info < (3,0): # Handle unicode characters in output in python2.* - unicode_output = unicode(test_output, "utf-8") + try: + unicode_output = unicode(test_output, "utf-8") + except: + print("Error: failed to convert Unicode output") else: unicode_output = test_output - print(unicode_output) + if unicode_output is not None: + print(unicode_output) print("") print("") |