| 1 |
project('extra args in gen', 'c') |
| 2 |
|
| 3 |
prog = find_program('srcgen.py') |
| 4 |
|
| 5 |
gen = generator(prog, |
| 6 |
output : '@[email protected]', |
| 7 |
arguments : ['--input=@INPUT@', '--output=@OUTPUT@', '@EXTRA_ARGS@']) |
| 8 |
|
| 9 |
g1 = gen.process('name.dat') |
| 10 |
g2 = gen.process('name.dat', extra_args: '--upper') |
| 11 |
|
| 12 |
test('basic', executable('basic', 'plain.c', g1)) |
| 13 |
test('upper', executable('upper', 'upper.c', g2)) |
| 14 |
|
| 15 |
prog2 = find_program('srcgen2.py') |
| 16 |
basename_gen = generator(prog2, |
| 17 |
output : ['@[email protected]', '@[email protected]'], |
| 18 |
arguments : ['@BUILD_DIR@', '@BASENAME@', '@INPUT@']) |
| 19 |
|
| 20 |
basename_src = basename_gen.process('name.l') |
| 21 |
|
| 22 |
test('basename', executable('basename', basename_src)) |
| 23 |
|
| 24 |
plainname_gen = generator(prog2, |
| 25 |
output : ['@[email protected]', '@[email protected]'], |
| 26 |
arguments : ['@BUILD_DIR@', '@PLAINNAME@', '@INPUT@']) |
| 27 |
|
| 28 |
plainname_src = plainname_gen.process('name.l') |
| 29 |
|
| 30 |
test('plainname', executable('plainname', plainname_src)) |
| 31 |
|
| 32 |
prog3 = find_program('srcgen3.py') |
| 33 |
capture_gen = generator(prog3, |
| 34 |
output : ['@[email protected]'], |
| 35 |
arguments : ['@INPUT@'], |
| 36 |
capture : true) |
| 37 |
|
| 38 |
capture_src = capture_gen.process('name.l') |
| 39 |
|
| 40 |
test('capture', executable('capture', capture_src)) |