summaryrefslogtreecommitdiff
path: root/CC/test
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2024-04-17 15:06:37 +0200
committerKlaus Aehlig <klaus.aehlig@huawei.com>2024-04-17 15:33:40 +0200
commitdf57e7ac05e218a910ce56a1a2bff16ccdaaba20 (patch)
tree1a4237f30e21c32544b4be2833327ec67cc0012c /CC/test
parentc76b6c45bb413e87b2cc0fbcc25f25e86f5b507f (diff)
downloadrules-cc-df57e7ac05e218a910ce56a1a2bff16ccdaaba20.tar.gz
["CC/test", "test"] runner: set TMPDIR
... to the same value as TEST_TMPDIR. While TEST_TMPDIR is the conventional name that tests should use for their temporary file, setting TMPDIR as well has the advantage that more library functions can be used to create temporary files and directories, as quite a few of them inspect the variable TMPDIR. While there, also fix some typos in the documentation strings.
Diffstat (limited to 'CC/test')
-rw-r--r--CC/test/RULES7
-rwxr-xr-xCC/test/runner2
2 files changed, 5 insertions, 4 deletions
diff --git a/CC/test/RULES b/CC/test/RULES
index ac1bff9..aa69827 100644
--- a/CC/test/RULES
+++ b/CC/test/RULES
@@ -42,9 +42,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"
@@ -72,7 +73,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."
]
diff --git a/CC/test/runner b/CC/test/runner
index fc1f04c..45a1bee 100755
--- a/CC/test/runner
+++ b/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)