From 21cbcc54e99db175619959a5b185bbb4d9b81d5a Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 22 Apr 2025 14:10:52 -0400 Subject: update-manpages: include in unittests People often forget to regen when making interface changes. We skip the test if help2man isn't installed since it's not common, and it's not available on our CI bots currently. Change-Id: Ib4911a0e3fa1294ad90e4ac8afc047a0b7c2b66d Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/469741 Tested-by: Mike Frysinger Reviewed-by: Gavin Mak Commit-Queue: Mike Frysinger --- run_tests | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'run_tests') diff --git a/run_tests b/run_tests index d64cc700..ea34e675 100755 --- a/run_tests +++ b/run_tests @@ -17,6 +17,7 @@ import functools import os +import shutil import subprocess import sys from typing import List @@ -101,6 +102,19 @@ def run_isort(): ).returncode +def run_update_manpages() -> int: + """Returns the exit code from release/update-manpages.""" + if not shutil.which("help2mafn"): + print("update-manpages: help2man not found; skipping test") + return 0 + + return subprocess.run( + [sys.executable, "release/update-manpages", "--check"], + check=False, + cwd=ROOT_DIR, + ).returncode + + def main(argv): """The main entry.""" checks = ( @@ -109,6 +123,7 @@ def main(argv): run_black, run_flake8, run_isort, + run_update_manpages, ) # Run all the tests all the time to get full feedback. Don't exit on the # first error as that makes it more difficult to iterate in the CQ. -- cgit v1.2.3-54-g00ecf