summaryrefslogtreecommitdiff
path: root/chromium/v8/tools/testrunner
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-12 14:27:29 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 09:35:20 +0000
commitc30a6232df03e1efbd9f3b226777b07e087a1122 (patch)
treee992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/v8/tools/testrunner
parent7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff)
downloadqtwebengine-chromium-85-based.tar.gz
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/v8/tools/testrunner')
-rw-r--r--chromium/v8/tools/testrunner/local/statusfile.py5
-rwxr-xr-xchromium/v8/tools/testrunner/local/statusfile_unittest.py11
-rw-r--r--chromium/v8/tools/testrunner/local/testsuite.py2
-rw-r--r--chromium/v8/tools/testrunner/local/utils.py2
-rwxr-xr-xchromium/v8/tools/testrunner/num_fuzzer.py3
-rw-r--r--chromium/v8/tools/testrunner/objects/testcase.py5
-rw-r--r--chromium/v8/tools/testrunner/outproc/base.py2
-rw-r--r--chromium/v8/tools/testrunner/outproc/message.py4
-rwxr-xr-xchromium/v8/tools/testrunner/standard_runner.py3
-rw-r--r--chromium/v8/tools/testrunner/testproc/progress.py53
-rw-r--r--chromium/v8/tools/testrunner/testproc/timeout.py1
-rw-r--r--chromium/v8/tools/testrunner/testproc/util_unittest.py11
12 files changed, 75 insertions, 27 deletions
diff --git a/chromium/v8/tools/testrunner/local/statusfile.py b/chromium/v8/tools/testrunner/local/statusfile.py
index f99941eb991..c8a1b307e41 100644
--- a/chromium/v8/tools/testrunner/local/statusfile.py
+++ b/chromium/v8/tools/testrunner/local/statusfile.py
@@ -27,12 +27,13 @@
# for py2/py3 compatibility
from __future__ import print_function
+from __future__ import absolute_import
import os
import re
-from variants import ALL_VARIANTS
-from utils import Freeze
+from .variants import ALL_VARIANTS
+from .utils import Freeze
# Possible outcomes
FAIL = "FAIL"
diff --git a/chromium/v8/tools/testrunner/local/statusfile_unittest.py b/chromium/v8/tools/testrunner/local/statusfile_unittest.py
index e8d5ff99cd1..3e2493c0ce6 100755
--- a/chromium/v8/tools/testrunner/local/statusfile_unittest.py
+++ b/chromium/v8/tools/testrunner/local/statusfile_unittest.py
@@ -4,10 +4,17 @@
# found in the LICENSE file.
+from __future__ import absolute_import
+import os
+import sys
import unittest
-import statusfile
-from utils import Freeze
+TOOLS_PATH = os.path.dirname(os.path.dirname(os.path.dirname(
+ os.path.abspath(__file__))))
+sys.path.append(TOOLS_PATH)
+
+from testrunner.local import statusfile
+from testrunner.local.utils import Freeze
TEST_VARIABLES = {
diff --git a/chromium/v8/tools/testrunner/local/testsuite.py b/chromium/v8/tools/testrunner/local/testsuite.py
index 864d7346fca..a72ef4be610 100644
--- a/chromium/v8/tools/testrunner/local/testsuite.py
+++ b/chromium/v8/tools/testrunner/local/testsuite.py
@@ -223,7 +223,7 @@ class TestGenerator(object):
return self
def __next__(self):
- return self.next()
+ return next(self)
def next(self):
return next(self._iterator)
diff --git a/chromium/v8/tools/testrunner/local/utils.py b/chromium/v8/tools/testrunner/local/utils.py
index 9128c433a04..b1c3575621c 100644
--- a/chromium/v8/tools/testrunner/local/utils.py
+++ b/chromium/v8/tools/testrunner/local/utils.py
@@ -35,7 +35,7 @@ import os
import platform
import re
import subprocess
-import urllib2
+import urllib
### Exit codes and their meaning.
diff --git a/chromium/v8/tools/testrunner/num_fuzzer.py b/chromium/v8/tools/testrunner/num_fuzzer.py
index d4e92a61e80..7777f4c66d8 100755
--- a/chromium/v8/tools/testrunner/num_fuzzer.py
+++ b/chromium/v8/tools/testrunner/num_fuzzer.py
@@ -5,13 +5,14 @@
# found in the LICENSE file.
# for py2/py3 compatibility
+from __future__ import absolute_import
from __future__ import print_function
import random
import sys
# Adds testrunner to the path hence it has to be imported at the beggining.
-import base_runner
+from . import base_runner
from testrunner.local import utils
diff --git a/chromium/v8/tools/testrunner/objects/testcase.py b/chromium/v8/tools/testrunner/objects/testcase.py
index 2a75cf60c45..ac4defd2d78 100644
--- a/chromium/v8/tools/testrunner/objects/testcase.py
+++ b/chromium/v8/tools/testrunner/objects/testcase.py
@@ -161,6 +161,11 @@ class TestCase(object):
statusfile.CRASH not in self._statusfile_outcomes)
@property
+ def is_fail(self):
+ return (statusfile.FAIL in self._statusfile_outcomes and
+ statusfile.PASS not in self._statusfile_outcomes)
+
+ @property
def only_standard_variant(self):
return statusfile.NO_VARIANTS in self._statusfile_outcomes
diff --git a/chromium/v8/tools/testrunner/outproc/base.py b/chromium/v8/tools/testrunner/outproc/base.py
index 9b65ca564a9..847b2242ffa 100644
--- a/chromium/v8/tools/testrunner/outproc/base.py
+++ b/chromium/v8/tools/testrunner/outproc/base.py
@@ -193,6 +193,8 @@ class ExpectedOutProc(OutProc):
line.startswith('**') or
line.startswith('ANDROID') or
line.startswith('###') or
+ # Android linker warning.
+ line.startswith('WARNING: linker:') or
# FIXME(machenbach): The test driver shouldn't try to use slow
# asserts if they weren't compiled. This fails in optdebug=2.
line == 'Warning: unknown flag --enable-slow-asserts.' or
diff --git a/chromium/v8/tools/testrunner/outproc/message.py b/chromium/v8/tools/testrunner/outproc/message.py
index f196cfd614b..c253b6f8e06 100644
--- a/chromium/v8/tools/testrunner/outproc/message.py
+++ b/chromium/v8/tools/testrunner/outproc/message.py
@@ -59,5 +59,7 @@ class OutProc(base.OutProc):
not string.strip() or
string.startswith("==") or
string.startswith("**") or
- string.startswith("ANDROID")
+ string.startswith("ANDROID") or
+ # Android linker warning.
+ string.startswith('WARNING: linker:')
)
diff --git a/chromium/v8/tools/testrunner/standard_runner.py b/chromium/v8/tools/testrunner/standard_runner.py
index 10545fa5f24..9790e463437 100755
--- a/chromium/v8/tools/testrunner/standard_runner.py
+++ b/chromium/v8/tools/testrunner/standard_runner.py
@@ -5,6 +5,7 @@
# found in the LICENSE file.
# for py2/py3 compatibility
+from __future__ import absolute_import
from __future__ import print_function
from functools import reduce
@@ -15,7 +16,7 @@ import sys
import tempfile
# Adds testrunner to the path hence it has to be imported at the beggining.
-import base_runner
+from . import base_runner
from testrunner.local import utils
from testrunner.local.variants import ALL_VARIANTS
diff --git a/chromium/v8/tools/testrunner/testproc/progress.py b/chromium/v8/tools/testrunner/testproc/progress.py
index 671eebb9222..7a47c1b692a 100644
--- a/chromium/v8/tools/testrunner/testproc/progress.py
+++ b/chromium/v8/tools/testrunner/testproc/progress.py
@@ -4,6 +4,7 @@
# for py2/py3 compatibility
from __future__ import print_function
+from __future__ import absolute_import
import datetime
import json
@@ -12,7 +13,7 @@ import platform
import subprocess
import sys
import time
-import util
+from . import util
from . import base
@@ -243,15 +244,22 @@ class CompactProgressIndicator(ProgressIndicator):
self._clear_line(self._last_status_length)
print_failure_header(test)
if len(stdout):
- print(self._templates['stdout'] % stdout)
+ self.printFormatted('stdout', stdout)
if len(stderr):
- print(self._templates['stderr'] % stderr)
- print("Command: %s" % result.cmd.to_string(relative=True))
+ self.printFormatted('stderr', stderr)
+ self.printFormatted(
+ 'command', "Command: %s" % result.cmd.to_string(relative=True))
if output.HasCrashed():
- print("exit code: %s" % output.exit_code_string)
- print("--- CRASHED ---")
- if output.HasTimedOut():
- print("--- TIMEOUT ---")
+ self.printFormatted(
+ 'failure', "exit code: %s" % output.exit_code_string)
+ self.printFormatted('failure', "--- CRASHED ---")
+ elif output.HasTimedOut():
+ self.printFormatted('failure', "--- TIMEOUT ---")
+ else:
+ if test.is_fail:
+ self.printFormatted('failure', "--- UNEXPECTED PASS ---")
+ else:
+ self.printFormatted('failure', "--- FAILED ---")
def finished(self):
self._print_progress('Done')
@@ -272,12 +280,12 @@ class CompactProgressIndicator(ProgressIndicator):
'mins': int(elapsed) // 60,
'secs': int(elapsed) % 60
}
- status = self._truncate(status, 78)
+ status = self._truncateStatusLine(status, 78)
self._last_status_length = len(status)
print(status, end='')
sys.stdout.flush()
- def _truncate(self, string, length):
+ def _truncateStatusLine(self, string, length):
if length and len(string) > (length - 3):
return string[:(length - 3)] + "..."
else:
@@ -296,22 +304,33 @@ class ColorProgressIndicator(CompactProgressIndicator):
"\033[31m-%(failed) 4d\033[0m]: %(test)s"),
'stdout': "\033[1m%s\033[0m",
'stderr': "\033[31m%s\033[0m",
+ 'failure': "\033[1;31m%s\033[0m",
+ 'command': "\033[33m%s\033[0m",
}
super(ColorProgressIndicator, self).__init__(templates)
+ def printFormatted(self, format, string):
+ print(self._templates[format] % string)
+
+ def _truncateStatusLine(self, string, length):
+ # Add some slack for the color control chars
+ return super(ColorProgressIndicator, self)._truncateStatusLine(
+ string, length + 3*9)
+
def _clear_line(self, last_length):
print("\033[1K\r", end='')
class MonochromeProgressIndicator(CompactProgressIndicator):
def __init__(self):
- templates = {
- 'status_line': ("[%(mins)02i:%(secs)02i|%%%(progress) 4d|"
- "+%(passed) 4d|-%(failed) 4d]: %(test)s"),
- 'stdout': '%s',
- 'stderr': '%s',
- }
- super(MonochromeProgressIndicator, self).__init__(templates)
+ templates = {
+ 'status_line': ("[%(mins)02i:%(secs)02i|%%%(progress) 4d|"
+ "+%(passed) 4d|-%(failed) 4d]: %(test)s"),
+ }
+ super(MonochromeProgressIndicator, self).__init__(templates)
+
+ def printFormatted(self, format, string):
+ print(string)
def _clear_line(self, last_length):
print(("\r" + (" " * last_length) + "\r"), end='')
diff --git a/chromium/v8/tools/testrunner/testproc/timeout.py b/chromium/v8/tools/testrunner/testproc/timeout.py
index 9a4e88c8f05..026ba02cd97 100644
--- a/chromium/v8/tools/testrunner/testproc/timeout.py
+++ b/chromium/v8/tools/testrunner/testproc/timeout.py
@@ -1,3 +1,4 @@
+from __future__ import print_function
# Copyright 2018 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
diff --git a/chromium/v8/tools/testrunner/testproc/util_unittest.py b/chromium/v8/tools/testrunner/testproc/util_unittest.py
index 243bf9789a7..5bf6a6e79ad 100644
--- a/chromium/v8/tools/testrunner/testproc/util_unittest.py
+++ b/chromium/v8/tools/testrunner/testproc/util_unittest.py
@@ -3,9 +3,18 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-from util import FixedSizeTopList
+from __future__ import absolute_import
+
+import os
+import sys
import unittest
+TOOLS_PATH = os.path.dirname(os.path.dirname(os.path.dirname(
+ os.path.abspath(__file__))))
+sys.path.append(TOOLS_PATH)
+
+from testrunner.testproc.util import FixedSizeTopList
+
class TestOrderedFixedSizeList(unittest.TestCase):
def test_empty(self):
ofsl = FixedSizeTopList(3)