aboutsummaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2023-01-13 16:42:09 -0500
committerEli Schwartz <eschwartz93@gmail.com>2023-01-18 11:06:48 -0500
commit1a0eff005483b63259e365bd4d51be7c4bd3b729 (patch)
tree7b64867bb7ac42f9a0b441e4c375b4113eeea47b /test cases
parent5a4168c410fea6fce8867ec60e0ba481d7c61866 (diff)
downloadmeson-1a0eff005483b63259e365bd4d51be7c4bd3b729.zip
meson-1a0eff005483b63259e365bd4d51be7c4bd3b729.tar.gz
meson-1a0eff005483b63259e365bd4d51be7c4bd3b729.tar.bz2
devenv: Allow dumping into file and select a format
It is often more useful to generate shell script than dumping to stdout. It is also important to be able to select the shell format. Formats currently implemented: - sh: Basic VAR=prepend_value:$VAR - export: Same as 'sh', but also export VAR - vscode: Same as 'sh', but without substitutions because they don't seems to work. To be used in launch.json's envFile.
Diffstat (limited to 'test cases')
-rw-r--r--test cases/unit/90 devenv/meson.build5
-rwxr-xr-xtest cases/unit/90 devenv/test-devenv.py1
2 files changed, 6 insertions, 0 deletions
diff --git a/test cases/unit/90 devenv/meson.build b/test cases/unit/90 devenv/meson.build
index 3b0bb6a..72d8fdc 100644
--- a/test cases/unit/90 devenv/meson.build
+++ b/test cases/unit/90 devenv/meson.build
@@ -15,3 +15,8 @@ meson.add_devenv(env)
# This exe links on a library built in another directory. On Windows this means
# PATH must contain builddir/subprojects/sub to be able to run it.
executable('app', 'main.c', dependencies: foo_dep, install: true)
+
+env = environment({'TEST_C': ['/prefix']}, method: 'prepend')
+meson.add_devenv(env)
+env = environment({'TEST_C': ['/suffix']}, method: 'append')
+meson.add_devenv(env)
diff --git a/test cases/unit/90 devenv/test-devenv.py b/test cases/unit/90 devenv/test-devenv.py
index 75497ff..07bcf61 100755
--- a/test cases/unit/90 devenv/test-devenv.py
+++ b/test cases/unit/90 devenv/test-devenv.py
@@ -6,3 +6,4 @@ assert os.environ['MESON_DEVENV'] == '1'
assert os.environ['MESON_PROJECT_NAME'] == 'devenv'
assert os.environ['TEST_A'] == '1'
assert os.environ['TEST_B'] == '0+1+2+3+4'
+assert os.environ['TEST_C'] == os.pathsep.join(['/prefix', '/suffix'])