From 6c7288ffc318e6b3b9e89ba4ed03a42a088ace80 Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Thu, 25 Aug 2022 02:33:52 -0700 Subject: [PATCH] skip gdb tests when gdb isn't found --- src/openpower/simulator/qemu.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 = {} -- 2.30.2