llvm.org GIT mirror llvm / 2a434d1
[LIT] Handle xml characters in test names Lit creates malformed xml when the test case has an & in the name. Escape those correctly. This also adds a test case which I will add other nasty encoding issues to in some followup commits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331942 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Matthews 1 year, 5 months ago
3 changed file(s) with 14 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
360360 return self.suite.config.is_early
361361
362362 def getJUnitXML(self):
363 test_name = self.path_in_suite[-1]
363 test_name = escape(self.path_in_suite[-1])
364364 test_path = self.path_in_suite[:-1]
365365 safe_test_path = [x.replace(".","_") for x in test_path]
366366 safe_name = self.suite.name.replace(".","-")
1111 # CHECK-NEXT: "value0": 1,
1212 # CHECK-NEXT: "value1": 2.3456
1313 # CHECK-NEXT: }
14 # CHECK-NEXT: "name": "test-data :: bad&name.ini",
15 # CHECK-NEXT: "output": "& < > \""
16 # CHECK-NEXT: },
17 # CHECK-NEXT: {
18 # CHECK-NEXT: "code": "PASS",
19 # CHECK-NEXT: "elapsed": {{[0-9.]+}},
20 # CHECK-NEXT: "metrics": {
21 # CHECK-NEXT: "value0": 1,
22 # CHECK-NEXT: "value1": 2.3456
23 # CHECK-NEXT: }
1424 # CHECK-NEXT: "name": "test-data :: metrics.ini",
1525 # CHECK-NEXT: "output": "Test passed."
1626 # CHECK-NEXT: }
27
1728 # CHECK-NEXT: ]
1829 # CHECK-NEXT: }
33
44 # CHECK:
55 # CHECK:
6 # CHECK:
6 # CHECK:
7 # CHECK:
78 # CHECK:
89 # CHECK:
910 # CHECK: