Skip to content

Commit 8f72716

Browse files
tridgeclaude
andcommitted
runtests.py: error early when test helper programs are missing
When invoked directly (rather than via 'make check'), runtests.py previously left the user with a wall of confusing "not found" errors from inside individual test scripts if the CHECK_PROGS helpers had not been built. Detect this up front and point the user at the make target that builds them. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 5bcb3de commit 8f72716

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

runtests.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,22 @@ def main():
297297
sys.stderr.write(f"srcdir {srcdir} is not a directory\n")
298298
sys.exit(2)
299299

300+
# Helper programs the test scripts invoke directly. Missing any of these
301+
# would cause many tests to fail with confusing "not found" errors, so
302+
# check up front and point the user at the make target that builds them.
303+
required_helpers = ['tls', 'trimslash', 't_unsafe', 'wildtest',
304+
'getgroups', 'getfsdev']
305+
missing = [h for h in required_helpers
306+
if not os.path.isfile(os.path.join(tooldir, h))]
307+
if missing:
308+
sys.stderr.write(
309+
f"runtests.py: missing test helper program(s) in {tooldir}: "
310+
f"{', '.join(missing)}\n"
311+
f"Build them with: make {' '.join(missing)}\n"
312+
f"or run the full test target: make check\n"
313+
)
314+
sys.exit(2)
315+
300316
testuser = get_testuser()
301317

302318
# Print header

0 commit comments

Comments
 (0)