]> granicus.if.org Git - graphviz/commitdiff
CI: [nfc] abstract check for CMake build system
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 9 Feb 2022 12:01:03 +0000 (23:01 +1100)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 15 Feb 2022 20:38:41 +0000 (07:38 +1100)
ci/tests.py

index cd6626b99953d64564cfd0272efbe4d9088629db..1d2d9df6da6298eca914055f843a744575a93caf 100644 (file)
@@ -13,6 +13,12 @@ import pytest
 sys.path.append(os.path.join(os.path.dirname(__file__), "../rtest"))
 from gvtest import dot #pylint: disable=C0413
 
+def is_cmake() -> bool:
+  """
+  is the current CI environment a CMake job?
+  """
+  return os.getenv("build_system") == "cmake"
+
 @pytest.mark.parametrize("binary", [
   "acyclic",
   "bcomps",
@@ -143,7 +149,7 @@ def check_that_tool_does_not_exist(tool, os_id):
   assert shutil.which(tool) is None, f"{tool} has been resurrected in the " \
     f'{os.getenv("build_system")} build on {os_id}. Please remove skip.'
 
-@pytest.mark.xfail(strict=os.getenv("build_system") == "cmake") # FIXME
+@pytest.mark.xfail(strict=is_cmake()) # FIXME
 def test_1786():
   """
   png:gd format should be supported