Add test case for test(depends) keyword parameter

pull/3314/head
Aleksey Filippov 7 years ago
parent 3e48d47674
commit 708e4b1258
  1. 13
      test cases/common/188 test depends/gen.py
  2. 1
      test cases/common/188 test depends/main.c
  3. 26
      test cases/common/188 test depends/meson.build
  4. 20
      test cases/common/188 test depends/test.py

@ -0,0 +1,13 @@
#!/usr/bin/env python3
import sys
def main():
with open(sys.argv[1], 'w') as out:
out.write(sys.argv[2])
out.write('\n')
if __name__ == '__main__':
main()

@ -0,0 +1 @@
int main(void) { return 0; }

@ -0,0 +1,26 @@
project('test depends', 'c')
gen = find_program('gen.py')
custom_dep = custom_target('custom_dep',
build_by_default : false,
output : 'custom_dep.txt',
command : [gen, '@OUTPUT@', 'custom_dep'],
)
exe_dep = executable('exe_dep', 'main.c',
build_by_default : false,
)
test_prog = find_program('test.py')
test('string dependencies', test_prog,
args : [
# This is declared for convenience,
# real use case might have some obscure method
# to find these dependencies, e.g. automatic plugin loading.
'custom_dep.txt',
exe_dep.full_path(),
],
depends : [custom_dep, exe_dep],
workdir : meson.current_build_dir(),
)

@ -0,0 +1,20 @@
#!/usr/bin/env python3
import os
import os.path
import sys
def main():
print('Looking in:', os.getcwd())
not_found = list()
for f in sys.argv[1:]:
if not os.path.exists(f):
not_found.append(f)
if not_found:
print('Not found:', ', '.join(not_found))
sys.exit(1)
if __name__ == '__main__':
main()
Loading…
Cancel
Save