[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 Dec 2 05:16:50 PST 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rG2a1bf9e0cf78: Expand testing of necessary features for print-changed=dot-cfg. (authored by jamieschmeiser).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D113187/new/

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.391283.patch
Type: text/x-patch
Size: 782 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211202/1cb986d7/attachment.bin>


More information about the llvm-commits mailing list