Skip to content

Commit

Permalink
tests/cmd-args: skip testing wrapper scripts if dot is missing
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mchalupa committed Mar 9, 2022
1 parent 6434e57 commit 3e4b72c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/cmd-args.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 3e4b72c

Please sign in to comment.