diff options
-rw-r--r-- | rules/CC/test/RULES | 40 | ||||
-rwxr-xr-x | rules/CC/test/runner | 2 |
2 files changed, 12 insertions, 30 deletions
diff --git a/rules/CC/test/RULES b/rules/CC/test/RULES index 93356aa..601807a 100644 --- a/rules/CC/test/RULES +++ b/rules/CC/test/RULES @@ -45,9 +45,10 @@ , "srcs": [ "The sources of the test binary" , "" - , "The resulting test binary in an environment where it can assume" + , "The resulting test binary is run in an environment where it can assume" , "that the environment variable TEST_TMPDIR points to a" - , "director that may be used exclusively by this test." + , "directory that may be used exclusively by this test." + , "For convenience, the environment variable TMPDIR is also set to TEST_TMPDIR." , "" , "This running of the test is carried out by the implicit dependency" , "on the target \"runner\". By setting this target in the target layer" @@ -75,7 +76,7 @@ , "data": ["Any files the test binary needs access to when running"] , "defaults": ["The C/C++ toolchain to use"] , "runner": - [ "The test runner which starts the actual test binrary after providing" + [ "The test runner which starts the actual test binary after providing" , "the respective environment. The runner also takes care of capturing" , "stdout/stderr and timing information." ] @@ -207,32 +208,13 @@ , ["deps-transition", {"type": "var", "name": "host-trans"}] , ["deps-fieldnames", ["private-deps", "defaults"]] , [ "runner" - , { "type": "map_union" - , "$1": - { "type": "foreach" - , "var": "runner" - , "range": {"type": "FIELD", "name": "runner"} - , "body": - { "type": "map_union" - , "$1": - { "type": "foreach" - , "var": "runner" - , "range": - { "type": "values" - , "$1": - { "type": "DEP_ARTIFACTS" - , "dep": {"type": "var", "name": "runner"} - , "transition": {"type": "var", "name": "host-trans"} - } - } - , "body": - { "type": "singleton_map" - , "key": "runner" - , "value": {"type": "var", "name": "runner"} - } - } - } - } + , { "type": "let*" + , "bindings": + [ ["fieldname", "runner"] + , ["location", "runner"] + , ["transition", {"type": "var", "name": "host-trans"}] + ] + , "body": {"type": "CALL_EXPRESSION", "name": "stage"} } ] , ["test-args", {"type": "FIELD", "name": "args", "default": []}] diff --git a/rules/CC/test/runner b/rules/CC/test/runner index fc1f04c..45a1bee 100755 --- a/rules/CC/test/runner +++ b/rules/CC/test/runner @@ -46,7 +46,7 @@ os.makedirs(TEMP_DIR, exist_ok=True) WORK_DIR = os.path.realpath("work") os.makedirs(WORK_DIR, exist_ok=True) -ENV = dict(os.environ, TEST_TMPDIR=TEMP_DIR) +ENV = dict(os.environ, TEST_TMPDIR=TEMP_DIR, TMPDIR=TEMP_DIR) with open('test-launcher.json') as f: test_launcher = json.load(f) |