From 09c231965f9f8e8f1e86f127a22f112d63ef4d9b Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 20 Apr 2021 22:48:59 +0300 Subject: Add buildscript depdb builtin 'env' command --- tests/recipe/buildscript/testscript | 62 +++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) (limited to 'tests') diff --git a/tests/recipe/buildscript/testscript b/tests/recipe/buildscript/testscript index 14036dd..3ccfdd5 100644 --- a/tests/recipe/buildscript/testscript +++ b/tests/recipe/buildscript/testscript @@ -306,6 +306,68 @@ posix = ($cxx.target.class != 'windows') $* clean 2>- } + : env + : + { + : invalid + : + { + cat <=buildfile; + foo: + {{ + s = $getenv(FOO) + + depdb clear + depdb env FOO=bar + echo "$s" >$path($>) + }} + EOI + + $* 2>>/EOE != 0; + buildfile:6:3: error: invalid 'depdb env' argument: invalid variable name 'FOO=bar': contains '=' + info: while updating file{foo} + info: while updating dir{./} + info: failed to update dir{./} + EOE + + $* clean 2>- + } + + : valid + : + { + cat <=buildfile; + foo: + {{ + s = $getenv(FOO) + + depdb clear + depdb env FOO + echo "$s" >$path($>) + }} + EOI + + export FOO=foo; + + $* 2>'echo file{foo}'; + cat <<'foo'; + + $* 2>/'info: dir{./} is up to date'; + + export FOO=bar; + + $* 2>'echo file{foo}'; + cat <<'bar'; + + export -u FOO; + + $* 2>'echo file{foo}'; + cat <<''; + + $* clean 2>- + } + } + : preamble : { -- cgit v1.1