diff options
author | Nicolas Schneider <nioncode+git@gmail.com> | 2016-03-01 14:31:37 +0100 |
---|---|---|
committer | Nicolas Schneider <nioncode+git@gmail.com> | 2016-03-01 14:31:37 +0100 |
commit | 9f9f73fa5208bdabed5fae59af0b0b0e7d177dec (patch) | |
tree | 33bf4a11c051c346516cc32da75e78bc87566870 /test cases | |
parent | 92187501ed51448b4ee596d059b1cd88e856fe56 (diff) | |
download | meson-9f9f73fa5208bdabed5fae59af0b0b0e7d177dec.zip meson-9f9f73fa5208bdabed5fae59af0b0b0e7d177dec.tar.gz meson-9f9f73fa5208bdabed5fae59af0b0b0e7d177dec.tar.bz2 |
add args support for add_postconf_script
Diffstat (limited to 'test cases')
4 files changed, 24 insertions, 0 deletions
diff --git a/test cases/common/108 postconf with args/meson.build b/test cases/common/108 postconf with args/meson.build new file mode 100644 index 0000000..74006f4 --- /dev/null +++ b/test cases/common/108 postconf with args/meson.build @@ -0,0 +1,5 @@ +project('postconf script', 'c') + +meson.add_postconf_script('postconf.py', args: ['5', '33']) + +test('post', executable('prog', 'prog.c')) diff --git a/test cases/common/108 postconf with args/postconf.py b/test cases/common/108 postconf with args/postconf.py new file mode 100644 index 0000000..b229d62 --- /dev/null +++ b/test cases/common/108 postconf with args/postconf.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 + +import sys, os + +template = '''#pragma once + +#define THE_NUMBER {} +#define THE_ARG1 {} +#define THE_ARG2 {} +''' + +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, sys.argv[3], sys.argv[4])) diff --git a/test cases/common/108 postconf with args/prog.c b/test cases/common/108 postconf with args/prog.c new file mode 100644 index 0000000..0e63a8c --- /dev/null +++ b/test cases/common/108 postconf with args/prog.c @@ -0,0 +1,5 @@ +#include"generated.h" + +int main(int argc, char **argv) { + return THE_NUMBER != 9 || THE_ARG1 != 5 || THE_ARG2 != 33; +} diff --git a/test cases/common/108 postconf with args/raw.dat b/test cases/common/108 postconf with args/raw.dat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/test cases/common/108 postconf with args/raw.dat @@ -0,0 +1 @@ +9 |