test_driver.py: Use subprocess.check_output rather than subprocess.run

Signed-off-by: Ronald Cron <[email protected]>
This commit is contained in:
Ronald Cron
2025-12-09 11:04:50 +01:00
parent ed9c4a31e4
commit 9ce24b367d
+2 -4
View File
@@ -249,15 +249,13 @@ class TestDriverGenerator:
support all `--c-kinds` flags used here, and will either fail with an support all `--c-kinds` flags used here, and will either fail with an
error or produce incomplete results. error or produce incomplete results.
""" """
result = subprocess.run( output = subprocess.check_output(
["ctags", "-x", "--language-force=C", "--c-kinds=defgpstuv", str(file)], ["ctags", "-x", "--language-force=C", "--c-kinds=defgpstuv", str(file)],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT, stderr=subprocess.STDOUT,
universal_newlines=True, universal_newlines=True,
check=True
) )
identifiers = set() identifiers = set()
for line in result.stdout.splitlines(): for line in output.splitlines():
identifiers.add(line.split()[0]) identifiers.add(line.split()[0])
return identifiers return identifiers