summaryrefslogtreecommitdiff
path: root/test cases/common
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz93@gmail.com>2025-10-15 21:49:10 -0400
committerEli Schwartz <eschwartz93@gmail.com>2025-10-15 23:01:36 -0400
commit5c0aad57f92d2a6bebc1cb17655dd8a56f4bcd3f (patch)
tree69a228a10f425b33392df576f79bd8b7c5402104 /test cases/common
parent1177e77c2893891cb35144b8033786cb8f75c7cd (diff)
downloadmeson-5c0aad57f92d2a6bebc1cb17655dd8a56f4bcd3f.tar.gz
revert local_program()
This reverts https://github.com/mesonbuild/meson/pull/15107 Explicit objections regarding the design were raised and not answered, so it shouldn't have been merged. It needs to be discussed and revisited.
Diffstat (limited to 'test cases/common')
-rw-r--r--test cases/common/285 local program/meson.build56
-rwxr-xr-xtest cases/common/285 local program/prog.py5
-rw-r--r--test cases/common/285 local program/pymod.py.in2
3 files changed, 0 insertions, 63 deletions
diff --git a/test cases/common/285 local program/meson.build b/test cases/common/285 local program/meson.build
deleted file mode 100644
index fba59e8e5..000000000
--- a/test cases/common/285 local program/meson.build
+++ /dev/null
@@ -1,56 +0,0 @@
-project('local program', version: '2.0')
-
-python3 = find_program('python3')
-
-# A module imported by prog but only available at build time.
-pymod = custom_target(
- input: 'pymod.py.in',
- output: 'pymod.py',
- command: [python3, '-c', 'import shutil,sys;shutil.copy(sys.argv[1], sys.argv[2])', '@INPUT@', '@OUTPUT@'],
- build_by_default: false,
-)
-
-# Copy into builddir to have the same location as pymod.py
-prog = configure_file(
- input: 'prog.py',
- output: 'prog.py',
- copy: true,
-)
-
-# Without the dependency it can't be run, but it should have the project version.
-prog1 = local_program(prog)
-assert(prog1.version() == '2.0')
-assert(prog1.found())
-
-prog2 = local_program(prog, depends: pymod)
-assert(prog2.version() == '2.0')
-assert(prog2.found())
-
-meson.override_find_program('prog', prog2)
-prog3 = find_program('prog')
-assert(prog3.version() == '2.0')
-assert(prog3.found())
-
-# This should have the pymod dependency
-custom_target(
- output: 'out.txt',
- command: [prog3],
- capture: true,
- build_by_default: true,
-)
-
-test('test-prog3', prog3)
-
-# Custom target as local program. Meson cannot parse the shebang at configure time,
-# so we need to specify it otherwise it won't run on Windows.
-prog_ct = custom_target(
- input: 'prog.py',
- output: 'prog-ct.py',
- command: [python3, '-c', 'import shutil,sys;shutil.copy(sys.argv[1], sys.argv[2])', '@INPUT@', '@OUTPUT@'],
- depends: pymod,
-)
-meson.override_find_program('prog4', local_program(prog_ct, interpreter: python3))
-prog4 = find_program('prog4')
-assert(prog4.version() == '2.0')
-assert(prog4.found())
-test('test-prog4', prog4)
diff --git a/test cases/common/285 local program/prog.py b/test cases/common/285 local program/prog.py
deleted file mode 100755
index bd1042a2f..000000000
--- a/test cases/common/285 local program/prog.py
+++ /dev/null
@@ -1,5 +0,0 @@
-#! /usr/bin/env python3
-
-import pymod
-
-raise SystemExit(pymod.foo())
diff --git a/test cases/common/285 local program/pymod.py.in b/test cases/common/285 local program/pymod.py.in
deleted file mode 100644
index 3cc1da0c3..000000000
--- a/test cases/common/285 local program/pymod.py.in
+++ /dev/null
@@ -1,2 +0,0 @@
-def foo() -> None:
- return 0