Commit 1ea09f0b authored by Michael Achenbach's avatar Michael Achenbach Committed by Commit Bot

[test] Ignore optimization state in tests on number fuzzer

This enable test suites to check which test driver framework is used.
When using number fuzzer on mjsunit, we add a JS file that
switches off the optimization-state assertions.

Checking intrinsic state is not feasible on the number fuzzer and in
the past, we needed to skip tests on demand, which is a maintenance
burden. The main function of the fuzzer, to check for dcheck errors and
tsan issues, is retained.

Bug: v8:9127
Change-Id: I699b85d5f7c9aaed337a2130d9eddc160c059d7b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1565892Reviewed-by: 's avatarSergiy Belozorov <sergiyb@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60816}
parent 9f37b2f7
...@@ -810,31 +810,6 @@ ...@@ -810,31 +810,6 @@
# Fails allocation on tsan. # Fails allocation on tsan.
'es6/classes': [PASS, ['tsan', SKIP]], 'es6/classes': [PASS, ['tsan', SKIP]],
'regress/regress-779407': [PASS, ['tsan', SKIP]], 'regress/regress-779407': [PASS, ['tsan', SKIP]],
# Tests that fail some assertions due to checking internal state sensitive
# to GC.
'array-literal-feedback': [SKIP],
'compiler/array-slice-clone': [SKIP],
'compiler/dataview-neutered': [SKIP],
'compiler/native-context-specialization-hole-check': [SKIP],
'compiler/regress-5320': [SKIP],
'elements-transition-hoisting': [SKIP],
'es6/collections-constructor-custom-iterator': [SKIP],
'field-type-tracking': [SKIP],
'ignition/throw-if-not-hole': [SKIP],
'keyed-load-with-symbol-key': [SKIP],
'object-seal': [SKIP],
'regress/regress-3709': [SKIP],
'regress/regress-385565': [SKIP],
'regress/regress-6948': [SKIP],
'regress/regress-6991': [SKIP],
'regress/regress-7014-1': [SKIP],
'regress/regress-7014-2': [SKIP],
'regress/regress-7510': [SKIP],
'regress/regress-crbug-882233-2': [SKIP],
'regress/regress-trap-allocation-memento': [SKIP],
'regress/regress-unlink-closures-on-deopt': [SKIP],
'shared-function-tier-up-turbo': [SKIP],
}], # 'gc_fuzzer' }], # 'gc_fuzzer'
############################################################################## ##############################################################################
......
// Copyright 2019 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.
// This file is added after mjsunit.js on the number fuzzer in order to
// ignore optimization state assertions, which are invalid in many test cases
// when gc timings are fuzzed.
(function () {
assertUnoptimized = function assertUnoptimized() {};
assertOptimized = function assertOptimized() {};
})();
...@@ -67,7 +67,7 @@ class TestLoader(testsuite.JSTestLoader): ...@@ -67,7 +67,7 @@ class TestLoader(testsuite.JSTestLoader):
def excluded_files(self): def excluded_files(self):
return { return {
"mjsunit.js", "mjsunit.js",
"mjsunit_suppressions.js", "mjsunit_numfuzz.js",
} }
...@@ -111,6 +111,9 @@ class TestCase(testcase.D8TestCase): ...@@ -111,6 +111,9 @@ class TestCase(testcase.D8TestCase):
else: else:
mjsunit_files = [os.path.join(self.suite.root, "mjsunit.js")] mjsunit_files = [os.path.join(self.suite.root, "mjsunit.js")]
if self.suite.framework_name == 'num_fuzzer':
mjsunit_files.append(os.path.join(self.suite.root, "mjsunit_numfuzz.js"))
files_suffix = [] files_suffix = []
if MODULE_PATTERN.search(source): if MODULE_PATTERN.search(source):
files_suffix.append("--module") files_suffix.append("--module")
......
...@@ -632,7 +632,8 @@ class BaseTestRunner(object): ...@@ -632,7 +632,8 @@ class BaseTestRunner(object):
if options.verbose: if options.verbose:
print('>>> Loading test suite: %s' % name) print('>>> Loading test suite: %s' % name)
suite = testsuite.TestSuite.Load( suite = testsuite.TestSuite.Load(
os.path.join(options.test_root, name), test_config) os.path.join(options.test_root, name), test_config,
self.framework_name)
if self._is_testsuite_supported(suite, options): if self._is_testsuite_supported(suite, options):
tests = suite.load_tests_from_disk(variables) tests = suite.load_tests_from_disk(variables)
......
...@@ -241,15 +241,16 @@ def _load_testsuite_module(name, root): ...@@ -241,15 +241,16 @@ def _load_testsuite_module(name, root):
class TestSuite(object): class TestSuite(object):
@staticmethod @staticmethod
def Load(root, test_config): def Load(root, test_config, framework_name):
name = root.split(os.path.sep)[-1] name = root.split(os.path.sep)[-1]
with _load_testsuite_module(name, root) as module: with _load_testsuite_module(name, root) as module:
return module.GetSuite(name, root, test_config) return module.GetSuite(name, root, test_config, framework_name)
def __init__(self, name, root, test_config): def __init__(self, name, root, test_config, framework_name):
self.name = name # string self.name = name # string
self.root = root # string containing path self.root = root # string containing path
self.test_config = test_config self.test_config = test_config
self.framework_name = framework_name # name of the test runner impl
self.tests = None # list of TestCase objects self.tests = None # list of TestCase objects
self.statusfile = None self.statusfile = None
......
...@@ -37,7 +37,8 @@ class TestSuiteTest(unittest.TestCase): ...@@ -37,7 +37,8 @@ class TestSuiteTest(unittest.TestCase):
verbose=False, verbose=False,
) )
self.suite = TestSuite.Load(self.test_root, self.test_config) self.suite = TestSuite.Load(
self.test_root, self.test_config, "standard_runner")
def testLoadingTestSuites(self): def testLoadingTestSuites(self):
self.assertEquals(self.suite.name, "fake_testsuite") self.assertEquals(self.suite.name, "fake_testsuite")
......
...@@ -522,7 +522,8 @@ class SourceProcessor(SourceFileProcessor): ...@@ -522,7 +522,8 @@ class SourceProcessor(SourceFileProcessor):
if match: if match:
print("%s Flags should use '-' (not '_')" % name) print("%s Flags should use '-' (not '_')" % name)
result = False result = False
if not "mjsunit/mjsunit.js" in name: if (not "mjsunit/mjsunit.js" in name and
not "mjsunit/mjsunit_numfuzz.js" in name):
if ASSERT_OPTIMIZED_PATTERN.search(contents) and \ if ASSERT_OPTIMIZED_PATTERN.search(contents) and \
not FLAGS_ENABLE_OPT.search(contents): not FLAGS_ENABLE_OPT.search(contents):
print("%s Flag --opt should be set if " \ print("%s Flag --opt should be set if " \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment