From 3e4b72cb6f471d12782a8e412a22ee14f71764be Mon Sep 17 00:00:00 2001 From: Marek Chalupa Date: Thu, 10 Feb 2022 16:47:18 +0100 Subject: [PATCH] tests/cmd-args: skip testing wrapper scripts if dot is missing The wrapper scripts use dot. Skip testing these if dot is missing, because the tests would fail. We could have sovled this by checking for dot in cmake, but that way we would skip the whole test if dot is missing. This way we skip just testing the wrappers. --- tests/cmd-args.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/cmd-args.py b/tests/cmd-args.py index ab35c9071..dd50a4254 100755 --- a/tests/cmd-args.py +++ b/tests/cmd-args.py @@ -2,13 +2,19 @@ from os import listdir, access, X_OK from subprocess import DEVNULL, PIPE, Popen +from shutil import which failed = False +no_dot = which('dot') is None def is_exe(f): return access(f, X_OK) for f in filter(lambda x: x.startswith('llvm') and is_exe(x), listdir()): + # skip wrapper scripts if 'dot' is missing as they depend on it + if no_dot and f in ('llvmdda-dump', 'llvmdg-show'): + print(f"{f}\u001b[33m SKIP (needs 'dot')\u001b[0m") + continue print(f, end='') p = Popen(['./' + f, '--version'], stdout=DEVNULL, stderr=PIPE) out = p.communicate()[1].decode()