mesonbuild / meson

The Meson Build System
http://mesonbuild.com
Apache License 2.0
5.53k stars 1.61k forks source link

Incorrect testing of MSVC version in test cases/windows/19 #13644

Open vid512 opened 3 weeks ago

vid512 commented 3 weeks ago

test cases/windows/19 msvc cplusplus define/meson.build is testing project_version() instead of intended compiler version.

Code in question: https://github.com/mesonbuild/meson/blob/53e11488d9ce01b14c2b280d66c3efeda1c60abc/test%20cases/windows/19%20msvc%20cplusplus%20define/meson.build#L7-L8

Resulting behavior:

Running platform-windows tests.

 [SKIPPED]  (without install) windows: 19 msvc cplusplus define
Reason: test is only relevant for msvc versions >= 15.7

...

d:\dev\meson-diasdk\meson-fork>cl
Microsoft (R) C/C++ Optimizing Compiler Version 19.41.34120 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.
bruchar1 commented 2 weeks ago

@vid512 Could you open a PR to fix it?

vid512 commented 2 weeks ago

Tried it and failed. I've replaced offending line with elif meson.get_compiler('cpp').version().version_compare('< 15.7'), then ran run_project_tests.py --only platform-windows. The test case did run, but failed. I can't find any error info at all in the long log displayed. The temporary build directory (b hexnumber) is deleted. run_project_tests.py --help doesn't seem to give me any option to preserve build directory on failure...