aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2021-04-20 22:48:59 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2021-04-21 17:15:28 +0300
commit09c231965f9f8e8f1e86f127a22f112d63ef4d9b (patch)
treee1a8689a0053099719722ba45d35aa33d229fc1e /tests
parent30da2a90b3d433160c06643fb7ca51722fbae6b8 (diff)
Add buildscript depdb builtin 'env' command
Diffstat (limited to 'tests')
-rw-r--r--tests/recipe/buildscript/testscript62
1 files changed, 62 insertions, 0 deletions
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 <<EOI >=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 <<EOI >=buildfile;
+ foo:
+ {{
+ s = $getenv(FOO)
+
+ depdb clear
+ depdb env FOO
+ echo "$s" >$path($>)
+ }}
+ EOI
+
+ export FOO=foo;
+
+ $* 2>'echo file{foo}';
+ cat <<<foo >'foo';
+
+ $* 2>/'info: dir{./} is up to date';
+
+ export FOO=bar;
+
+ $* 2>'echo file{foo}';
+ cat <<<foo >'bar';
+
+ export -u FOO;
+
+ $* 2>'echo file{foo}';
+ cat <<<foo >'';
+
+ $* clean 2>-
+ }
+ }
+
: preamble
:
{