diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2023-04-11 14:49:53 +0200 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2023-04-11 15:46:55 +0200 |
commit | c1bd17cf5877f3cc236af12c23286a56d8051b8a (patch) | |
tree | e82c08768581850ade45e405c3767182985e5c22 /rules/shell/test/EXPRESSIONS | |
parent | 870efd45868aeed7e0c088bb3edd753bf52a299f (diff) | |
download | rules-cc-c1bd17cf5877f3cc236af12c23286a56d8051b8a.tar.gz |
["shell/test", "script"]: make TEST_RUN_NUMBER available
If RUNS_PER_TEST is given, inform each individual test action about
the run number it is executing. This can be used, e.g., to set
random seeds appropriately.
Diffstat (limited to 'rules/shell/test/EXPRESSIONS')
-rw-r--r-- | rules/shell/test/EXPRESSIONS | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/rules/shell/test/EXPRESSIONS b/rules/shell/test/EXPRESSIONS index d1d7e64..ea36b32 100644 --- a/rules/shell/test/EXPRESSIONS +++ b/rules/shell/test/EXPRESSIONS @@ -132,7 +132,27 @@ , {"type": "++", "$1": [["./runner"], {"type": "var", "name": "keep"}]} ] , [ "test_env" - , {"type": "var", "name": "TEST_ENV", "default": {"type": "empty_map"}} + , { "type": "map_union" + , "$1": + [ { "type": "if" + , "cond": + { "type": "==" + , "$1": {"type": "var", "name": "ATTEMPT"} + , "$2": null + } + , "then": {"type": "empty_map"} + , "else": + { "type": "singelton_map" + , "key": "TEST_RUN_NUMBER" + , "value": {"type": "var", "name": "ATTEMPT"} + } + } + , { "type": "var" + , "name": "TEST_ENV" + , "default": {"type": "empty_map"} + } + ] + } ] ] , "body": |