From: Magnus Jacobsson Date: Tue, 20 Oct 2020 15:44:20 +0000 (+0200) Subject: Add check that expected missing tool doesn't exist to tools test X-Git-Tag: 2.46.0~20^2^2~13^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bd3abe9fde610e4e419fea203012788a49157639;p=graphviz Add check that expected missing tool doesn't exist to tools test --- diff --git a/rtest/test_tools.py b/rtest/test_tools.py index 8c0507a65..ba6d931aa 100644 --- a/rtest/test_tools.py +++ b/rtest/test_tools.py @@ -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 + )