Co-authored-by: David Seifert <soap@gentoo.org>pull/3274/head
parent
dd614015e0
commit
39a3bdb43f
4 changed files with 36 additions and 0 deletions
@ -0,0 +1,15 @@ |
||||
#include <assert.h> |
||||
#include <stdlib.h> |
||||
|
||||
int meson_test_side_effect = EXIT_FAILURE; |
||||
|
||||
int meson_test_set_side_effect(void) { |
||||
meson_test_side_effect = EXIT_SUCCESS; |
||||
return 1; |
||||
} |
||||
|
||||
int main(void) { |
||||
// meson_test_side_effect is set only if assert is executed
|
||||
assert(meson_test_set_side_effect()); |
||||
return meson_test_side_effect; |
||||
} |
@ -0,0 +1,7 @@ |
||||
project('ndebug enabled', 'c', |
||||
default_options : [ |
||||
'buildtype=debugoptimized', |
||||
'b_ndebug=if-release', |
||||
]) |
||||
|
||||
test('exe', executable('main', 'main.c')) |
@ -0,0 +1,7 @@ |
||||
#include <assert.h> |
||||
#include <stdlib.h> |
||||
|
||||
int main(void) { |
||||
assert(0); |
||||
return EXIT_SUCCESS; |
||||
} |
@ -0,0 +1,7 @@ |
||||
project('ndebug disabled', 'c', |
||||
default_options : [ |
||||
'buildtype=release', |
||||
'b_ndebug=if-release', |
||||
]) |
||||
|
||||
test('exe', executable('main', 'main.c')) |
Loading…
Reference in new issue