diff options
| author | Jussi Pakkanen <jpakkane@gmail.com> | 2021-04-26 16:52:13 +0300 |
|---|---|---|
| committer | Jussi Pakkanen <jpakkane@gmail.com> | 2021-04-26 23:39:15 +0100 |
| commit | e75e3976facda7de244fbb9a02eebf0d043ea1c8 (patch) | |
| tree | dab22f95b5c837a70b1b4164d97ff351a49ffd81 /test cases/common/186 test depends | |
| parent | 53fe7c2f0a51697cd57628753852dd3f8711becf (diff) | |
| download | meson-e75e3976facda7de244fbb9a02eebf0d043ea1c8.tar.gz | |
Condense test directory names.
Diffstat (limited to 'test cases/common/186 test depends')
| -rwxr-xr-x | test cases/common/186 test depends/gen.py | 13 | ||||
| -rw-r--r-- | test cases/common/186 test depends/main.c | 1 | ||||
| -rw-r--r-- | test cases/common/186 test depends/meson.build | 26 | ||||
| -rwxr-xr-x | test cases/common/186 test depends/test.py | 20 |
4 files changed, 60 insertions, 0 deletions
diff --git a/test cases/common/186 test depends/gen.py b/test cases/common/186 test depends/gen.py new file mode 100755 index 000000000..ee4ed9818 --- /dev/null +++ b/test cases/common/186 test depends/gen.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() diff --git a/test cases/common/186 test depends/main.c b/test cases/common/186 test depends/main.c new file mode 100644 index 000000000..78f2de106 --- /dev/null +++ b/test cases/common/186 test depends/main.c @@ -0,0 +1 @@ +int main(void) { return 0; } diff --git a/test cases/common/186 test depends/meson.build b/test cases/common/186 test depends/meson.build new file mode 100644 index 000000000..888c45118 --- /dev/null +++ b/test cases/common/186 test depends/meson.build @@ -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(), +) diff --git a/test cases/common/186 test depends/test.py b/test cases/common/186 test depends/test.py new file mode 100755 index 000000000..5b9f65c86 --- /dev/null +++ b/test cases/common/186 test depends/test.py @@ -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() |
