parameters: (self, template_path, output_path)
docstring: # load template head
            $template = file($ctestReportingPath."/Test.xml");
            $newTestFile = array();
            foreach ($template as $line)
            {
              array_push($newTestFile, $line);
              if (trim($line) == "<Testing>")
              {
                break;
              }
            }
docstring_summary: # load template head
            $template = file($ctestReportingPath."/Test.xml");
            $newTestFile = array();
            foreach ($template as $line)
            {
              array_push($newTestFile, $line);
              if (trim($line) == "<Testing>")
              {
                break;
              }
            }
docstring_tokens: # load template head $template = file ( $ctestReportingPath . / Test . xml ) ; $newTestFile = array () ; foreach ( $template as $line ) { array_push ( $newTestFile $line ) ; if ( trim ( $line ) == <Testing > ) { break ; } }
function: def to_cdash_xml(self, template_path, output_path):
  
          if template_path.endswith("Test.xml"):
              body_start = "<Testing>"
          elif template_path.endswith("Build.xml"):
              body_start = "<Build>"
          else:
              raise Exception("Unsupported template name %s" % template_path)
          xml_output = []
          # load template head (everything up to "<Testing>")
          # -> this assumes a specific format of the xml
          with open(template_path) as f:
              for line in f:
                  if line.strip() == body_start:
                      break
                  xml_output.append(line)
  
          """
            # load template head
            $template = file($ctestReportingPath."/Test.xml");
            $newTestFile = array();
            foreach ($template as $line)
            {
              array_push($newTestFile, $line);
              if (trim($line) == "<Testing>")
              {
                break;
              }
            }
            """
  
          # Start writing the xml
          xml_output.append("  <Testing>\n")
          xml_output.append("  <StartDateTime>%s</StartDateTime>\n" % (time.strftime('%b %d %H:%M') ) )
          xml_output.append("  <StartTestTime>%s</StartTestTime>\n" % (time.time()) )
          xml_output.append("  <TestList>\n")
          for classtestresults in self:
              for tres in classtestresults:
                  xml_output.append("    <Test>%s</Test>\n" % xml_escape(tres.getXMLName() )  )
          xml_output.append("  </TestList>\n")
  
          for classtestresults in self:
              for tres in classtestresults:
                  status = ""
                  if tres.isPassed():
                      status = "passed"
                  else:
                      status = "failed"
  
                  xml_output.append(" " * 2 + '<Test Status="%s">\n' % status)
                  xml_output.append(" " * 4 + '<Name>%s</Name>\n' % xml_escape(tres.getXMLName() ) )
                  xml_output.append(" " * 4 + '<Path> ./tools/ </Path>\n' )
                  xml_output.append(" " * 4 + '<FullName>%s</FullName>\n' % xml_escape(tres.name) )
                  xml_output.append(" " * 4 + '<FullCommandLine>python PythonExtensionChecker.py %s</FullCommandLine>\n' % xml_escape(tres.name) )
                  xml_output.append(" " * 4 + '<Results>')
                  xml_output.append("""
        <NamedMeasurement type="numeric/double" name="Execution Time"><Value>0.001</Value></NamedMeasurement>
        <NamedMeasurement type="text/string" name="Completion Status"><Value>Completed</Value></NamedMeasurement>
        <NamedMeasurement type="text/string" name="Maintainer"><Value>%s</Value></NamedMeasurement>
        <NamedMeasurement type="text/string" name="Command Line"><Value>python PythonExtensionChecker.py</Value></NamedMeasurement>\n""" % (
            xml_escape(tres.getMaintainer() )
        ) )
                  xml_output.append(" " * 6 + '<Measurement>\n')
                  xml_output.append(" " * 8 + '<Value>\n')
                  if not tres.getMessage() is None:
                      xml_output.append(" " * 10 +  xml_escape(tres.getMessage() ) + "\n")
                  xml_output.append(" " * 8 + '</Value>\n')
                  xml_output.append(" " * 6 + '</Measurement>\n')
  
                  xml_output.append(" " * 4 + '</Results>\n')
                  xml_output.append(" " * 2 + '</Test>\n')
  
  
          xml_output.append("<EndDateTime>%s</EndDateTime>\n" % (time.strftime('%b %d %H:%M') ) )
          xml_output.append("<EndTestTime>%s</EndTestTime>\n" % (time.time()) )
          xml_output.append("<ElapsedMinutes></ElapsedMinutes>\n")
          xml_output.append("</Testing>\n")
          xml_output.append("</Site>\n")
  
          with open(output_path, "w") as f:
              for line in xml_output:
                  f.write(line)
  
          """
            /*
            <?xml version="1.0" encoding="UTF-8"?>
            <Site BuildName="Darwin-clang++"
                    BuildStamp="20121021-2300-Nightly"
                    Name="laphroaig.imp.fu-berlin.de"
                    Generator="ctest-2.8.9"
                    CompilerName="/usr/bin/clang++"
                    OSName="Mac OS X"
                    Hostname="laphroaig.imp.fu-berlin.de"
                    OSRelease="10.7.5"
                    OSVersion="11G63"
                    OSPlatform="x86_64"
                    Is64Bits="1"
                    VendorString="GenuineIntel"
                    VendorID="Intel Corporation"
                    FamilyID="6"
                    ModelID="37"
                    ProcessorCacheSize="32768"
                    NumberOfLogicalCPU="4"
                    NumberOfPhysicalCPU="2"
                    TotalVirtualMemory="512"
                    TotalPhysicalMemory="8192"
                    LogicalProcessorsPerPhysical="8"
                    ProcessorClockFrequency="2660"
            >
            <Testing>
            <StartDateTime>Oct 22 18:36 CEST</StartDateTime>
            <StartTestTime>1350923805</StartTestTime>
            <TestList>
              <Test>BinaryComposeFunctionAdapter_test</Test>
            </TestList>
            <Test Status="passed">
              <Name>BinaryComposeFunctionAdapter_test</Name>
              <Path>./source/TEST</Path>
              <FullName>./source/TEST/BinaryComposeFunctionAdapter_test</FullName>
              <FullCommandLine>/Users/aiche/dev/openms/openms-src/build/ninja/source/TEST/bin/BinaryComposeFunctionAdapter_test</FullCommandLine>
              <Results>
                      <NamedMeasurement type="numeric/double" name="Execution Time"><Value>0.469694</Value></NamedMeasurement>
                      <NamedMeasurement type="text/string" name="Completion Status"><Value>Completed</Value></NamedMeasurement>
                      <NamedMeasurement type="text/string" name="Command Line"><Value>/Users/aiche/dev/openms/openms-src/build/ninja/source/TEST/bin/BinaryComposeFunctionAdapter_test</Value></NamedMeasurement>
                      <Measurement>
                        <Value>
                        freier Text
                        </Value>
                      </Measurement>
              </Results>
            </Test>
                <EndDateTime>Oct 22 18:43 CEST</EndDateTime>
                <EndTestTime>1350924239</EndTestTime>
            <ElapsedMinutes>7.2</ElapsedMinutes></Testing>
          </Site>
            */
                  """
function_tokens: def to_cdash_xml ( self , template_path , output_path ) : if template_path . endswith ( "Test.xml" ) : body_start = "<Testing>" elif template_path . endswith ( "Build.xml" ) : body_start = "<Build>" else : raise Exception ( "Unsupported template name %s" % template_path ) xml_output = [ ] # load template head (everything up to "<Testing>") # -> this assumes a specific format of the xml with open ( template_path ) as f : for line in f : if line . strip ( ) == body_start : break xml_output . append ( line ) # Start writing the xml xml_output . append ( "  <Testing>\n" ) xml_output . append ( "  <StartDateTime>%s</StartDateTime>\n" % ( time . strftime ( '%b %d %H:%M' ) ) ) xml_output . append ( "  <StartTestTime>%s</StartTestTime>\n" % ( time . time ( ) ) ) xml_output . append ( "  <TestList>\n" ) for classtestresults in self : for tres in classtestresults : xml_output . append ( "    <Test>%s</Test>\n" % xml_escape ( tres . getXMLName ( ) ) ) xml_output . append ( "  </TestList>\n" ) for classtestresults in self : for tres in classtestresults : status = "" if tres . isPassed ( ) : status = "passed" else : status = "failed" xml_output . append ( " " * 2 + '<Test Status="%s">\n' % status ) xml_output . append ( " " * 4 + '<Name>%s</Name>\n' % xml_escape ( tres . getXMLName ( ) ) ) xml_output . append ( " " * 4 + '<Path> ./tools/ </Path>\n' ) xml_output . append ( " " * 4 + '<FullName>%s</FullName>\n' % xml_escape ( tres . name ) ) xml_output . append ( " " * 4 + '<FullCommandLine>python PythonExtensionChecker.py %s</FullCommandLine>\n' % xml_escape ( tres . name ) ) xml_output . append ( " " * 4 + '<Results>' ) xml_output . append ( """
        <NamedMeasurement type="numeric/double" name="Execution Time"><Value>0.001</Value></NamedMeasurement>
        <NamedMeasurement type="text/string" name="Completion Status"><Value>Completed</Value></NamedMeasurement>
        <NamedMeasurement type="text/string" name="Maintainer"><Value>%s</Value></NamedMeasurement>
        <NamedMeasurement type="text/string" name="Command Line"><Value>python PythonExtensionChecker.py</Value></NamedMeasurement>\n""" % ( xml_escape ( tres . getMaintainer ( ) ) ) ) xml_output . append ( " " * 6 + '<Measurement>\n' ) xml_output . append ( " " * 8 + '<Value>\n' ) if not tres . getMessage ( ) is None : xml_output . append ( " " * 10 + xml_escape ( tres . getMessage ( ) ) + "\n" ) xml_output . append ( " " * 8 + '</Value>\n' ) xml_output . append ( " " * 6 + '</Measurement>\n' ) xml_output . append ( " " * 4 + '</Results>\n' ) xml_output . append ( " " * 2 + '</Test>\n' ) xml_output . append ( "<EndDateTime>%s</EndDateTime>\n" % ( time . strftime ( '%b %d %H:%M' ) ) ) xml_output . append ( "<EndTestTime>%s</EndTestTime>\n" % ( time . time ( ) ) ) xml_output . append ( "<ElapsedMinutes></ElapsedMinutes>\n" ) xml_output . append ( "</Testing>\n" ) xml_output . append ( "</Site>\n" ) with open ( output_path , "w" ) as f : for line in xml_output : f . write ( line ) """
            /*
            <?xml version="1.0" encoding="UTF-8"?>
            <Site BuildName="Darwin-clang++"
                    BuildStamp="20121021-2300-Nightly"
                    Name="laphroaig.imp.fu-berlin.de"
                    Generator="ctest-2.8.9"
                    CompilerName="/usr/bin/clang++"
                    OSName="Mac OS X"
                    Hostname="laphroaig.imp.fu-berlin.de"
                    OSRelease="10.7.5"
                    OSVersion="11G63"
                    OSPlatform="x86_64"
                    Is64Bits="1"
                    VendorString="GenuineIntel"
                    VendorID="Intel Corporation"
                    FamilyID="6"
                    ModelID="37"
                    ProcessorCacheSize="32768"
                    NumberOfLogicalCPU="4"
                    NumberOfPhysicalCPU="2"
                    TotalVirtualMemory="512"
                    TotalPhysicalMemory="8192"
                    LogicalProcessorsPerPhysical="8"
                    ProcessorClockFrequency="2660"
            >
            <Testing>
            <StartDateTime>Oct 22 18:36 CEST</StartDateTime>
            <StartTestTime>1350923805</StartTestTime>
            <TestList>
              <Test>BinaryComposeFunctionAdapter_test</Test>
            </TestList>
            <Test Status="passed">
              <Name>BinaryComposeFunctionAdapter_test</Name>
              <Path>./source/TEST</Path>
              <FullName>./source/TEST/BinaryComposeFunctionAdapter_test</FullName>
              <FullCommandLine>/Users/aiche/dev/openms/openms-src/build/ninja/source/TEST/bin/BinaryComposeFunctionAdapter_test</FullCommandLine>
              <Results>
                      <NamedMeasurement type="numeric/double" name="Execution Time"><Value>0.469694</Value></NamedMeasurement>
                      <NamedMeasurement type="text/string" name="Completion Status"><Value>Completed</Value></NamedMeasurement>
                      <NamedMeasurement type="text/string" name="Command Line"><Value>/Users/aiche/dev/openms/openms-src/build/ninja/source/TEST/bin/BinaryComposeFunctionAdapter_test</Value></NamedMeasurement>
                      <Measurement>
                        <Value>
                        freier Text
                        </Value>
                      </Measurement>
              </Results>
            </Test>
                <EndDateTime>Oct 22 18:43 CEST</EndDateTime>
                <EndTestTime>1350924239</EndTestTime>
            <ElapsedMinutes>7.2</ElapsedMinutes></Testing>
          </Site>
            */
                  """