]> granicus.if.org Git - graphviz/commitdiff
remove fine grained test skip logic and now depend on tool existence
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 25 Oct 2020 04:03:04 +0000 (21:03 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 27 Oct 2020 00:19:59 +0000 (17:19 -0700)
The test suite should now pass on developers' machines, regardless of which
build configuration or subset of tools they use. Closes #1851.

rtest/test_regression.py
rtest/test_tools.py

index 28b5f251c5b0108d547d5beb20e9c47361ec04d2..7d1f96c36fbce90cc172de77bdd33e21aa09d387 100644 (file)
@@ -1,5 +1,6 @@
 import pytest
 import platform
+import shutil
 import signal
 import subprocess
 import os
@@ -208,12 +209,7 @@ def test_1449():
 
     assert stderr.strip() == '', 'SVG color scheme use caused warnings'
 
-# FIXME: Remove skip when
-# https://gitlab.com/graphviz/graphviz/-/issues/1753 is fixed
-@pytest.mark.skipif(
-    os.environ.get('build_system') == 'cmake',
-    reason='The Windows "CMake" installer does not install gvpr (#1753)'
-)
+@pytest.mark.skipif(shutil.which('gvpr') is None, reason='GVPR not available')
 def test_1594():
     '''
     GVPR should give accurate line numbers in error messages
@@ -331,15 +327,7 @@ def test_1783():
 
     assert ret != -signal.SIGSEGV, 'Graphviz segfaulted'
 
-# FIXME: Remove skip when
-# https://gitlab.com/graphviz/graphviz/-/issues/1857 and
-# https://gitlab.com/graphviz/graphviz/-/issues/1816 is fixed
-@pytest.mark.skipif(
-    os.environ.get('build_system') == 'cmake' or
-    platform.system() == 'Darwin' or
-    platform.system() == 'Windows',
-    reason='gvedit is not built for macOS or Windows or using CMake (#1816 & #1857)'
-)
+@pytest.mark.skipif(shutil.which('gvedit') is None, reason='Gvedit not available')
 def test_1813():
     '''
     gvedit -? should show usage
@@ -354,18 +342,7 @@ def test_1813():
 
     assert 'Usage' in output, 'gvedit -? did not show usage'
 
-# FIXME: Remove skip when
-# https://gitlab.com/graphviz/graphviz/-/issues/1753 is fixed
-@pytest.mark.skipif(
-    os.environ.get('build_system') == 'cmake',
-    reason='The Windows "CMake" installer does not install lefty (#1753)'
-)
-# FIXME: Remove skip when
-# https://gitlab.com/graphviz/graphviz/-/issues/1858 is fixed
-@pytest.mark.skipif(
-    platform.system() == 'Darwin',
-    reason='lefty is not built on macOS (#1858)'
-)
+@pytest.mark.skipif(shutil.which('lefty') is None, reason='Lefty not available')
 def test_1818():
     '''
     lefty -? should show usage
index ba6d931aa79a3308a4ab25f2f1940e7b5553f8c8..428ac75beb5654fc0ea81fda142b7f54ef2408cc 100644 (file)
@@ -2,6 +2,7 @@ import os
 import platform
 import pytest
 import re
+import shutil
 import subprocess
 import shutil
 
@@ -52,111 +53,14 @@ import shutil
 ])
 def test_tools(tool):
 
-    tools_not_built_with_cmake = [
-        'circo',
-        'cluster',
-        'diffimg',
-        'dot2gxl',
-        'dot_builtins',
-        'dotty',
-        'edgepaint',
-        'fdp',
-        'gv2gml',
-        'gv2gxl',
-        'gvedit',
-        'gvmap',
-        'gvmap.sh',
-        'gvpr',
-        'gxl2dot',
-        'lefty',
-        'lneato',
-        'mingle',
-        'neato',
-        'osage',
-        'patchwork',
-        'prune',
-        'sfdp',
-        'smyrna',
-        'twopi',
-        'vimdot',
-    ]
-
-    tools_not_built_with_msbuild = [
-        'circo',
-        'cluster',
-        'dot2gxl',
-        'dot_builtins',
-        'fdp',
-        'gv2gxl',
-        'gvedit',
-        'gvmap.sh',
-        'gxl2dot',
-        'neato',
-        'osage',
-        'patchwork',
-        'sfdp',
-        'twopi',
-        'vimdot',
-    ]
-
-    tools_not_built_with_autotools_on_macos = [
-        'dotty',
-        'gvedit',
-        'lefty',
-        'lneato',
-        'mingle',
-        'smyrna',
-        'vimdot',
-    ]
-
-    os_id = os.getenv('OS_ID')
+    if shutil.which(tool) is None:
+      pytest.skip('{} not available'.format(tool))
 
     # FIXME: Remove skip when
     # https://gitlab.com/graphviz/graphviz/-/issues/1829 is fixed
     if tool == 'smyrna' and os.getenv('build_system') == 'msbuild':
       pytest.skip('smyrna fails to start because of missing DLLs in Windows MSBuild builds (#1829)')
 
-    # 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
-    # https://gitlab.com/graphviz/graphviz/-/issues/1753 and
-    # 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
-    # https://gitlab.com/graphviz/graphviz/-/issues/1854 is fixed
-    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
     # https://gitlab.com/graphviz/graphviz/-/issues/1838 is fixed
     if tool == 'gvpack' and platform.system() != 'Windows':
@@ -186,11 +90,3 @@ 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
-    )