This commit is contained in:
parent
aa2ff7b2f0
commit
2f3113f55d
11742 changed files with 1223940 additions and 0 deletions
|
|
@ -0,0 +1,7 @@
|
|||
(lang dune 1.5)
|
||||
|
||||
(env
|
||||
(_
|
||||
(env-vars
|
||||
(VARIABLE value1)
|
||||
(VARIABLE value2))))
|
||||
8
unikernel/duniverse/dune_/test/blackbox-tests/test-cases/env/env-variables/duplicate.t/run.t
vendored
Normal file
8
unikernel/duniverse/dune_/test/blackbox-tests/test-cases/env/env-variables/duplicate.t/run.t
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
When a variable is repeated, an error message is displayed:
|
||||
|
||||
$ dune build
|
||||
File "dune-workspace", lines 6-7, characters 3-41:
|
||||
6 | (VARIABLE value1)
|
||||
7 | (VARIABLE value2))))
|
||||
Error: Variable VARIABLE is specified several times
|
||||
[1]
|
||||
2
unikernel/duniverse/dune_/test/blackbox-tests/test-cases/env/env-variables/precedence.t/dune
vendored
Normal file
2
unikernel/duniverse/dune_/test/blackbox-tests/test-cases/env/env-variables/precedence.t/dune
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
(executable
|
||||
(name printenv))
|
||||
|
|
@ -0,0 +1 @@
|
|||
(lang dune 1.1)
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
(lang dune 1.5)
|
||||
|
||||
(env
|
||||
(_
|
||||
(env-vars
|
||||
(VARIABLE_FROM_WORKSPACE value1)
|
||||
(VARIABLE_FROM_BOTH from_workspace))))
|
||||
|
||||
(context
|
||||
(default
|
||||
(env
|
||||
(_
|
||||
(env-vars
|
||||
(VARIABLE_FROM_CONTEXT value2)
|
||||
(VARIABLE_FROM_BOTH from_context))))))
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
let var_to_string k = try Sys.getenv k with Not_found -> "(unset)"
|
||||
|
||||
let print_var k = Printf.printf "%s=%s\n" k (var_to_string k)
|
||||
|
||||
let () = print_var Sys.argv.(1)
|
||||
17
unikernel/duniverse/dune_/test/blackbox-tests/test-cases/env/env-variables/precedence.t/run.t
vendored
Normal file
17
unikernel/duniverse/dune_/test/blackbox-tests/test-cases/env/env-variables/precedence.t/run.t
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
Environment variables defined in (env) are set during execution.
|
||||
|
||||
They can be set from the workspace:
|
||||
|
||||
$ dune exec ./printenv.exe VARIABLE_FROM_WORKSPACE
|
||||
VARIABLE_FROM_WORKSPACE=value1
|
||||
|
||||
From a (context) stanza in the workspace:
|
||||
|
||||
$ dune exec ./printenv.exe VARIABLE_FROM_CONTEXT
|
||||
VARIABLE_FROM_CONTEXT=value2
|
||||
|
||||
When a variable is set from both a context and a global one, the context one is
|
||||
used.
|
||||
|
||||
$ dune exec ./printenv.exe VARIABLE_FROM_BOTH
|
||||
VARIABLE_FROM_BOTH=from_workspace
|
||||
Loading…
Add table
Add a link
Reference in a new issue