Add tests for b_ndebug=if-release and buildtype default options

Co-authored-by: David Seifert <soap@gentoo.org>
pull/3274/head
Aleksey Filippov 7 years ago
parent dd614015e0
commit 39a3bdb43f
  1. 15
      test cases/common/185 ndebug if-release enabled/main.c
  2. 7
      test cases/common/185 ndebug if-release enabled/meson.build
  3. 7
      test cases/common/186 ndebug if-release disabled/main.c
  4. 7
      test cases/common/186 ndebug if-release disabled/meson.build

@ -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…
Cancel
Save