]> granicus.if.org Git - graphviz/commitdiff
Add check of usage to tools test
authorMagnus Jacobsson <magnus.jacobsson@berotec.se>
Thu, 24 Sep 2020 16:18:59 +0000 (18:18 +0200)
committerMagnus Jacobsson <magnus.jacobsson@berotec.se>
Fri, 2 Oct 2020 12:50:35 +0000 (14:50 +0200)
rtest/test_tools.py

index 780785771c0577c21c1691436b295218a6628e15..8155ccf95b291a0b4ff5f103b4d303058a74210f 100644 (file)
@@ -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'