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

Conversation

fsb4000
Copy link
Contributor

@fsb4000 fsb4000 commented Jun 9, 2024

Fixes #4639

изображение
изображение
изображение
изображение
изображение
изображение
изображение

@fsb4000 fsb4000 requested a review from a team as a code owner June 9, 2024 06:20
@StephanTLavavej StephanTLavavej added the test Related to test code label Jun 9, 2024
@StephanTLavavej StephanTLavavej self-assigned this Jun 9, 2024
tests/utils/stl-lit/stl-lit.in Outdated Show resolved Hide resolved
tests/utils/stl-lit/stl-lit.in Outdated Show resolved Hide resolved
tests/utils/stl-lit/stl-lit.in Outdated Show resolved Hide resolved
tests/utils/stl-lit/stl-lit.in Outdated Show resolved Hide resolved
@StephanTLavavej
Copy link
Member

Thanks, this is super awesome and will prevent a common problem for contributors! 😻

I pushed a major simplification of the logic and improved the output:

D:\GitHub\STL\out\x64>cl
Microsoft (R) C/C++ Optimizing Compiler Version 19.41.33923 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

usage: cl [ option... ] filename... [ /link linkoption... ]

D:\GitHub\STL\out\x64>python tests\utils\stl-lit\stl-lit.py -o testing.log -Dnotags=ASAN --order=random --succinct %STL%\tests\std\tests\P0295R0_gcd_lcm
Target platform mismatch: the STL was built for x64 but tested for x86.

This works because CMake's configure_file transformations bake build_platform = '$ENV{Platform}' into out\x64\tests\utils\stl-lit\stl-lit.py containing:

def assert_same_platform_for_build_and_test():
    build_platform = 'x64'
    test_platform = os.getenv('Platform', default='')

I also verified the reverse failure case, and successful cases.

@StephanTLavavej StephanTLavavej removed their assignment Jun 13, 2024
@StephanTLavavej StephanTLavavej self-assigned this Jun 14, 2024
@StephanTLavavej
Copy link
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit 9ef0d00 into microsoft:main Jun 18, 2024
39 checks passed
@StephanTLavavej
Copy link
Member

Thanks for preventing this common early headache for contributors! 🩹 🏥 🎉

@fsb4000 fsb4000 deleted the fix4639_2 branch June 18, 2024 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Related to test code
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Warn/block building in wrong command prompt
2 participants