aboutsummaryrefslogtreecommitdiff
path: root/test cases/common
diff options
context:
space:
mode:
authorJan200101 <sentrycraft123@gmail.com>2024-12-10 18:50:25 +0100
committerDylan Baker <dylan@pnwbakers.com>2024-12-19 09:45:19 -0800
commit38c8568ec34e90a9744ca88c1450d3365039b634 (patch)
tree3e04cff570f6e13fd6c1a3459315d43992432ba2 /test cases/common
parentbb1745c614def21f4e44bf0be90a9520e8181794 (diff)
downloadmeson-38c8568ec34e90a9744ca88c1450d3365039b634.zip
meson-38c8568ec34e90a9744ca88c1450d3365039b634.tar.gz
meson-38c8568ec34e90a9744ca88c1450d3365039b634.tar.bz2
add test case for @ and curly brace substitution with cmake format
Diffstat (limited to 'test cases/common')
-rw-r--r--test cases/common/14 configure file/config10.h.in4
-rw-r--r--test cases/common/14 configure file/meson.build10
-rw-r--r--test cases/common/14 configure file/prog10.c7
3 files changed, 21 insertions, 0 deletions
diff --git a/test cases/common/14 configure file/config10.h.in b/test cases/common/14 configure file/config10.h.in
new file mode 100644
index 0000000..6c0661a
--- /dev/null
+++ b/test cases/common/14 configure file/config10.h.in
@@ -0,0 +1,4 @@
+/* Should both be the same */
+#define MESSAGE1 "@var@"
+#define MESSAGE2 "${var}"
+
diff --git a/test cases/common/14 configure file/meson.build b/test cases/common/14 configure file/meson.build
index 036a562..3a4ff4d 100644
--- a/test cases/common/14 configure file/meson.build
+++ b/test cases/common/14 configure file/meson.build
@@ -331,6 +331,16 @@ configure_file(output : 'config9b.h',
test('test9', executable('prog9', 'prog9.c'))
+# Test @ and curly braces at the same time with cmake format
+conf10 = configuration_data()
+conf10.set('var', 'foo')
+configure_file(
+ input : 'config10.h.in',
+ output : '@BASENAME@',
+ format : 'cmake',
+ configuration : conf10)
+test('test10', executable('prog10', 'prog10.c'))
+
check_inputs = find_program('check_inputs.py')
configure_file(output : 'check_inputs.txt',
input : ['prog.c', files('prog2.c', 'prog4.c')],
diff --git a/test cases/common/14 configure file/prog10.c b/test cases/common/14 configure file/prog10.c
new file mode 100644
index 0000000..cdca6da
--- /dev/null
+++ b/test cases/common/14 configure file/prog10.c
@@ -0,0 +1,7 @@
+#include <string.h>
+#include <config10.h>
+
+int main(void) {
+ return strcmp(MESSAGE1, "foo")
+ || strcmp(MESSAGE2, "foo");
+}