From: Magnus Jacobsson Date: Thu, 24 Sep 2020 16:18:59 +0000 (+0200) Subject: Add check of usage to tools test X-Git-Tag: 2.46.0~20^2^2~55^2~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c73906cc096bc67eebbedfa5d2742bd700405e76;p=graphviz Add check of usage to tools test --- diff --git a/rtest/test_tools.py b/rtest/test_tools.py index 780785771..8155ccf95 100644 --- a/rtest/test_tools.py +++ b/rtest/test_tools.py @@ -1,5 +1,6 @@ import os import pytest +import re import subprocess @pytest.mark.parametrize('tool', [ @@ -73,7 +74,11 @@ def test_tools(tool): if tool in tools_not_built_with_cmake: pytest.skip(tool + ' is not built with CMake (#1753 & #1836)') - subprocess.check_call( + output = subprocess.check_output( [tool, '-?'], stdin=subprocess.DEVNULL, + stderr=subprocess.STDOUT, + universal_newlines=True, ) + assert re.match('usage', output, flags=re.IGNORECASE) is not None, \ + tool +' -? did not show usage'