xref: /llvm-project/llvm/test/Other/ChangePrinters/DotCfg/lit.local.cfg (revision f84bac329ba6c9f0c022bcf77237e912362e247a)
1import os
2import subprocess
3
4
5def have_needed_dot_support():
6    if not os.path.exists("/usr/bin/dot"):
7        return False
8
9    try:
10        ld_cmd = subprocess.Popen(
11            ["/usr/bin/dot", "-T?"], stdout=subprocess.PIPE, stderr=subprocess.PIPE
12        )
13        ld_err = ld_cmd.stderr.read().decode()
14        ld_cmd.wait()
15    except:
16        return False
17
18    return "pdf" in ld_err
19
20
21if not have_needed_dot_support():
22    config.unsupported = True
23