Add --with-asan (#31429)

This commit is contained in:
Samson 2024-06-16 11:24:07 +02:00 committed by GitHub
parent f0191c0a75
commit 8b35c4094a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 64 additions and 22 deletions

View file

@ -304,8 +304,8 @@ class MachCommands(CommandBase):
category='testing',
parser=wpt.create_parser)
@CommandBase.common_command_arguments(build_configuration=False, build_type=True)
def test_wpt(self, build_type: BuildType, **kwargs):
return self._test_wpt(build_type=build_type, **kwargs)
def test_wpt(self, build_type: BuildType, with_asan=False, **kwargs):
return self._test_wpt(build_type=build_type, with_asan=with_asan, **kwargs)
@Command('test-wpt-android',
description='Run the web platform test suite in an Android emulator',
@ -321,12 +321,12 @@ class MachCommands(CommandBase):
)
return self._test_wpt(build_type=build_type, android=True, **kwargs)
def _test_wpt(self, build_type: BuildType, android=False, **kwargs):
def _test_wpt(self, build_type: BuildType, with_asan=False, android=False, **kwargs):
if not android:
os.environ.update(self.build_env())
# TODO(mrobinson): Why do we pass the wrong binary path in when running WPT on Android?
binary_path = self.get_binary_path(build_type=build_type)
binary_path = self.get_binary_path(build_type=build_type, asan=with_asan)
return_value = wpt.run.run_tests(binary_path, **kwargs)
return return_value if not kwargs["always_succeed"] else 0
@ -768,11 +768,11 @@ tests/wpt/mozilla/tests for Servo-only tests""" % reference_path)
@CommandArgument('params', nargs='...',
help="Command-line arguments to be passed through to Servo")
@CommandBase.common_command_arguments(build_configuration=False, build_type=True)
def smoketest(self, build_type: BuildType, params):
def smoketest(self, build_type: BuildType, params, with_asan=False):
# We pass `-f` here so that any thread panic will cause Servo to exit,
# preventing a panic from hanging execution. This means that these kind
# of panics won't cause timeouts on CI.
return self.context.commands.dispatch('run', self.context, build_type=build_type,
return self.context.commands.dispatch('run', self.context, build_type=build_type, with_asan=with_asan,
params=params + ['-f', 'tests/html/close-on-load.html'])
@Command('try', description='Runs try jobs by force pushing to try branch', category='testing')