summaryrefslogtreecommitdiff
path: root/build2/test
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2016-09-20 01:56:09 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2016-09-20 01:56:09 +0300
commite2ef894fb8aa8e888c0d9dbba4e076f89e3b2eec (patch)
tree27e433fa462e3d2aabf1565d20c1ad835a567075 /build2/test
parent6fd22c1084e561d572e43fb614b307347a5e7f83 (diff)
Update feature: Test description language (testscript)
Diffstat (limited to 'build2/test')
-rw-r--r--build2/test/testscript25
1 files changed, 24 insertions, 1 deletions
diff --git a/build2/test/testscript b/build2/test/testscript
index cf64e49..67304d7 100644
--- a/build2/test/testscript
+++ b/build2/test/testscript
@@ -126,7 +126,7 @@ EOE
~ What if we actually do want the output to go to a file, e.g., for a second
command to act on it? Maybe keep shell syntax since familiar? Or reverse it
(> - inline, >> - multiline, >>> to file). Simplest thing is the shortest, I
- like it.
+ like it. What about appending to file - >>>> ?
~ $0 is target path (works out in case of a directory, but will be out).
@@ -161,3 +161,26 @@ EOE
~ Clean up is tricky: sometimes we may want to keep it, but then how to clean
it up later (the test might fail if there is junk present). Maybe create
temp directory in out_base and run there? Will also help with parallel runs.
+
+~ We will need an ability to execute same command multiple times with some
+ argument variations. For simple cases the following idiom can be used:
+
+ cmd = a b c
+ $cmd d e f # Expands to: a b c d e f
+ v=`$cmd x y z`
+
+ The problem is that only the last arguments (of the last program in pipe) can
+ be varied.
+
+ What if we can support variable templates with the following syntax:
+
+ # Template variable definition. Same as a regular variable assignement but
+ # $n variables are not expanded and denotes template parameters.
+ #
+ cmd ~= a $1 b | c $2
+
+ # Instantiations. First n values that follows template variable expansion are
+ # template arguments.
+ #
+ $cmd d e f # Expands to: a d b | c e f
+ v=`$cmd x y`