-
Notifications
You must be signed in to change notification settings - Fork 718
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Write lit xml output as utf-8 (#6130)
This commit modifies the xml output of lit so that we always open the file as utf-8 and also encode any invalid characters with the xml character reference. I was hitting an encoding error on windows for some test output because the xml file was using the windows cp1252 encoding and it ran into some characters that could not be encoded. In order to test the change I added a new flag to lit `--xml-include-test-output` which will include all test output in the xml. That way we can still expect the lit run to pass and also validate that the xml file is properly encoded.
- Loading branch information
Showing
5 changed files
with
30 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[global] | ||
result_code = PASS | ||
result_output = This test is 🔥 | ||
|
||
[results] | ||
value0 = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,18 @@ | ||
# Check xunit output | ||
# RUN: %{lit} --xunit-xml-output %t.xunit.xml %{inputs}/test-data | ||
# RUN: %{lit} --xunit-xml-output %t.xunit.xml --xml-include-test-output %{inputs}/test-data | ||
# RUN: FileCheck < %t.xunit.xml %s | ||
|
||
# CHECK: <?xml version="1.0" encoding="UTF-8" ?> | ||
# CHECK: <testsuites> | ||
# CHECK: <testsuite name='test-data' tests='1' failures='0'> | ||
# CHECK: <testcase classname='test-data.test-data' name='metrics.ini' time='0.{{[0-9]+}}'/> | ||
# CHECK: <testsuite name='test-data' tests='2' failures='0'> | ||
# CHECK: <testcase classname='test-data.test-data' name='metrics.ini' time='0.{{[0-9]+}}'> | ||
# CHECK: <system-out> | ||
# CHECK: Test passed. | ||
# CHECK: </system-out> | ||
# CHECK: <testcase classname='test-data.test-data' name='utf8_output_message.ini' time='0.{{[0-9]+}}'> | ||
# CHECK: <system-out> | ||
# CHECK: This test is 🔥 | ||
# CHECK: </system-out> | ||
# CHECK: </testcase> | ||
# CHECK: </testsuite> | ||
# CHECK: </testsuites> |