diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2016-06-13 00:06:05 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2016-06-13 00:06:05 +0300 |
commit | f0626e6cc15bfcba66e3218314f9aee5ba3d6052 (patch) | |
tree | 9505db0638e776994e9f9830e1b8aaa934f859f4 | |
parent | 5384a203f3d68f460e1075889ce02a6c5acdfe4f (diff) | |
download | meson-f0626e6cc15bfcba66e3218314f9aee5ba3d6052.zip meson-f0626e6cc15bfcba66e3218314f9aee5ba3d6052.tar.gz meson-f0626e6cc15bfcba66e3218314f9aee5ba3d6052.tar.bz2 |
Created failing test for using generated outputs in a custom target.
-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..1ee0f53 --- /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[2:] + +with open(output, 'w') as ofile: + ofile.write('#pragma once\n') + for i in inputs: + content = open(i, 'r').read() + i.write(content) + i.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..2fc0fdd --- /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 = '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..529f28a --- /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') + +all_headers_in_one = custom_target('alltogether', + input : hs, + output : 'alltogether.h', + command : [catter, '@INPUT@', '@OUTPUT@']) + +executable('proggie', 'main.c', hs) 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 |