summaryrefslogtreecommitdiff
path: root/rules/test/EXPRESSIONS
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2025-05-12 10:26:55 +0200
committerKlaus Aehlig <klaus.aehlig@huawei.com>2025-05-12 15:20:36 +0200
commit5b3c6136e3e896019acb1bbc117615255c5f924a (patch)
tree46b5ab68ea20c4aef082b1559ab91e4943fe05d5 /rules/test/EXPRESSIONS
parentf8a1a6a4a2f585db5cb1f20aad540cdf75b389aa (diff)
downloadjustbuild-5b3c6136e3e896019acb1bbc117615255c5f924a.tar.gz
["test", "matrix"] Building a group of tests in many configurations
Often it is desirable to run tests in a variety of configurations: different toolchain used, different target architecture, different protocol versions in end-to-end tests, etc. The rule ["test", "matrix"] allows running tests in those exponentially many combinations in a single target and thus makes full test coverage maintainable.
Diffstat (limited to 'rules/test/EXPRESSIONS')
-rw-r--r--rules/test/EXPRESSIONS60
1 files changed, 60 insertions, 0 deletions
diff --git a/rules/test/EXPRESSIONS b/rules/test/EXPRESSIONS
new file mode 100644
index 00000000..006e804a
--- /dev/null
+++ b/rules/test/EXPRESSIONS
@@ -0,0 +1,60 @@
+{ "matrix":
+ { "vars": ["TEST_MATRIX"]
+ , "expression":
+ { "type": "foldl"
+ , "var": "VAR"
+ , "accum_var": "so far"
+ , "range":
+ { "type": "keys"
+ , "$1":
+ { "type": "var"
+ , "name": "TEST_MATRIX"
+ , "default": {"type": "empty_map"}
+ }
+ }
+ , "start": [{"type": "'", "$1": {"": {"TEST_MATRIX": null}}}]
+ , "body":
+ { "type": "++"
+ , "$1":
+ { "type": "foreach_map"
+ , "var_key": "stage"
+ , "var_val": "VALUE"
+ , "range":
+ { "type": "lookup"
+ , "key": {"type": "var", "name": "VAR"}
+ , "map": {"type": "var", "name": "TEST_MATRIX"}
+ }
+ , "body":
+ { "type": "++"
+ , "$1":
+ { "type": "foreach"
+ , "range": {"type": "var", "name": "so far"}
+ , "body":
+ { "type": "foreach_map"
+ , "range":
+ { "type": "to_subdir"
+ , "subdir": {"type": "var", "name": "stage"}
+ , "$1": {"type": "var", "name": "_"}
+ }
+ , "body":
+ { "type": "singleton_map"
+ , "key": {"type": "var", "name": "_"}
+ , "value":
+ { "type": "map_union"
+ , "$1":
+ [ {"type": "var", "name": "$_"}
+ , { "type": "singleton_map"
+ , "key": {"type": "var", "name": "VAR"}
+ , "value": {"type": "var", "name": "VALUE"}
+ }
+ ]
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}