| | |
| | | <function name="start_job"> |
| | | |
| | | <sequence> |
| | | |
| | | <script> |
| | | STAXLogMessage = 1 |
| | | </script> |
| | |
| | | </sequence> |
| | | </if> |
| | | |
| | | <!-- Load in the local shared python objects --> |
| | | <script> |
| | | import sys |
| | | sys.path.append("%s/shared/python" % TESTS_ROOT ) |
| | | from common import * |
| | | </script> |
| | | |
| | | <message>'PATH= %s' % sys.path</message> |
| | | |
| | | <!-- Check some of the optional variables from config.py --> |
| | | <script> |
| | | try: |
| | |
| | | startValueDict['start']=timestamp |
| | | testDict[tcname]=startValueDict |
| | | |
| | | testCaseList.append(tcname) |
| | | testCaseList.append(tcname.strip()) |
| | | |
| | | else: |
| | | errorfh.write('Warning: No match Start element %s.\n' % element) |
| | |
| | | if testDict.has_key(tcname): |
| | | tcnamesplit=tcname.split(":") |
| | | if tcnamesplit[0]: |
| | | testgroup=tcnamesplit[0] |
| | | tcgroup=tcnamesplit[0].strip() |
| | | if tcnamesplit[1]: |
| | | testsuite=tcnamesplit[1] |
| | | tcsuite=tcnamesplit[1].strip() |
| | | else: |
| | | testsuite=testgroup |
| | | tcsuite=tcgroup |
| | | else: |
| | | testgroup=tcname |
| | | testsuite=tcname |
| | | tcgroup=tcname |
| | | tcsuite=tcname |
| | | |
| | | if testDict[tcname].has_key('pass'): |
| | | tcpass=testDict[tcname]['pass'] |
| | |
| | | tcresult='unknown' |
| | | else: |
| | | tcresult='fail' |
| | | |
| | | tcdurationsecs=test_time().timeToSeconds(tcduration) |
| | | |
| | | xmlfh.write(' <testgroup name="%s">\n' % testgroup) |
| | | xmlfh.write(' <testsuite name="%s">\n' % testsuite) |
| | | xmlfh.write(' <testcase name="%s" result="%s" start="%s" stop="%s" duration="%s"/>\n' % (tcname,tcresult,tcstart,tcstop,tcduration)) |
| | | xmlfh.write(' <testgroup name="%s">\n' % tcgroup) |
| | | xmlfh.write(' <testsuite name="%s">\n' % tcsuite) |
| | | xmlfh.write(' <testcase group="%s" suite="%s" name="%s" result="%s" start="%s" stop="%s" duration="%s"/>\n' % (tcgroup,tcsuite,tcname,tcresult,tcstart,tcstop,tcdurationsecs)) |
| | | xmlfh.write(' </testsuite>\n') |
| | | xmlfh.write(' </testgroup>\n') |
| | | </script> |
| | |
| | | 'XML Report Written to %s.' % xmlfile |
| | | </message> |
| | | |
| | | <script> |
| | | class reportGeneration: |
| | | 'Test Report Generation' |
| | | def transformReport(self,stylesheet,xml,output): |
| | | from java.io import FileInputStream |
| | | from java.io import FileOutputStream |
| | | from java.io import ByteArrayOutputStream |
| | | |
| | | from javax.xml.transform import TransformerFactory |
| | | from javax.xml.transform.stream import StreamSource |
| | | from javax.xml.transform.stream import StreamResult |
| | | |
| | | self.xslSource = StreamSource(FileInputStream("%s" % stylesheet)) |
| | | self.xslTemplate = TransformerFactory.newInstance().newTemplates(self.xslSource) |
| | | self.transformer = self.xslTemplate.newTransformer() |
| | | |
| | | self.source = StreamSource(FileInputStream("%s" % xml)) |
| | | self.result = StreamResult(FileOutputStream("%s" % output)) |
| | | |
| | | self.transformer.transform(self.source, self.result) |
| | | </script> |
| | | |
| | | <!-- Generate the standard test report showing all testcases --> |
| | | <script> |
| | | _message='Generated standard test report.' |
| | | xslfile= '%s/xsl/gen-alltests-report.xsl' % TESTS_SHARED_DIR |
| | | htmlfile= '%s/results.html' % logsReportDir |
| | | |
| | | standardReport=reportGeneration() |
| | | standardReport=report_generation() |
| | | |
| | | try: |
| | | standardReport.transformReport(xslfile,xmlfile,htmlfile) |
| | |
| | | myreporthtml='%s/my-report.html' % logsReportDir |
| | | mytestslog='%s/tests-log.xml' % logsTestsDir |
| | | |
| | | drillDownReport=reportGeneration() |
| | | drillDownReport=report_generation() |
| | | |
| | | try: |
| | | drillDownReport.transformReport(myreportxsl,mytestslog,myreporthtml) |
| | |
| | | mysummarytext='%s/summary.txt' % logsReportDir |
| | | mysummaryxml=xmlfile |
| | | |
| | | summaryReport=reportGeneration() |
| | | summaryReport=report_generation() |
| | | |
| | | try: |
| | | summaryReport.transformReport(mysummaryxsl,mysummaryxml,mysummarytext) |