diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2016-06-16 21:03:57 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2016-06-16 21:03:57 +0300 |
commit | 68dbbeb78ff644f26d8cdd890218763ebf8afac4 (patch) | |
tree | bea09b55acaeec8201e3e5a6c1ba52deb5648432 /test cases | |
parent | 981211e1f2d90c5a603d7091d81df62fdcaae17b (diff) | |
parent | 475175f4b5e5aecdd48455efb6a10f4bd7ce7b81 (diff) | |
download | meson-68dbbeb78ff644f26d8cdd890218763ebf8afac4.zip meson-68dbbeb78ff644f26d8cdd890218763ebf8afac4.tar.gz meson-68dbbeb78ff644f26d8cdd890218763ebf8afac4.tar.bz2 |
Octopus merged cross fixes and genetor custom because why not.
Diffstat (limited to 'test cases')
-rwxr-xr-x | test cases/common/113 generatorcustom/catter.py | 13 | ||||
-rwxr-xr-x | test cases/common/113 generatorcustom/gen.py | 11 | ||||
-rw-r--r-- | test cases/common/113 generatorcustom/main.c | 7 | ||||
-rw-r--r-- | test cases/common/113 generatorcustom/meson.build | 17 | ||||
-rw-r--r-- | test cases/common/113 generatorcustom/res1.txt | 1 | ||||
-rw-r--r-- | test cases/common/113 generatorcustom/res2.txt | 1 |
6 files changed, 50 insertions, 0 deletions
diff --git a/test cases/common/113 generatorcustom/catter.py b/test cases/common/113 generatorcustom/catter.py new file mode 100755 index 0000000..354d6e0 --- /dev/null +++ b/test cases/common/113 generatorcustom/catter.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 + +import sys, os + +output = sys.argv[-1] +inputs = sys.argv[1:-1] + +with open(output, 'w') as ofile: + ofile.write('#pragma once\n') + for i in inputs: + content = open(i, 'r').read() + ofile.write(content) + ofile.write('\n') diff --git a/test cases/common/113 generatorcustom/gen.py b/test cases/common/113 generatorcustom/gen.py new file mode 100755 index 0000000..ba02e3f --- /dev/null +++ b/test cases/common/113 generatorcustom/gen.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python3 + +import sys, os + +ifile = sys.argv[1] +ofile = sys.argv[2] + +resname = open(ifile, 'r').readline().strip() + +templ = 'const char %s[] = "%s";\n' +open(ofile, 'w').write(templ % (resname, resname)) diff --git a/test cases/common/113 generatorcustom/main.c b/test cases/common/113 generatorcustom/main.c new file mode 100644 index 0000000..04abcf6 --- /dev/null +++ b/test cases/common/113 generatorcustom/main.c @@ -0,0 +1,7 @@ +#include<stdio.h> + +#include"alltogether.h" + +int main(int argc, char **argv) { + return 0; +} diff --git a/test cases/common/113 generatorcustom/meson.build b/test cases/common/113 generatorcustom/meson.build new file mode 100644 index 0000000..1f4cc88 --- /dev/null +++ b/test cases/common/113 generatorcustom/meson.build @@ -0,0 +1,17 @@ +project('generatorcustom', 'c') + +creator = find_program('gen.py') +catter = find_program('catter.py') + +gen = generator(creator, + output: '@BASENAME@.h', + arguments : ['@INPUT@', '@OUTPUT@']) + +hs = gen.process('res1.txt', 'res2.txt') + +allinone = custom_target('alltogether', + input : hs, + output : 'alltogether.h', + command : [catter, '@INPUT@', '@OUTPUT@']) + +executable('proggie', 'main.c', allinone) diff --git a/test cases/common/113 generatorcustom/res1.txt b/test cases/common/113 generatorcustom/res1.txt new file mode 100644 index 0000000..6487c56 --- /dev/null +++ b/test cases/common/113 generatorcustom/res1.txt @@ -0,0 +1 @@ +res1 diff --git a/test cases/common/113 generatorcustom/res2.txt b/test cases/common/113 generatorcustom/res2.txt new file mode 100644 index 0000000..0a8879d --- /dev/null +++ b/test cases/common/113 generatorcustom/res2.txt @@ -0,0 +1 @@ +res2 |