summaryrefslogtreecommitdiffstats
path: root/test cases/common/31 define10
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-29 04:41:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-29 04:41:38 +0000
commit7b6e527f440cd7e6f8be2b07cee320ee6ca18786 (patch)
tree4a2738d69fa2814659fdadddf5826282e73d81f4 /test cases/common/31 define10
parentInitial commit. (diff)
downloadmeson-upstream.tar.xz
meson-upstream.zip
Adding upstream version 1.0.1.upstream/1.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test cases/common/31 define10')
-rw-r--r--test cases/common/31 define10/config.h.in2
-rw-r--r--test cases/common/31 define10/meson.build12
-rw-r--r--test cases/common/31 define10/prog.c13
3 files changed, 27 insertions, 0 deletions
diff --git a/test cases/common/31 define10/config.h.in b/test cases/common/31 define10/config.h.in
new file mode 100644
index 0000000..dc77346
--- /dev/null
+++ b/test cases/common/31 define10/config.h.in
@@ -0,0 +1,2 @@
+#mesondefine ONE
+#mesondefine ZERO
diff --git a/test cases/common/31 define10/meson.build b/test cases/common/31 define10/meson.build
new file mode 100644
index 0000000..a28e7e4
--- /dev/null
+++ b/test cases/common/31 define10/meson.build
@@ -0,0 +1,12 @@
+project('set10test', 'c')
+
+conf = configuration_data()
+conf.set10('ONE', true)
+conf.set10('ZERO', false)
+
+configure_file(input : 'config.h.in',
+ output : 'config.h',
+ configuration : conf)
+
+exe = executable('prog', 'prog.c')
+test('10test', exe)
diff --git a/test cases/common/31 define10/prog.c b/test cases/common/31 define10/prog.c
new file mode 100644
index 0000000..519b40d
--- /dev/null
+++ b/test cases/common/31 define10/prog.c
@@ -0,0 +1,13 @@
+#include<stdio.h>
+#include"config.h"
+
+int main(void) {
+ if(ONE != 1) {
+ fprintf(stderr, "ONE is not 1.\n");
+ return 1;
+ }
+ if(ZERO != 0) {
+ fprintf(stderr, "ZERO is not 0.\n");
+ }
+ return 0;
+}