summaryrefslogtreecommitdiff
path: root/CC/test
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2023-07-11 16:23:06 +0200
committerKlaus Aehlig <klaus.aehlig@huawei.com>2023-07-12 15:25:49 +0200
commitaa14a481ce7645f6fb78ce7548a1f60920599d49 (patch)
tree62275ffad68bf2200c3fd85976ceb0a0551836a6 /CC/test
parent093a0c8fe2eaa9be7d8e539f3e35236c7df0449b (diff)
downloadrules-cc-aa14a481ce7645f6fb78ce7548a1f60920599d49.tar.gz
["CC/test", "test]: support target architecture
... provided it is specified on how to obtain a remote-execution endpoint for the given architecture; in this case, the test binary 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 'CC/test')
-rw-r--r--CC/test/EXPRESSIONS10
-rw-r--r--CC/test/RULES19
2 files changed, 28 insertions, 1 deletions
diff --git a/CC/test/EXPRESSIONS b/CC/test/EXPRESSIONS
index 678ab56..4207f8e 100644
--- a/CC/test/EXPRESSIONS
+++ b/CC/test/EXPRESSIONS
@@ -8,6 +8,8 @@
, "vars":
[ "ARCH"
, "HOST_ARCH"
+ , "TARGET_ARCH"
+ , "ARCH_DISPATCH"
, "CC"
, "CXX"
, "CFLAGS"
@@ -46,6 +48,7 @@
, "ldflags-files-deps": ["./", "..", "ldflags-files-deps"]
, "binary": ["./", "..", "bin artifact"]
, "host transition": ["transitions", "for host"]
+ , "target properties": ["transitions", "target properties"]
, "stage": ["./", "../..", "stage_singleton_field"]
}
, "expression":
@@ -147,6 +150,9 @@
]
}
]
+ , [ "target properties"
+ , {"type": "CALL_EXPRESSION", "name": "target properties"}
+ ]
]
, "body":
{ "type": "if"
@@ -171,6 +177,8 @@
, "$1":
["CC test ", {"type": "var", "name": "test-name"}, " failed"]
}
+ , "execution properties":
+ {"type": "var", "name": "target properties"}
}
]
, [ "runfiles"
@@ -244,6 +252,8 @@
, ")"
]
}
+ , "execution properties":
+ {"type": "var", "name": "target properties"}
}
}
}
diff --git a/CC/test/RULES b/CC/test/RULES
index 350d585..8dba363 100644
--- a/CC/test/RULES
+++ b/CC/test/RULES
@@ -14,6 +14,7 @@
, "config_vars":
[ "ARCH"
, "HOST_ARCH"
+ , "TARGET_ARCH"
, "CC"
, "CXX"
, "CFLAGS"
@@ -24,6 +25,7 @@
, "TEST_ENV"
, "CC_TEST_LAUNCHER"
, "RUNS_PER_TEST"
+ , "ARCH_DISPATCH"
]
, "implicit":
{ "defaults": [["./", "..", "defaults"]]
@@ -87,6 +89,19 @@
[ "The number of times the test should be run in order to detect flakyness."
, "If set, no test action will be taken from cache."
]
+ , "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."
+ ]
}
, "artifacts_doc":
[ "result: the result of this test (\"PASS\" or \"FAIL\"); useful for"
@@ -105,7 +120,7 @@
, "imports":
{ "artifacts": ["./", "../..", "field_artifacts"]
, "runfiles": ["./", "../..", "field_runfiles"]
- , "host transition": ["transitions", "for host"]
+ , "host transition": ["transitions", "maybe for host"]
, "stage": ["./", "../..", "stage_singleton_field"]
, "run_test": "run_test"
}
@@ -113,6 +128,7 @@
{ "defaults": [{"type": "CALL_EXPRESSION", "name": "host transition"}]
, "private-deps": [{"type": "CALL_EXPRESSION", "name": "host transition"}]
, "data": [{"type": "CALL_EXPRESSION", "name": "host transition"}]
+ , "runner": [{"type": "CALL_EXPRESSION", "name": "host transition"}]
}
, "expression":
{ "type": "let*"
@@ -170,6 +186,7 @@
, "$1":
{ "type": "DEP_ARTIFACTS"
, "dep": {"type": "var", "name": "runner"}
+ , "transition": {"type": "var", "name": "host-trans"}
}
}
, "body":