diff options
| author | Charles Brunet <charles.brunet@optelgroup.com> | 2024-02-23 11:40:15 -0500 |
|---|---|---|
| committer | Dylan Baker <dylan@pnwbakers.com> | 2024-02-24 09:08:20 -0800 |
| commit | 11f2e07071d062f31a69de531faa0a5d68b1f5bc (patch) | |
| tree | 0361645f1bed81d4a76ff3cbbda9399168221706 /test cases | |
| parent | 8ba0ea68017b489b0a461abbd375f319dc7a48f3 (diff) | |
| download | meson-11f2e07071d062f31a69de531faa0a5d68b1f5bc.tar.gz | |
Allow using CustomTarget as test executable
Fixes #6567
Diffstat (limited to 'test cases')
| -rw-r--r-- | test cases/common/273 customtarget exe for test/generate.py | 14 | ||||
| -rw-r--r-- | test cases/common/273 customtarget exe for test/meson.build | 14 |
2 files changed, 28 insertions, 0 deletions
diff --git a/test cases/common/273 customtarget exe for test/generate.py b/test cases/common/273 customtarget exe for test/generate.py new file mode 100644 index 000000000..e66f1db70 --- /dev/null +++ b/test cases/common/273 customtarget exe for test/generate.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python3 + +import os +import sys + +program = '''#!/usr/bin/env python3 + +raise SystemExit({}) +''' + +for i, a in enumerate(sys.argv[1:]): + with open(a, 'w') as f: + print(program.format(i), file=f) + os.chmod(a, 0o755) diff --git a/test cases/common/273 customtarget exe for test/meson.build b/test cases/common/273 customtarget exe for test/meson.build new file mode 100644 index 000000000..089d70dee --- /dev/null +++ b/test cases/common/273 customtarget exe for test/meson.build @@ -0,0 +1,14 @@ +project('test customtarget') + +ct1 = custom_target( + command: ['generate.py', '@OUTPUT@'], + output: 'a.py', +) +ct2 = custom_target( + command: ['generate.py', '@OUTPUT@'], + output: ['b.py', 'c.py'], +) + +test('using_custom_target', ct1) +test('using_custom_target_index', ct2[0]) +test('using_custom_target_index_1', ct2[1], should_fail: true) |
