mesonbuild / meson

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

tests: add werror tests for several languages #13155

Open bgilbert opened 2 weeks ago

bgilbert commented 2 weeks ago

Followup to #13074.

jpakkane commented 2 weeks ago

I'm not a fan of mxing failing tests with all the others because it adds knobs for people to twiddle, which leads to complexity, which leads to ... well you know.

The fact that all tests that are expected to fail are in one place is good, because then you can not, accidentally or otherwise, make a test in the main dir that should have passed as failing.

A simpler way of achieving the same would be to do something like:

project('foo', 'c', <enable werror>)

if add_languages('swift_or_whatever')
    <do your thing here>
else
    executable('willfailtocompile', 'source-with-a-warning.c')
endif

It's a bit unclean but keeps the overall structure cleaner.

bgilbert commented 2 weeks ago

Okay, updated, with MESON_SKIP_TEST instead of a fallback source file. The add_languages() check isn't enough to replicate the existing language-specific directory skip logic; I reimplemented just enough of it to pass CI.

bgilbert commented 4 days ago

Could this get another look?