summaryrefslogtreecommitdiffstats
path: root/tests/run-make/libtest-junit/validate_junit.py
blob: 0d9b34a3cf7e0c23fb6bf7d072408eafbaa005e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/env python

import sys
import xml.etree.ElementTree as ET

# Try to decode line in order to ensure it is a valid XML document
for line in sys.stdin:
    try:
        ET.fromstring(line)
    except ET.ParseError:
        print("Invalid xml: %r" % line)
        raise