]> granicus.if.org Git - graphviz/commitdiff
Add check that expected missing tool doesn't exist to tools test
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Tue, 20 Oct 2020 15:44:20 +0000 (17:44 +0200)
committerMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Sun, 25 Oct 2020 08:58:36 +0000 (09:58 +0100)
rtest/test_tools.py

index 8c0507a65ec66e8ea477e80b22922425eae8c38e..ba6d931aa79a3308a4ab25f2f1940e7b5553f8c8 100644 (file)
@@ -3,6 +3,7 @@ import platform
 import pytest
 import re
 import subprocess
+import shutil
 
 @pytest.mark.parametrize('tool', [
     'acyclic',
@@ -118,16 +119,19 @@ def test_tools(tool):
     # FIXME: Remove skip when
     # https://gitlab.com/graphviz/graphviz/-/issues/1834 is fixed
     if tool == 'smyrna' and os_id == 'centos':
+      check_that_tool_does_not_exist(tool, os_id)
       pytest.skip('smyrna is not built for Centos (#1834)')
 
     # FIXME: Remove skip when
     # https://gitlab.com/graphviz/graphviz/-/issues/1835 is fixed
     if tool == 'mingle' and os_id in ['ubuntu', 'centos']:
+      check_that_tool_does_not_exist(tool, os_id)
       pytest.skip('mingle is not built for ' + os_id + ' (#1835)')
 
     # FIXME: Remove skip when
     # https://gitlab.com/graphviz/graphviz/-/issues/1839 is fixed
     if tool == 'dot_builtins' and os_id in ['centos', 'fedora']:
+      check_that_tool_does_not_exist(tool, os_id)
       pytest.skip('dot_builtins is not installed for ' + os_id + ' (#1839)')
 
     # FIXME: Remove skip when
@@ -135,12 +139,14 @@ def test_tools(tool):
     # https://gitlab.com/graphviz/graphviz/-/issues/1836 is fixed
     if os.getenv('build_system') == 'cmake':
       if tool in tools_not_built_with_cmake:
+        check_that_tool_does_not_exist(tool, os_id)
         pytest.skip(tool + ' is not built with CMake (#1753 & #1836)')
 
     # FIXME: Remove skip when
     # https://gitlab.com/graphviz/graphviz/-/issues/1837 is fixed
     if os.getenv('build_system') == 'msbuild':
       if tool in tools_not_built_with_msbuild:
+        check_that_tool_does_not_exist(tool, os_id)
         pytest.skip(tool + ' is not built with MSBuild (#1837)')
 
     # FIXME: Remove skip when
@@ -148,6 +154,7 @@ def test_tools(tool):
     if os.getenv('build_system') == 'autotools':
       if platform.system() == 'Darwin':
         if tool in tools_not_built_with_autotools_on_macos:
+          check_that_tool_does_not_exist(tool, os_id)
           pytest.skip(tool + ' is not built with autotools on macOS (#1854)')
 
     # FIXME: Remove skip when
@@ -179,3 +186,11 @@ def test_tools(tool):
     )
 
     assert returncode != 0, tool + ' accepted unsupported option -$'
+
+def check_that_tool_does_not_exist(tool, os_id):
+    assert shutil.which(tool) is None, '{} has been resurrected in the {} ' \
+    'build on {}. Please remove skip.'.format(
+        tool,
+        os.getenv('build_system'),
+        os_id
+    )