summaryrefslogtreecommitdiff
path: root/deps/v8/tools/testrunner/local/junit_output.py
diff options
context:
space:
mode:
authorRefael Ackermann <refack@gmail.com>2019-03-27 10:32:10 -0400
committerMichaël Zasso <targos@protonmail.com>2019-08-19 09:25:49 +0200
commit6ae69482daf7e59f6794b8281aeecd2b90446bcc (patch)
treedcf79f2c55760ccb703c892b9be7eb5fb77b39b3 /deps/v8/tools/testrunner/local/junit_output.py
parenta28348867b8b83e719872a5612a16a9612090483 (diff)
downloadandroid-node-v8-6ae69482daf7e59f6794b8281aeecd2b90446bcc.tar.gz
android-node-v8-6ae69482daf7e59f6794b8281aeecd2b90446bcc.tar.bz2
android-node-v8-6ae69482daf7e59f6794b8281aeecd2b90446bcc.zip
deps: V8: un-cherry-pick bd019bd
Original commit message: [testrunner] delete ancient junit compatible format support Testrunner has ancient support for JUnit compatible XML output. This CL removes this old feature. R=mstarzinger@chromium.org,jgruber@chromium.org,jkummerow@chromium.org CC=​machenbach@chromium.org Bug: v8:8728 Change-Id: I7e1beb011dbaec3aa1a27398a5c52abdd778eaf0 Reviewed-on: https://chromium-review.googlesource.com/c/1430065 Reviewed-by: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Commit-Queue: Tamer Tas <tmrts@chromium.org> Cr-Commit-Position: refs/heads/master@{#59045} Refs: https://github.com/v8/v8/commit/bd019bdb725cebaa34327634d73936cd7003d17c PR-URL: https://github.com/nodejs/node/pull/26685 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
Diffstat (limited to 'deps/v8/tools/testrunner/local/junit_output.py')
-rw-r--r--deps/v8/tools/testrunner/local/junit_output.py49
1 files changed, 49 insertions, 0 deletions
diff --git a/deps/v8/tools/testrunner/local/junit_output.py b/deps/v8/tools/testrunner/local/junit_output.py
new file mode 100644
index 0000000000..52f31ec422
--- /dev/null
+++ b/deps/v8/tools/testrunner/local/junit_output.py
@@ -0,0 +1,49 @@
+# Copyright 2013 the V8 project authors. All rights reserved.
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided
+# with the distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+import xml.etree.ElementTree as xml
+
+
+class JUnitTestOutput:
+ def __init__(self, test_suite_name):
+ self.root = xml.Element("testsuite")
+ self.root.attrib["name"] = test_suite_name
+
+ def HasRunTest(self, test_name, test_cmd, test_duration, test_failure):
+ testCaseElement = xml.Element("testcase")
+ testCaseElement.attrib["name"] = test_name
+ testCaseElement.attrib["cmd"] = test_cmd
+ testCaseElement.attrib["time"] = str(round(test_duration, 3))
+ if len(test_failure):
+ failureElement = xml.Element("failure")
+ failureElement.text = test_failure
+ testCaseElement.append(failureElement)
+ self.root.append(testCaseElement)
+
+ def FinishAndWrite(self, f):
+ xml.ElementTree(self.root).write(f, "UTF-8")