Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 27 additions & 12 deletions testing/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,16 @@ def is_mac():
return sys.platform == 'darwin'


def is_aarm64():
assert is_mac()
output = subprocess.check_output(['sysctl', 'machdep.cpu'])
text = output.decode('utf-8')
aarm64 = text.find('Apple') >= 0
if not aarm64:
assert text.find('GenuineIntel') >= 0
return aarm64


def is_linux():
return sys.platform.startswith('linux')

Expand Down Expand Up @@ -467,25 +477,30 @@ def make_test(name, flags=None, extra_env=None):
shuffle_flags,
coverage=coverage
)
extra_env = {
# pylint: disable=line-too-long
# See https://developer.apple.com/documentation/metal/diagnosing_metal_programming_issues_early?language=objc
'MTL_SHADER_VALIDATION': '1', # Enables all shader validation tests.
'MTL_SHADER_VALIDATION_GLOBAL_MEMORY':
'1', # Validates accesses to device and constant memory.
'MTL_SHADER_VALIDATION_THREADGROUP_MEMORY':
'1', # Validates accesses to threadgroup memory.
'MTL_SHADER_VALIDATION_TEXTURE_USAGE':
'1', # Validates that texture references are not nil.
}
if is_aarm64():
extra_env.append({
'METAL_DEBUG_ERROR_MODE': '0', # Enables metal validation.
'METAL_DEVICE_WRAPPER_TYPE': '1', # Enables metal validation.
})
# Impeller tests are only supported on macOS for now.
run_engine_executable(
build_dir,
'impeller_unittests',
executable_filter,
shuffle_flags,
coverage=coverage,
extra_env={
# pylint: disable=line-too-long
# See https://developer.apple.com/documentation/metal/diagnosing_metal_programming_issues_early?language=objc
'MTL_SHADER_VALIDATION':
'1', # Enables all shader validation tests.
'MTL_SHADER_VALIDATION_GLOBAL_MEMORY':
'1', # Validates accesses to device and constant memory.
'MTL_SHADER_VALIDATION_THREADGROUP_MEMORY':
'1', # Validates accesses to threadgroup memory.
'MTL_SHADER_VALIDATION_TEXTURE_USAGE':
'1', # Validates that texture references are not nil.
},
extra_env=extra_env,
# TODO(117122): Remove this allowlist.
# https://github.com/flutter/flutter/issues/114872
allowed_failure_output=[
Expand Down