Replies: 1 comment 3 replies
-
Compiles would return that boolean at configure time, not at test time, so the test function seems like it would be useless. Why not just emit an error at configure time? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
Currently I am working on a project where we need to test negative features of a library, meaning that certain usecases MUST NOT compile - even though they are valid code. This way we move checking of proper usage of the lib as far into compile time as possible.
To do this with meson's test functionality, I currently use
sh
as the testing program with a cmd line, that invocesmeson compile
and asserts the return value to be1
.Looking at the documentation of the
compiler
object, the usecase could be implemented withcompiles()
much more readable, iftest()
could consume a boolean value as input. This could also open the door to checking other conditions implementable in meson or values returned by arunresult
for code assurance testing without rigging a meson subprocess or something else into a less readable shell command.Cheers,
Jörn
Beta Was this translation helpful? Give feedback.
All reactions