Exemplo n.º 1
0
 def __junit_test(self, test):
     """ Runs a junit test .class file """
     tr = TestResult(name=test["name"], test_type=test["type"])
     junit_runner = "junit-platform-console-standalone-1.3.1.jar"
     cmd = shlex.split(
         (f"""java -jar {utils.libdir() / junit_runner}"""
          f""" -cp "{self.outdir}" -c {test["classname"]} --reports-dir="""
          f"""{self.outdir} --disable-ansi-colors"""),
         posix=("win" not in sys.platform),
     )
     tr.retval, tr.stdout, tr.stderr = utils.run_command(cmd,
                                                         cwd=self.workdir)
     tr.cmd = " ".join(cmd)
     tr.stdout, tr.points, tr.maxpoints = junit.parse_xml(self.workdir /
                                                          self.outdir)
     self.results.append(tr)