diff options
author | Xavier Claessens <xclaesse@gmail.com> | 2021-03-23 11:48:17 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-23 17:48:17 +0200 |
commit | 1be13710adba2126f5731fccdf698a9d405a9d67 (patch) | |
tree | 6b2c2038b9003b3a85a265c1525daae9139b1a98 /test cases/common | |
parent | de9df5128c03d016ec9463f705422f2e1df4c49a (diff) | |
download | meson-1be13710adba2126f5731fccdf698a9d405a9d67.zip meson-1be13710adba2126f5731fccdf698a9d405a9d67.tar.gz meson-1be13710adba2126f5731fccdf698a9d405a9d67.tar.bz2 |
environment(): Allow stacking append() and prepend() (#8547)
* environment(): Allow stacking append() and prepend()
* Update docs/markdown/Reference-manual.md
Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Diffstat (limited to 'test cases/common')
-rw-r--r-- | test cases/common/34 run program/check-env.py | 6 | ||||
-rw-r--r-- | test cases/common/34 run program/meson.build | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/test cases/common/34 run program/check-env.py b/test cases/common/34 run program/check-env.py new file mode 100644 index 0000000..7f106c6 --- /dev/null +++ b/test cases/common/34 run program/check-env.py @@ -0,0 +1,6 @@ +#!/usr/bin/env python3 + +import os + +assert os.environ['MY_PATH'] == os.pathsep.join(['0', '1', '2']) + diff --git a/test cases/common/34 run program/meson.build b/test cases/common/34 run program/meson.build index 93897e3..8e472fd 100644 --- a/test cases/common/34 run program/meson.build +++ b/test cases/common/34 run program/meson.build @@ -77,3 +77,9 @@ if dd.found() assert(ret.returncode() == 0, 'failed to run dd: ' + ret.stderr()) assert(ret.stdout() == '', 'stdout is "@0@" instead of empty'.format(ret.stdout())) endif + +env = environment() +env.append('MY_PATH', '1') +env.append('MY_PATH', '2') +env.prepend('MY_PATH', '0') +run_command('check-env.py', env: env, check: true) |