2012-09-24 09:38:46 +00:00
|
|
|
# Copyright 2012 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.
|
|
|
|
|
|
|
|
|
2017-08-09 17:42:03 +00:00
|
|
|
import fnmatch
|
2012-09-24 09:38:46 +00:00
|
|
|
import imp
|
|
|
|
import os
|
|
|
|
|
2014-09-02 11:18:47 +00:00
|
|
|
from . import commands
|
2012-09-24 09:38:46 +00:00
|
|
|
from . import statusfile
|
2013-01-18 14:55:23 +00:00
|
|
|
from . import utils
|
2014-09-02 12:46:27 +00:00
|
|
|
from ..objects import testcase
|
2016-08-04 14:41:09 +00:00
|
|
|
from variants import ALL_VARIANTS, ALL_VARIANT_FLAGS, FAST_VARIANT_FLAGS
|
|
|
|
|
2012-09-24 09:38:46 +00:00
|
|
|
|
2015-07-29 07:14:15 +00:00
|
|
|
FAST_VARIANTS = set(["default", "turbofan"])
|
|
|
|
STANDARD_VARIANT = set(["default"])
|
|
|
|
|
|
|
|
|
|
|
|
class VariantGenerator(object):
|
|
|
|
def __init__(self, suite, variants):
|
|
|
|
self.suite = suite
|
|
|
|
self.all_variants = ALL_VARIANTS & variants
|
|
|
|
self.fast_variants = FAST_VARIANTS & variants
|
|
|
|
self.standard_variant = STANDARD_VARIANT & variants
|
|
|
|
|
|
|
|
def FilterVariantsByTest(self, testcase):
|
2016-05-02 09:22:35 +00:00
|
|
|
result = self.all_variants
|
2017-11-20 21:42:13 +00:00
|
|
|
outcomes = testcase.suite.GetOutcomesForTestCase(testcase)
|
|
|
|
if outcomes:
|
|
|
|
if statusfile.OnlyStandardVariant(outcomes):
|
2016-05-02 09:22:35 +00:00
|
|
|
return self.standard_variant
|
2017-11-20 21:42:13 +00:00
|
|
|
if statusfile.OnlyFastVariants(outcomes):
|
2016-05-02 09:22:35 +00:00
|
|
|
result = self.fast_variants
|
|
|
|
return result
|
2015-07-29 07:14:15 +00:00
|
|
|
|
|
|
|
def GetFlagSets(self, testcase, variant):
|
2017-11-20 21:42:13 +00:00
|
|
|
outcomes = testcase.suite.GetOutcomesForTestCase(testcase)
|
|
|
|
if outcomes and statusfile.OnlyFastVariants(outcomes):
|
2015-07-29 07:14:15 +00:00
|
|
|
return FAST_VARIANT_FLAGS[variant]
|
|
|
|
else:
|
|
|
|
return ALL_VARIANT_FLAGS[variant]
|
2014-11-05 13:05:28 +00:00
|
|
|
|
|
|
|
|
2012-09-24 09:38:46 +00:00
|
|
|
class TestSuite(object):
|
|
|
|
|
|
|
|
@staticmethod
|
2015-11-27 12:51:43 +00:00
|
|
|
def LoadTestSuite(root, global_init=True):
|
2012-09-24 09:38:46 +00:00
|
|
|
name = root.split(os.path.sep)[-1]
|
|
|
|
f = None
|
|
|
|
try:
|
|
|
|
(f, pathname, description) = imp.find_module("testcfg", [root])
|
2017-05-09 11:44:18 +00:00
|
|
|
module = imp.load_module(name + "_testcfg", f, pathname, description)
|
2014-09-02 09:21:03 +00:00
|
|
|
return module.GetSuite(name, root)
|
2015-11-25 12:20:37 +00:00
|
|
|
except ImportError:
|
2014-09-02 09:21:03 +00:00
|
|
|
# Use default if no testcfg is present.
|
|
|
|
return GoogleTestSuite(name, root)
|
2012-09-24 09:38:46 +00:00
|
|
|
finally:
|
|
|
|
if f:
|
|
|
|
f.close()
|
|
|
|
|
|
|
|
def __init__(self, name, root):
|
2015-11-27 12:51:43 +00:00
|
|
|
# Note: This might be called concurrently from different processes.
|
2012-09-24 09:38:46 +00:00
|
|
|
self.name = name # string
|
|
|
|
self.root = root # string containing path
|
|
|
|
self.tests = None # list of TestCase objects
|
2017-11-20 13:48:53 +00:00
|
|
|
self.rules = None # {variant: {test name: [rule]}}
|
|
|
|
self.prefix_rules = None # {variant: {test name prefix: [rule]}}
|
2012-09-24 09:38:46 +00:00
|
|
|
self.total_duration = None # float, assigned on demand
|
|
|
|
|
2017-11-20 21:42:13 +00:00
|
|
|
self._outcomes_cache = dict()
|
|
|
|
|
2012-09-24 09:38:46 +00:00
|
|
|
def suffix(self):
|
|
|
|
return ".js"
|
|
|
|
|
|
|
|
def status_file(self):
|
|
|
|
return "%s/%s.status" % (self.root, self.name)
|
|
|
|
|
|
|
|
# Used in the status file and for stdout printing.
|
|
|
|
def CommonTestName(self, testcase):
|
2013-08-06 14:39:39 +00:00
|
|
|
if utils.IsWindows():
|
|
|
|
return testcase.path.replace("\\", "/")
|
|
|
|
else:
|
|
|
|
return testcase.path
|
2012-09-24 09:38:46 +00:00
|
|
|
|
|
|
|
def ListTests(self, context):
|
|
|
|
raise NotImplementedError
|
|
|
|
|
2015-07-29 07:14:15 +00:00
|
|
|
def _VariantGeneratorFactory(self):
|
|
|
|
"""The variant generator class to be used."""
|
|
|
|
return VariantGenerator
|
|
|
|
|
|
|
|
def CreateVariantGenerator(self, variants):
|
|
|
|
"""Return a generator for the testing variants of this suite.
|
|
|
|
|
|
|
|
Args:
|
|
|
|
variants: List of variant names to be run as specified by the test
|
|
|
|
runner.
|
|
|
|
Returns: An object of type VariantGenerator.
|
|
|
|
"""
|
|
|
|
return self._VariantGeneratorFactory()(self, set(variants))
|
2012-09-24 09:38:46 +00:00
|
|
|
|
2016-08-08 12:39:02 +00:00
|
|
|
def PrepareSources(self):
|
|
|
|
"""Called once before multiprocessing for doing file-system operations.
|
|
|
|
|
|
|
|
This should not access the network. For network access use the method
|
|
|
|
below.
|
|
|
|
"""
|
|
|
|
pass
|
|
|
|
|
2012-09-24 09:38:46 +00:00
|
|
|
def ReadStatusFile(self, variables):
|
2016-08-04 14:41:09 +00:00
|
|
|
with open(self.status_file()) as f:
|
2017-11-20 13:48:53 +00:00
|
|
|
self.rules, self.prefix_rules = (
|
2016-08-04 14:41:09 +00:00
|
|
|
statusfile.ReadStatusFile(f.read(), variables))
|
2012-09-24 09:38:46 +00:00
|
|
|
|
|
|
|
def ReadTestCases(self, context):
|
|
|
|
self.tests = self.ListTests(context)
|
|
|
|
|
2017-11-20 21:42:13 +00:00
|
|
|
def GetStatusfileFlags(self, test):
|
|
|
|
"""Gets runtime flags from a status file.
|
2013-11-25 17:34:52 +00:00
|
|
|
|
2017-11-20 21:42:13 +00:00
|
|
|
Every outcome that starts with "--" is a flag. Status file has to be loaded
|
|
|
|
before using this function.
|
|
|
|
"""
|
|
|
|
flags = []
|
|
|
|
for outcome in self.GetOutcomesForTestCase(test):
|
|
|
|
if outcome.startswith('--'):
|
|
|
|
flags.append(outcome)
|
|
|
|
return flags
|
2016-08-04 14:41:09 +00:00
|
|
|
|
2017-11-20 21:42:13 +00:00
|
|
|
def FilterTestCasesByStatus(self,
|
|
|
|
slow_tests_mode=None,
|
|
|
|
pass_fail_tests_mode=None):
|
|
|
|
"""Filters tests by outcomes from status file.
|
2016-08-04 14:41:09 +00:00
|
|
|
|
2017-11-20 21:42:13 +00:00
|
|
|
Status file has to be loaded before using this function.
|
|
|
|
|
|
|
|
Args:
|
|
|
|
slow_tests_mode: What to do with slow tests.
|
|
|
|
pass_fail_tests_mode: What to do with pass or fail tests.
|
|
|
|
|
|
|
|
Mode options:
|
|
|
|
None (default) - don't skip
|
|
|
|
"skip" - skip if slow/pass_fail
|
|
|
|
"run" - skip if not slow/pass_fail
|
|
|
|
"""
|
|
|
|
def _skip_slow(is_slow, mode):
|
|
|
|
return (
|
|
|
|
(mode == 'run' and not is_slow) or
|
|
|
|
(mode == 'skip' and is_slow))
|
|
|
|
|
|
|
|
def _skip_pass_fail(pass_fail, mode):
|
|
|
|
return (
|
|
|
|
(mode == 'run' and not pass_fail) or
|
|
|
|
(mode == 'skip' and pass_fail))
|
|
|
|
|
|
|
|
def _compliant(test):
|
|
|
|
outcomes = self.GetOutcomesForTestCase(test)
|
|
|
|
if statusfile.DoSkip(outcomes):
|
|
|
|
return False
|
|
|
|
if _skip_slow(statusfile.IsSlow(outcomes), slow_tests_mode):
|
|
|
|
return False
|
|
|
|
if _skip_pass_fail(statusfile.IsPassOrFail(outcomes),
|
|
|
|
pass_fail_tests_mode):
|
|
|
|
return False
|
|
|
|
return True
|
|
|
|
|
|
|
|
self.tests = filter(_compliant, self.tests)
|
|
|
|
|
|
|
|
def WarnUnusedRules(self, check_variant_rules=False):
|
|
|
|
"""Finds and prints unused rules in status file.
|
|
|
|
|
|
|
|
Rule X is unused when it doesn't apply to any tests, which can also mean
|
|
|
|
that all matching tests were skipped by another rule before evaluating X.
|
|
|
|
|
|
|
|
Status file has to be loaded before using this function.
|
|
|
|
"""
|
|
|
|
|
|
|
|
if check_variant_rules:
|
|
|
|
variants = list(ALL_VARIANTS)
|
|
|
|
else:
|
|
|
|
variants = ['']
|
2012-09-24 09:38:46 +00:00
|
|
|
used_rules = set()
|
2016-08-04 14:41:09 +00:00
|
|
|
|
2012-09-24 09:38:46 +00:00
|
|
|
for t in self.tests:
|
|
|
|
testname = self.CommonTestName(t)
|
2016-08-04 14:41:09 +00:00
|
|
|
variant = t.variant or ""
|
2017-11-20 21:42:13 +00:00
|
|
|
|
|
|
|
if testname in self.rules.get(variant, {}):
|
2016-08-04 14:41:09 +00:00
|
|
|
used_rules.add((testname, variant))
|
2017-11-20 21:42:13 +00:00
|
|
|
if statusfile.DoSkip(self.rules[variant][testname]):
|
|
|
|
continue
|
|
|
|
|
|
|
|
for prefix in self.prefix_rules.get(variant, {}):
|
2017-11-20 13:48:53 +00:00
|
|
|
if testname.startswith(prefix):
|
|
|
|
used_rules.add((prefix, variant))
|
2017-11-20 21:42:13 +00:00
|
|
|
if statusfile.DoSkip(self.prefix_rules[variant][prefix]):
|
|
|
|
break
|
|
|
|
|
|
|
|
for variant in variants:
|
|
|
|
for rule, value in (list(self.rules.get(variant, {}).iteritems()) +
|
|
|
|
list(self.prefix_rules.get(variant, {}).iteritems())):
|
|
|
|
if (rule, variant) not in used_rules:
|
|
|
|
if variant == '':
|
|
|
|
variant_desc = 'variant independent'
|
|
|
|
else:
|
|
|
|
variant_desc = 'variant: %s' % variant
|
|
|
|
print('Unused rule: %s -> %s (%s)' % (rule, value, variant_desc))
|
2012-09-24 09:38:46 +00:00
|
|
|
|
|
|
|
def FilterTestCasesByArgs(self, args):
|
2015-07-23 13:01:15 +00:00
|
|
|
"""Filter test cases based on command-line arguments.
|
|
|
|
|
2017-08-09 17:42:03 +00:00
|
|
|
args can be a glob: asterisks in any position of the argument
|
|
|
|
represent zero or more characters. Without asterisks, only exact matches
|
2015-07-23 13:01:15 +00:00
|
|
|
will be used with the exeption of the test-suite name as argument.
|
|
|
|
"""
|
2012-09-24 09:38:46 +00:00
|
|
|
filtered = []
|
2015-07-23 13:01:15 +00:00
|
|
|
globs = []
|
2012-09-24 09:38:46 +00:00
|
|
|
for a in args:
|
2015-08-06 12:36:49 +00:00
|
|
|
argpath = a.split('/')
|
2012-09-24 09:38:46 +00:00
|
|
|
if argpath[0] != self.name:
|
|
|
|
continue
|
|
|
|
if len(argpath) == 1 or (len(argpath) == 2 and argpath[1] == '*'):
|
|
|
|
return # Don't filter, run all tests in this suite.
|
2015-09-17 13:00:57 +00:00
|
|
|
path = '/'.join(argpath[1:])
|
2017-08-09 17:42:03 +00:00
|
|
|
globs.append(path)
|
|
|
|
|
2012-09-24 09:38:46 +00:00
|
|
|
for t in self.tests:
|
2017-08-09 17:42:03 +00:00
|
|
|
for g in globs:
|
|
|
|
if fnmatch.fnmatch(t.path, g):
|
2015-07-23 13:01:15 +00:00
|
|
|
filtered.append(t)
|
|
|
|
break
|
2012-09-24 09:38:46 +00:00
|
|
|
self.tests = filtered
|
|
|
|
|
2017-11-20 21:42:13 +00:00
|
|
|
def GetOutcomesForTestCase(self, testcase):
|
|
|
|
"""Gets outcomes from status file.
|
|
|
|
|
|
|
|
Merges variant dependent and independent rules. Status file has to be loaded
|
|
|
|
before using this function.
|
|
|
|
"""
|
|
|
|
variant = testcase.variant or ''
|
|
|
|
testname = self.CommonTestName(testcase)
|
|
|
|
cache_key = '%s$%s' % (testname, variant)
|
|
|
|
|
|
|
|
if cache_key not in self._outcomes_cache:
|
|
|
|
# Load statusfile to get outcomes for the first time.
|
|
|
|
assert(self.rules is not None)
|
|
|
|
assert(self.prefix_rules is not None)
|
|
|
|
|
|
|
|
outcomes = frozenset()
|
|
|
|
|
|
|
|
for key in set([variant, '']):
|
|
|
|
rules = self.rules.get(key, {})
|
|
|
|
prefix_rules = self.prefix_rules.get(key, {})
|
|
|
|
|
|
|
|
if testname in rules:
|
|
|
|
outcomes |= rules[testname]
|
|
|
|
|
|
|
|
for prefix in prefix_rules:
|
|
|
|
if testname.startswith(prefix):
|
|
|
|
outcomes |= prefix_rules[prefix]
|
|
|
|
|
|
|
|
self._outcomes_cache[cache_key] = outcomes
|
|
|
|
|
|
|
|
return self._outcomes_cache[cache_key]
|
|
|
|
|
2017-11-16 15:31:43 +00:00
|
|
|
def GetShellForTestCase(self, testcase):
|
2017-11-20 21:42:13 +00:00
|
|
|
"""Returns shell to be executed for this test case."""
|
2017-11-16 15:31:43 +00:00
|
|
|
return 'd8'
|
|
|
|
|
2017-10-27 12:55:29 +00:00
|
|
|
def GetParametersForTestCase(self, testcase, context):
|
2017-11-16 14:42:28 +00:00
|
|
|
"""Returns a tuple of (files, flags, env) for this test case."""
|
2012-09-24 09:38:46 +00:00
|
|
|
raise NotImplementedError
|
|
|
|
|
|
|
|
def GetSourceForTest(self, testcase):
|
|
|
|
return "(no source available)"
|
|
|
|
|
2016-03-14 21:19:10 +00:00
|
|
|
def IsFailureOutput(self, testcase):
|
|
|
|
return testcase.output.exit_code != 0
|
2012-09-24 09:38:46 +00:00
|
|
|
|
|
|
|
def IsNegativeTest(self, testcase):
|
|
|
|
return False
|
|
|
|
|
|
|
|
def HasFailed(self, testcase):
|
2016-03-14 21:19:10 +00:00
|
|
|
execution_failed = self.IsFailureOutput(testcase)
|
2012-09-24 09:38:46 +00:00
|
|
|
if self.IsNegativeTest(testcase):
|
|
|
|
return not execution_failed
|
|
|
|
else:
|
|
|
|
return execution_failed
|
|
|
|
|
2014-07-03 09:33:22 +00:00
|
|
|
def GetOutcome(self, testcase):
|
2012-09-24 09:38:46 +00:00
|
|
|
if testcase.output.HasCrashed():
|
2014-07-03 09:33:22 +00:00
|
|
|
return statusfile.CRASH
|
2012-09-24 09:38:46 +00:00
|
|
|
elif testcase.output.HasTimedOut():
|
2014-07-03 09:33:22 +00:00
|
|
|
return statusfile.TIMEOUT
|
2012-09-24 09:38:46 +00:00
|
|
|
elif self.HasFailed(testcase):
|
2014-07-03 09:33:22 +00:00
|
|
|
return statusfile.FAIL
|
2012-09-24 09:38:46 +00:00
|
|
|
else:
|
2014-07-03 09:33:22 +00:00
|
|
|
return statusfile.PASS
|
|
|
|
|
|
|
|
def HasUnexpectedOutput(self, testcase):
|
|
|
|
outcome = self.GetOutcome(testcase)
|
2017-11-20 21:42:13 +00:00
|
|
|
return not outcome in (self.GetOutcomesForTestCase(testcase)
|
|
|
|
or [statusfile.PASS])
|
2012-09-24 09:38:46 +00:00
|
|
|
|
|
|
|
def StripOutputForTransmit(self, testcase):
|
|
|
|
if not self.HasUnexpectedOutput(testcase):
|
|
|
|
testcase.output.stdout = ""
|
|
|
|
testcase.output.stderr = ""
|
|
|
|
|
|
|
|
def CalculateTotalDuration(self):
|
|
|
|
self.total_duration = 0.0
|
|
|
|
for t in self.tests:
|
|
|
|
self.total_duration += t.duration
|
|
|
|
return self.total_duration
|
2014-09-02 09:21:03 +00:00
|
|
|
|
|
|
|
|
2015-07-29 07:14:15 +00:00
|
|
|
class StandardVariantGenerator(VariantGenerator):
|
|
|
|
def FilterVariantsByTest(self, testcase):
|
|
|
|
return self.standard_variant
|
|
|
|
|
|
|
|
|
2014-09-02 09:21:03 +00:00
|
|
|
class GoogleTestSuite(TestSuite):
|
|
|
|
def __init__(self, name, root):
|
|
|
|
super(GoogleTestSuite, self).__init__(name, root)
|
|
|
|
|
|
|
|
def ListTests(self, context):
|
2017-11-16 15:31:43 +00:00
|
|
|
shell = os.path.abspath(
|
|
|
|
os.path.join(context.shell_dir, self.GetShellForTestCase(None)))
|
2014-09-02 09:21:03 +00:00
|
|
|
if utils.IsWindows():
|
|
|
|
shell += ".exe"
|
2016-09-27 15:13:43 +00:00
|
|
|
|
|
|
|
output = None
|
|
|
|
for i in xrange(3): # Try 3 times in case of errors.
|
2017-10-16 09:29:50 +00:00
|
|
|
cmd = (
|
|
|
|
context.command_prefix +
|
|
|
|
[shell, "--gtest_list_tests"] +
|
|
|
|
context.extra_flags
|
|
|
|
)
|
|
|
|
output = commands.Execute(cmd)
|
2016-09-27 15:13:43 +00:00
|
|
|
if output.exit_code == 0:
|
|
|
|
break
|
Revert "Revert "[test] Fix win-asan symbolizer path""
This reverts commit 4054cf278fa73974336b7d06c1a7e2e49a721724.
Reason for revert: Just exposes existing issues.
Original change's description:
> Revert "[test] Fix win-asan symbolizer path"
>
> This reverts commit 135576ffb677765de83aa223ef7d57dbc6028fd4.
>
> Reason for revert: V8 Win32 ASAN failures: https://build.chromium.org/p/client.v8/builders/V8%20Win32%20ASAN/builds/73
>
> It appears these failures were lurking there already, but were hidden because of the bug this CL fixed. Opened https://crbug.com/v8/6953 about these issues.
>
> Original change's description:
> > [test] Fix win-asan symbolizer path
> >
> > This makes the symbolizer path relative, as the absolute paths contain
> > a drive letter + colon on windows. The colon is confused by the
> > sanitizer as an option separator.
> >
> > The test driver changes the cwd to the V8 root dir in each
> > invocation.
> >
> > Bug: chromium:726584
> > Change-Id: Icf4e5a55bba5dec8e59a3dfe3eccdf7224e65c33
> > Reviewed-on: https://chromium-review.googlesource.com/721124
> > Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
> > Commit-Queue: Michael Achenbach <machenbach@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#48652}
>
> TBR=glider@chromium.org,rnk@chromium.org,machenbach@chromium.org,sergiyb@chromium.org,etienneb@chromium.org
>
> Change-Id: Ic78527950f6a239a03658e042d7244c9781d05db
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: chromium:726584
> Reviewed-on: https://chromium-review.googlesource.com/723825
> Reviewed-by: Eric Holk <eholk@chromium.org>
> Commit-Queue: Eric Holk <eholk@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#48653}
TBR=glider@chromium.org,rnk@chromium.org,machenbach@chromium.org,eholk@chromium.org,sergiyb@chromium.org,etienneb@chromium.org
Change-Id: I8ea3b1d74ece09bed4758522f51cbee56a7792e1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:726584
Reviewed-on: https://chromium-review.googlesource.com/725319
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48662}
2017-10-18 06:54:23 +00:00
|
|
|
print "Test executable failed to list the tests (try %d).\n\nCmd:" % i
|
2017-10-16 09:29:50 +00:00
|
|
|
print ' '.join(cmd)
|
Revert "Revert "[test] Fix win-asan symbolizer path""
This reverts commit 4054cf278fa73974336b7d06c1a7e2e49a721724.
Reason for revert: Just exposes existing issues.
Original change's description:
> Revert "[test] Fix win-asan symbolizer path"
>
> This reverts commit 135576ffb677765de83aa223ef7d57dbc6028fd4.
>
> Reason for revert: V8 Win32 ASAN failures: https://build.chromium.org/p/client.v8/builders/V8%20Win32%20ASAN/builds/73
>
> It appears these failures were lurking there already, but were hidden because of the bug this CL fixed. Opened https://crbug.com/v8/6953 about these issues.
>
> Original change's description:
> > [test] Fix win-asan symbolizer path
> >
> > This makes the symbolizer path relative, as the absolute paths contain
> > a drive letter + colon on windows. The colon is confused by the
> > sanitizer as an option separator.
> >
> > The test driver changes the cwd to the V8 root dir in each
> > invocation.
> >
> > Bug: chromium:726584
> > Change-Id: Icf4e5a55bba5dec8e59a3dfe3eccdf7224e65c33
> > Reviewed-on: https://chromium-review.googlesource.com/721124
> > Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
> > Commit-Queue: Michael Achenbach <machenbach@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#48652}
>
> TBR=glider@chromium.org,rnk@chromium.org,machenbach@chromium.org,sergiyb@chromium.org,etienneb@chromium.org
>
> Change-Id: Ic78527950f6a239a03658e042d7244c9781d05db
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: chromium:726584
> Reviewed-on: https://chromium-review.googlesource.com/723825
> Reviewed-by: Eric Holk <eholk@chromium.org>
> Commit-Queue: Eric Holk <eholk@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#48653}
TBR=glider@chromium.org,rnk@chromium.org,machenbach@chromium.org,eholk@chromium.org,sergiyb@chromium.org,etienneb@chromium.org
Change-Id: I8ea3b1d74ece09bed4758522f51cbee56a7792e1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:726584
Reviewed-on: https://chromium-review.googlesource.com/725319
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48662}
2017-10-18 06:54:23 +00:00
|
|
|
print "\nStdout:"
|
2014-09-02 09:21:03 +00:00
|
|
|
print output.stdout
|
2016-09-27 15:13:43 +00:00
|
|
|
print "\nStderr:"
|
2014-09-02 09:21:03 +00:00
|
|
|
print output.stderr
|
2016-09-27 15:13:43 +00:00
|
|
|
print "\nExit code: %d" % output.exit_code
|
|
|
|
else:
|
2014-09-26 13:46:22 +00:00
|
|
|
raise Exception("Test executable failed to list the tests.")
|
2016-09-27 15:13:43 +00:00
|
|
|
|
2014-09-02 09:21:03 +00:00
|
|
|
tests = []
|
|
|
|
test_case = ''
|
|
|
|
for line in output.stdout.splitlines():
|
|
|
|
test_desc = line.strip().split()[0]
|
|
|
|
if test_desc.endswith('.'):
|
|
|
|
test_case = test_desc
|
|
|
|
elif test_case and test_desc:
|
2016-03-02 13:12:59 +00:00
|
|
|
test = testcase.TestCase(self, test_case + test_desc)
|
2014-09-02 09:21:03 +00:00
|
|
|
tests.append(test)
|
2016-03-31 07:38:10 +00:00
|
|
|
tests.sort(key=lambda t: t.path)
|
2014-09-02 09:21:03 +00:00
|
|
|
return tests
|
|
|
|
|
2017-10-27 12:55:29 +00:00
|
|
|
def GetParametersForTestCase(self, testcase, context):
|
2017-11-16 14:42:28 +00:00
|
|
|
flags = (
|
|
|
|
testcase.flags +
|
|
|
|
["--gtest_filter=" + testcase.path] +
|
|
|
|
["--gtest_random_seed=%s" % context.random_seed] +
|
|
|
|
["--gtest_print_time=0"] +
|
|
|
|
context.mode_flags)
|
|
|
|
return [], flags, {}
|
2014-09-02 09:21:03 +00:00
|
|
|
|
2015-07-29 07:14:15 +00:00
|
|
|
def _VariantGeneratorFactory(self):
|
|
|
|
return StandardVariantGenerator
|
2015-04-27 08:20:20 +00:00
|
|
|
|
2017-11-16 15:31:43 +00:00
|
|
|
def GetShellForTestCase(self, testcase):
|
2014-09-02 09:21:03 +00:00
|
|
|
return self.name
|