Created failing test for using generated outputs in a custom target.

pull/592/head
Jussi Pakkanen 9 years ago
parent 5384a203f3
commit f0626e6cc1
  1. 13
      test cases/common/113 generatorcustom/catter.py
  2. 11
      test cases/common/113 generatorcustom/gen.py
  3. 7
      test cases/common/113 generatorcustom/main.c
  4. 17
      test cases/common/113 generatorcustom/meson.build
  5. 1
      test cases/common/113 generatorcustom/res1.txt
  6. 1
      test cases/common/113 generatorcustom/res2.txt

@ -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')

@ -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))

@ -0,0 +1,7 @@
#include<stdio.h>
#include"alltogether.h"
int main(int argc, char **argv) {
return 0;
}

@ -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)
Loading…
Cancel
Save