Summary:
Expand the testing for whether the lit tests for print-changed=dot-cfg
are supported to include checking whether dot supports pdf output.
Author: Jamie Schmeiser <schmeise@ca.ibm.com>
Reviewed By: hvdijk (Harald van Dijk)
Differential Revision: https://reviews.llvm.org/D113187
import os
+import subprocess
-if not os.path.exists('/usr/bin/dot'):
+def have_needed_dot_support():
+ if not os.path.exists('/usr/bin/dot'):
+ return False
+
+ try:
+ ld_cmd = subprocess.Popen(['/usr/bin/dot', '-T?'],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ ld_err = ld_cmd.stderr.read().decode()
+ ld_cmd.wait()
+ except:
+ return False
+
+ return 'pdf' in ld_err
+
+if not have_needed_dot_support():
config.unsupported = True