aboutsummaryrefslogtreecommitdiffstats
path: root/meson/test cases/common/31 define10
diff options
context:
space:
mode:
authorAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
committerAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
commitaf1a266670d040d2f4083ff309d732d648afba2a (patch)
tree2fc46203448ddcc6f81546d379abfaeb323575e9 /meson/test cases/common/31 define10
parente02cda008591317b1625707ff8e115a4841aa889 (diff)
Add submodule dependency filesHEADmaster
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'meson/test cases/common/31 define10')
-rw-r--r--meson/test cases/common/31 define10/config.h.in2
-rw-r--r--meson/test cases/common/31 define10/meson.build12
-rw-r--r--meson/test cases/common/31 define10/prog.c13
3 files changed, 27 insertions, 0 deletions
diff --git a/meson/test cases/common/31 define10/config.h.in b/meson/test cases/common/31 define10/config.h.in
new file mode 100644
index 000000000..dc7734637
--- /dev/null
+++ b/meson/test cases/common/31 define10/config.h.in
@@ -0,0 +1,2 @@
+#mesondefine ONE
+#mesondefine ZERO
diff --git a/meson/test cases/common/31 define10/meson.build b/meson/test cases/common/31 define10/meson.build
new file mode 100644
index 000000000..a28e7e48d
--- /dev/null
+++ b/meson/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/meson/test cases/common/31 define10/prog.c b/meson/test cases/common/31 define10/prog.c
new file mode 100644
index 000000000..519b40dcb
--- /dev/null
+++ b/meson/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;
+}