import pytest
import platform
+import shutil
import signal
import subprocess
import os
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
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
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
import platform
import pytest
import re
+import shutil
import subprocess
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':
)
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
- )