diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2023-07-13 11:13:27 +0200 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2023-07-14 09:36:51 +0200 |
commit | e60c1168d4d0b43bff7acf19e35f44c786d4fff9 (patch) | |
tree | c211f0969b63a96540e063879e7d145fe2b2ffa7 /rules/shell | |
parent | ba28beba51ff7d495e5165471b96f7496bf585c2 (diff) | |
download | justbuild-e60c1168d4d0b43bff7acf19e35f44c786d4fff9.tar.gz |
["shell/test", "script"]: support target architecture
... provided it is specified on how to obtain a remote-execution
endpoint for the given architecture; in this case, the test (script
and) dependencies will be cross compiled for and run on that
architecture. The actual building (as well as summarizing multiple
test runs) happens on the default execution end point.
Diffstat (limited to 'rules/shell')
-rw-r--r-- | rules/shell/test/EXPRESSIONS | 4 | ||||
-rw-r--r-- | rules/shell/test/RULES | 40 |
2 files changed, 40 insertions, 4 deletions
diff --git a/rules/shell/test/EXPRESSIONS b/rules/shell/test/EXPRESSIONS index 3ab3605b..80e6cdb5 100644 --- a/rules/shell/test/EXPRESSIONS +++ b/rules/shell/test/EXPRESSIONS @@ -9,6 +9,7 @@ , "runner" , "deps-fieldname" , "deps-transition" + , "target properties" ] , "imports": { "artifacts_list": ["./", "../..", "field_artifacts_list"] @@ -135,6 +136,7 @@ } , "timeout scaling": {"type": "var", "name": "TIMEOUT_SCALE", "default": 1.0} + , "execution properties": {"type": "var", "name": "target properties"} } , "else": { "type": "ACTION" @@ -156,6 +158,7 @@ } , "timeout scaling": {"type": "var", "name": "TIMEOUT_SCALE", "default": 1.0} + , "execution properties": {"type": "var", "name": "target properties"} } } } @@ -170,6 +173,7 @@ , "runner" , "deps-fieldname" , "deps-transition" + , "target properties" ] , "imports": {"action": "test-action"} , "expression": diff --git a/rules/shell/test/RULES b/rules/shell/test/RULES index d6baa9ca..117a060d 100644 --- a/rules/shell/test/RULES +++ b/rules/shell/test/RULES @@ -3,7 +3,14 @@ , "target_fields": ["deps", "test"] , "string_fields": ["keep", "name"] , "config_vars": - ["ARCH", "HOST_ARCH", "RUNS_PER_TEST", "TEST_ENV", "TIMEOUT_SCALE"] + [ "ARCH" + , "HOST_ARCH" + , "RUNS_PER_TEST" + , "TEST_ENV" + , "TIMEOUT_SCALE" + , "TARGET_ARCH" + , "ARCH_DISPATCH" + ] , "field_doc": { "test": [ "The shell script for the test, launched with sh." @@ -36,6 +43,19 @@ , "TEST_ENV": ["The environment for executing the test runner."] , "TIMEOUT_SCALE": ["Factor on how to scale the timeout for this test. Defaults to 1.0."] + , "TARGET_ARCH": + [ "The architecture to build the test for." + , "" + , "Will only be honored, if that architecture is available in the" + , "ARCH_DISPATCH map. Otherwise, the test will be built for and run" + , "on the host architecture." + ] + , "ARCH_DISPATCH": + [ "Map of architectures to execution properties that ensure execution" + , "on that architecture. Only the actual test binary will be run with" + , "the specified execution properties (i.e., on the target architecture);" + , "all building will be done on the host architecture." + ] } , "tainted": ["test"] , "artifacts_doc": @@ -58,10 +78,13 @@ { "test-result": "test-result" , "action": "test-action" , "stage": ["./", "../..", "stage_singleton_field"] - , "host transition": ["transitions", "for host"] + , "host transition": ["transitions", "maybe for host"] + , "target properties": ["transitions", "target properties"] } , "config_transitions": - {"deps": [{"type": "CALL_EXPRESSION", "name": "host transition"}]} + { "deps": [{"type": "CALL_EXPRESSION", "name": "host transition"}] + , "test": [{"type": "CALL_EXPRESSION", "name": "host transition"}] + } , "expression": { "type": "let*" , "bindings": @@ -70,7 +93,13 @@ , "msg": "Expecting 'test' to specify precisely one file containing a shell script" , "$1": { "type": "let*" - , "bindings": [["fieldname", "test"], ["location", "test.sh"]] + , "bindings": + [ ["fieldname", "test"] + , ["location", "test.sh"] + , [ "transition" + , {"type": "CALL_EXPRESSION", "name": "host transition"} + ] + ] , "body": {"type": "CALL_EXPRESSION", "name": "stage"} } } @@ -87,6 +116,9 @@ , [ "deps-transition" , {"type": "CALL_EXPRESSION", "name": "host transition"} ] + , [ "target properties" + , {"type": "CALL_EXPRESSION", "name": "target properties"} + ] ] , "body": { "type": "if" |