Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block building Tests in wrong command prompt #4717

Merged
merged 4 commits into from
Jun 18, 2024
Merged
Changes from 3 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
21 changes: 21 additions & 0 deletions tests/utils/stl-lit/stl-lit.in
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,27 @@ sys.path.insert(0, os.path.join("@LLVM_SOURCE_DIR@", 'utils', 'lit'))
builtin_parameters= {}
builtin_parameters['config_map'] = config_map

def assert_target_arch_and_platform_equal():
import os
StephanTLavavej marked this conversation as resolved.
Show resolved Hide resolved
first_lit_cfg = next(iter(builtin_parameters['config_map'].values()))
target_arch = ''
platform = os.getenv('Platform', default='')
# Do nothing if "Platform" is not defined.
StephanTLavavej marked this conversation as resolved.
Show resolved Hide resolved
if platform != '':
with open(first_lit_cfg, 'r') as file:
for line in file:
if 'lit_config.target_arch =' in line:
words = line.split()
target_arch = words[-1].strip('\'')
break
# arm64ec doesn't have its own command prompt with Platform.
if target_arch == 'arm64ec':
target_arch = 'arm64'
StephanTLavavej marked this conversation as resolved.
Show resolved Hide resolved
if platform != target_arch:
print('The architecture of the compiler and STL does not match')
exit(1)
StephanTLavavej marked this conversation as resolved.
Show resolved Hide resolved

if __name__=='__main__':
assert_target_arch_and_platform_equal()
from lit.main import main
main(builtin_parameters)