Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 434c127

Browse filesBrowse files
refacktargos
authored andcommitted
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: v8/v8@bd019bd Backport-PR-URL: #28955 PR-URL: #26685 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
1 parent 040e7da commit 434c127
Copy full SHA for 434c127

File tree

Expand file treeCollapse file tree

4 files changed

+96
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

4 files changed

+96
-1
lines changed
Open diff view settings
Collapse file

‎common.gypi‎

Copy file name to clipboardExpand all lines: common.gypi
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
# Reset this number to 0 on major V8 upgrades.
4040
# Increment by one for each non-official patch applied to deps/v8.
41-
'v8_embedder_string': '-node.1',
41+
'v8_embedder_string': '-node.2',
4242

4343
##### V8 defaults for Node.js #####
4444

Collapse file

‎deps/v8/tools/testrunner/base_runner.py‎

Copy file name to clipboardExpand all lines: deps/v8/tools/testrunner/base_runner.py
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,9 @@ def _add_parser_default_options(self, parser):
348348
"color, mono)")
349349
parser.add_option("--json-test-results",
350350
help="Path to a file for storing json results.")
351+
parser.add_option("--junitout", help="File name of the JUnit output")
352+
parser.add_option("--junittestsuite", default="v8tests",
353+
help="The testsuite name in the JUnit output file")
351354
parser.add_option("--exit-after-n-failures", type="int", default=100,
352355
help="Exit after the first N failures instead of "
353356
"running all tests. Pass 0 to disable this feature.")
@@ -787,6 +790,9 @@ def _get_shard_info(self, options):
787790

788791
def _create_progress_indicators(self, test_count, options):
789792
procs = [PROGRESS_INDICATORS[options.progress]()]
793+
if options.junitout:
794+
procs.append(progress.JUnitTestProgressIndicator(options.junitout,
795+
options.junittestsuite))
790796
if options.json_test_results:
791797
procs.append(progress.JsonTestProgressIndicator(
792798
self.framework_name,
Collapse file
+49Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Copyright 2013 the V8 project authors. All rights reserved.
2+
# Redistribution and use in source and binary forms, with or without
3+
# modification, are permitted provided that the following conditions are
4+
# met:
5+
#
6+
# * Redistributions of source code must retain the above copyright
7+
# notice, this list of conditions and the following disclaimer.
8+
# * Redistributions in binary form must reproduce the above
9+
# copyright notice, this list of conditions and the following
10+
# disclaimer in the documentation and/or other materials provided
11+
# with the distribution.
12+
# * Neither the name of Google Inc. nor the names of its
13+
# contributors may be used to endorse or promote products derived
14+
# from this software without specific prior written permission.
15+
#
16+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18+
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19+
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20+
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21+
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22+
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24+
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27+
28+
29+
import xml.etree.ElementTree as xml
30+
31+
32+
class JUnitTestOutput:
33+
def __init__(self, test_suite_name):
34+
self.root = xml.Element("testsuite")
35+
self.root.attrib["name"] = test_suite_name
36+
37+
def HasRunTest(self, test_name, test_cmd, test_duration, test_failure):
38+
testCaseElement = xml.Element("testcase")
39+
testCaseElement.attrib["name"] = test_name
40+
testCaseElement.attrib["cmd"] = test_cmd
41+
testCaseElement.attrib["time"] = str(round(test_duration, 3))
42+
if len(test_failure):
43+
failureElement = xml.Element("failure")
44+
failureElement.text = test_failure
45+
testCaseElement.append(failureElement)
46+
self.root.append(testCaseElement)
47+
48+
def FinishAndWrite(self, f):
49+
xml.ElementTree(self.root).write(f, "UTF-8")
Collapse file

‎deps/v8/tools/testrunner/testproc/progress.py‎

Copy file name to clipboardExpand all lines: deps/v8/tools/testrunner/testproc/progress.py
+40Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import time
1414

1515
from . import base
16+
from ..local import junit_output
1617

1718

1819
# Base dir of the build products for Release and Debug.
@@ -281,6 +282,45 @@ def _clear_line(self, last_length):
281282
print(("\r" + (" " * last_length) + "\r"), end='')
282283

283284

285+
class JUnitTestProgressIndicator(ProgressIndicator):
286+
def __init__(self, junitout, junittestsuite):
287+
super(JUnitTestProgressIndicator, self).__init__()
288+
self._requirement = base.DROP_PASS_STDOUT
289+
290+
self.outputter = junit_output.JUnitTestOutput(junittestsuite)
291+
if junitout:
292+
self.outfile = open(junitout, "w")
293+
else:
294+
self.outfile = sys.stdout
295+
296+
def _on_result_for(self, test, result):
297+
# TODO(majeski): Support for dummy/grouped results
298+
fail_text = ""
299+
output = result.output
300+
if result.has_unexpected_output:
301+
stdout = output.stdout.strip()
302+
if len(stdout):
303+
fail_text += "stdout:\n%s\n" % stdout
304+
stderr = output.stderr.strip()
305+
if len(stderr):
306+
fail_text += "stderr:\n%s\n" % stderr
307+
fail_text += "Command: %s" % result.cmd.to_string()
308+
if output.HasCrashed():
309+
fail_text += "exit code: %d\n--- CRASHED ---" % output.exit_code
310+
if output.HasTimedOut():
311+
fail_text += "--- TIMEOUT ---"
312+
self.outputter.HasRunTest(
313+
test_name=str(test),
314+
test_cmd=result.cmd.to_string(relative=True),
315+
test_duration=output.duration,
316+
test_failure=fail_text)
317+
318+
def finished(self):
319+
self.outputter.FinishAndWrite(self.outfile)
320+
if self.outfile != sys.stdout:
321+
self.outfile.close()
322+
323+
284324
class JsonTestProgressIndicator(ProgressIndicator):
285325
def __init__(self, framework_name, json_test_results, arch, mode):
286326
super(JsonTestProgressIndicator, self).__init__()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.