From: Jacob Lifshay Date: Thu, 25 Aug 2022 09:33:52 +0000 (-0700) Subject: skip gdb tests when gdb isn't found X-Git-Tag: sv_maxu_works-initial~100 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6c7288ffc318e6b3b9e89ba4ed03a42a088ace80;p=openpower-isa.git skip gdb tests when gdb isn't found --- diff --git a/src/openpower/simulator/qemu.py b/src/openpower/simulator/qemu.py index af734e33..c60d6384 100644 --- a/src/openpower/simulator/qemu.py +++ b/src/openpower/simulator/qemu.py @@ -1,3 +1,4 @@ +import unittest from pygdbmi.gdbcontroller import GdbController import subprocess import tempfile @@ -47,7 +48,14 @@ class QemuController: self.qemu_popen = subprocess.Popen(args, stdout=subprocess.PIPE, stdin=subprocess.PIPE) - self.gdb = GdbController(gdb_path='powerpc64-linux-gnu-gdb') + try: + self.gdb = GdbController(gdb_path='powerpc64-linux-gnu-gdb') + except ValueError as e: + if len(e.args) == 1 and isinstance(e.args[0], str) and \ + e.args[0].startswith("gdb executable could not be resolved"): + raise unittest.SkipTest( + "powerpc64-linux-gnu-gdb not found") from e + raise self.bigendian = bigendian self._reg_cache = {}