aboutsummaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorNicolas Schneider <nioncode+git@gmail.com>2016-03-01 14:07:38 +0100
committerNicolas Schneider <nioncode+git@gmail.com>2016-03-01 14:07:38 +0100
commit92187501ed51448b4ee596d059b1cd88e856fe56 (patch)
treecc956e0a592238cf47ce761ba2cb1f670ba57528 /test cases
parent52b66edb6cfb891e3a6b8c18d50d98e98dd100ec (diff)
downloadmeson-92187501ed51448b4ee596d059b1cd88e856fe56.zip
meson-92187501ed51448b4ee596d059b1cd88e856fe56.tar.gz
meson-92187501ed51448b4ee596d059b1cd88e856fe56.tar.bz2
Can add postconfigure script.
Diffstat (limited to 'test cases')
-rw-r--r--test cases/common/107 postconf/meson.build5
-rw-r--r--test cases/common/107 postconf/postconf.py11
-rw-r--r--test cases/common/107 postconf/prog.c5
-rw-r--r--test cases/common/107 postconf/raw.dat1
4 files changed, 22 insertions, 0 deletions
diff --git a/test cases/common/107 postconf/meson.build b/test cases/common/107 postconf/meson.build
new file mode 100644
index 0000000..12b3c5b
--- /dev/null
+++ b/test cases/common/107 postconf/meson.build
@@ -0,0 +1,5 @@
+project('postconf script', 'c')
+
+meson.add_postconf_script('postconf.py')
+
+test('post', executable('prog', 'prog.c'))
diff --git a/test cases/common/107 postconf/postconf.py b/test cases/common/107 postconf/postconf.py
new file mode 100644
index 0000000..d185f94
--- /dev/null
+++ b/test cases/common/107 postconf/postconf.py
@@ -0,0 +1,11 @@
+#!/usr/bin/env python3
+
+import sys, os
+
+template = '''#pragma once
+
+#define THE_NUMBER {}
+'''
+
+data = open(os.path.join(sys.argv[1], 'raw.dat')).readline().strip()
+open(os.path.join(sys.argv[2], 'generated.h'), 'w').write(template.format(data))
diff --git a/test cases/common/107 postconf/prog.c b/test cases/common/107 postconf/prog.c
new file mode 100644
index 0000000..1e5d4cb
--- /dev/null
+++ b/test cases/common/107 postconf/prog.c
@@ -0,0 +1,5 @@
+#include"generated.h"
+
+int main(int argc, char **argv) {
+ return THE_NUMBER != 9;
+}
diff --git a/test cases/common/107 postconf/raw.dat b/test cases/common/107 postconf/raw.dat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/test cases/common/107 postconf/raw.dat
@@ -0,0 +1 @@
+9