diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-08-05 16:28:53 +0200 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-08-05 17:24:39 +0200 |
commit | d1a594af5bfb190fe625c400e700cc6096f7787b (patch) | |
tree | 2841e371cb70821014ae3a3b76a30502ba181b0d /shell/test/EXPRESSIONS | |
parent | 128ff7d3abd575419e719ad224d9a42ee93d09a6 (diff) | |
download | rules-cc-d1a594af5bfb190fe625c400e700cc6096f7787b.tar.gz |
rules shell/test: Add 'keep-dirs' field
The existing rules allow a shell test script to explicitly 'keep'
created files in the resulting output directory, to be accessible
to any dependent target, thus allowing a chaining of data across
test scripts. This field however excludes directories, whose
content would need to be added one file at a time to the 'keep'
field.
Add instead also a 'keep-dirs' field to ["shell/test", "script"]
rule which allows the explicit staging of given directory paths the
test is expected to generate.
Diffstat (limited to 'shell/test/EXPRESSIONS')
-rw-r--r-- | shell/test/EXPRESSIONS | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/shell/test/EXPRESSIONS b/shell/test/EXPRESSIONS index e445c2a..44cb48a 100644 --- a/shell/test/EXPRESSIONS +++ b/shell/test/EXPRESSIONS @@ -6,6 +6,7 @@ , "name" , "test.sh" , "keep" + , "keep-dirs" , "runner" , "deps-fieldname" , "deps-transition" @@ -184,6 +185,16 @@ ] } ] + , [ "out_dirs" + , { "type": "foreach" + , "var": "dir_path" + , "range": {"type": "var", "name": "keep-dirs"} + , "body": + { "type": "join" + , "$1": ["work/", {"type": "var", "name": "dir_path"}] + } + } + ] , [ "inputs" , { "type": "map_union" , "$1": @@ -210,6 +221,7 @@ , "then": { "type": "ACTION" , "outs": {"type": "var", "name": "outs"} + , "out_dirs": {"type": "var", "name": "out_dirs"} , "inputs": {"type": "var", "name": "inputs"} , "cmd": {"type": "var", "name": "cmd"} , "env": {"type": "var", "name": "test_env"} @@ -225,6 +237,7 @@ , "else": { "type": "ACTION" , "outs": {"type": "var", "name": "outs"} + , "out_dirs": {"type": "var", "name": "out_dirs"} , "inputs": {"type": "var", "name": "inputs"} , "cmd": {"type": "var", "name": "cmd"} , "env": {"type": "var", "name": "test_env"} @@ -254,6 +267,7 @@ , "name" , "test.sh" , "keep" + , "keep-dirs" , "runner" , "deps-fieldname" , "deps-transition" |