ctest_to_junit.py
Go to the documentation of this file.
00001 # Copyright 2018 The Cartographer Authors
00002 #
00003 # Licensed under the Apache License, Version 2.0 (the "License");
00004 # you may not use this file except in compliance with the License.
00005 # You may obtain a copy of the License at
00006 #
00007 #      http://www.apache.org/licenses/LICENSE-2.0
00008 #
00009 # Unless required by applicable law or agreed to in writing, software
00010 # distributed under the License is distributed on an "AS IS" BASIS,
00011 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00012 # See the License for the specific language governing permissions and
00013 # limitations under the License.
00014 
00015 from lxml import etree
00016 import StringIO
00017 import sys
00018 
00019 TAGfile = open(sys.argv[1]+"/Testing/TAG", 'r')
00020 dirname = TAGfile.readline().strip()
00021 
00022 xmlfile = open(sys.argv[1]+"/Testing/"+dirname+"/Test.xml", 'r')
00023 xslfile = open(sys.path[0] + "/ctest_to_junit.xsl", 'r')
00024 
00025 xmlcontent = xmlfile.read()
00026 xslcontent = xslfile.read()
00027 
00028 xmldoc = etree.parse(StringIO.StringIO(xmlcontent))
00029 xslt_root = etree.XML(xslcontent)
00030 transform = etree.XSLT(xslt_root)
00031 
00032 result_tree = transform(xmldoc)
00033 result_tree.write(sys.argv[1]+"/Testing/"+dirname+"/jUnit.xml")


cartographer
Author(s): The Cartographer Authors
autogenerated on Thu May 9 2019 02:27:35