aboutsummaryrefslogtreecommitdiff
path: root/tests/recipe
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2022-10-20 20:38:40 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2022-10-21 11:50:52 +0300
commit27342e7a1066a3f1426a624a35e52c23bdedeed9 (patch)
treebc7cf4c125e9e1a987e4d6b74acf14b4e6deb4d6 /tests/recipe
parent4881a227779a78db1de2a7723e2a86f2b61453b3 (diff)
Add support for pairs in script 'for x:...' loop
Diffstat (limited to 'tests/recipe')
-rw-r--r--tests/recipe/buildscript/testscript34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/recipe/buildscript/testscript b/tests/recipe/buildscript/testscript
index 6d33888..4299fb5 100644
--- a/tests/recipe/buildscript/testscript
+++ b/tests/recipe/buildscript/testscript
@@ -1101,6 +1101,40 @@ if $posix
$* clean 2>-
}
+ : pair
+ :
+ {
+ mkdir -p src/build;
+ echo 'bar' >=src/bar;
+ echo 'baz' >=src/baz;
+
+ echo 'project =' >=src/build/bootstrap.build;
+
+ cat <<EOI >=src/buildfile;
+ foo: file{bar}@./ file{baz}@./
+ {{
+ p = $path($>)
+ rm -f $p
+
+ for f: $<
+ cat $path($f) >>$p
+ end
+ }}
+ EOI
+
+ $* src/@out/ 2>>/EOE;
+ mkdir fsdir{out/}
+ cat out/file{foo}
+ EOE
+
+ cat <<<out/foo >>EOO;
+ bar
+ baz
+ EOO
+
+ $* 'clean:' src/@out/ 2>-
+ }
+
: special-var
:
{