mirror of
https://github.com/EttusResearch/uhd.git
synced 2026-10-25 17:36:10 +00:00
tests: fbs test: Fix issues around missing git
- update_fbs.py would use git directly, instead of the requested git executable - There are other corner cases for the git executable detection, which are now all captured under a more general exception type Credit to Christopher Friedt for pointing out the original issue.
This commit is contained in:
parent
db0d2dddcc
commit
0d273bfe0c
@ -26,7 +26,8 @@ class VerifyFBSTest(unittest.TestCase):
|
||||
spec.loader.exec_module(update_fbs)
|
||||
try:
|
||||
git_exe = update_fbs.find_executable("git")
|
||||
except RuntimeError:
|
||||
# pylint: disable=broad-except
|
||||
except Exception:
|
||||
# No git, no test. We pass b/c git is not a UHD dependency.
|
||||
return
|
||||
sys.argv.append('--verify')
|
||||
|
||||
@ -108,9 +108,12 @@ def verify(git_exe, uhd_path=None):
|
||||
accompanied by a change of the header. It also detects manual
|
||||
changes to the generated header files.
|
||||
"""
|
||||
if not git_exe:
|
||||
print("Cannot verify schema files (no git found), assuming pass")
|
||||
return True
|
||||
try:
|
||||
subprocess.check_output(("git", "status"), stderr=subprocess.STDOUT)
|
||||
except subprocess.CalledProcessError as error:
|
||||
subprocess.check_output((git_exe, "status"), stderr=subprocess.STDOUT)
|
||||
except subprocess.CalledProcessError:
|
||||
print("Cannot verify schema files (not a git repo), assuming pass")
|
||||
return True
|
||||
try:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user