[PATCH] D113187: Improve unsupported lit test config for print-changed=dot-cfg
Jamie Schmeiser via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 4 07:10:52 PDT 2021
jamieschmeiser created this revision.
jamieschmeiser added a reviewer: hvdijk.
Herald added a subscriber: ormris.
jamieschmeiser requested review of this revision.
Herald added a project: LLVM.
Expand testing of necessary features for print-changed=dot-cfg.
Expand the testing for whether the lit tests for print-changed=dot-cfg
are supported to include checking whether dot supports pdf output.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D113187
Files:
llvm/test/Other/ChangePrinters/DotCfg/lit.local.cfg
Index: llvm/test/Other/ChangePrinters/DotCfg/lit.local.cfg
===================================================================
--- llvm/test/Other/ChangePrinters/DotCfg/lit.local.cfg
+++ llvm/test/Other/ChangePrinters/DotCfg/lit.local.cfg
@@ -1,4 +1,20 @@
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113187.384740.patch
Type: text/x-patch
Size: 782 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211104/c5baf512/attachment.bin>
More information about the llvm-commits
mailing list