parent
18897b6afd
commit
a65d5801f3
6 changed files with 78 additions and 18 deletions
@ -0,0 +1,8 @@ |
||||
## Support taking environment values from a dictionary |
||||
|
||||
`environment()` now accepts a dictionary as first argument. If |
||||
provided, each key/value pair is added into the `environment_object` |
||||
as if `set()` method was called for each of them. |
||||
|
||||
On the various functions that take an `env:` keyword argument, you may |
||||
now give a dictionary. |
@ -0,0 +1,10 @@ |
||||
project('test env value') |
||||
|
||||
testpy = find_program('test.py') |
||||
|
||||
val = ['1', '2', '3'] |
||||
foreach v: val |
||||
test('check env', testpy, args: [v], env: {'TEST_VAR': v}) |
||||
endforeach |
||||
test('check env', testpy, args: ['4'], env: environment({'TEST_VAR': '4'})) |
||||
test('check env', testpy, args: ['5'], env: environment(['TEST_VAR=5'])) |
@ -0,0 +1,6 @@ |
||||
#!/usr/bin/env python3 |
||||
|
||||
import os |
||||
import sys |
||||
|
||||
assert(os.environ['TEST_VAR'] == sys.argv[1]) |
Loading…
Reference in new issue