From d1b7465073cd8d60ec6611f541609215d54b4aa3 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Mon, 12 May 2025 10:26:55 +0200 Subject: ["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. --- test/EXPRESSIONS | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 test/EXPRESSIONS (limited to 'test/EXPRESSIONS') diff --git a/test/EXPRESSIONS b/test/EXPRESSIONS new file mode 100644 index 0000000..006e804 --- /dev/null +++ b/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"} + } + ] + } + } + } + } + } + } + } + } + } +} -- cgit v1.2.3