[llvm] 2a1bf9e - Expand testing of necessary features for print-changed=dot-cfg.

Jamie Schmeiser via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 2 05:16:46 PST 2021


Author: Jamie Schmeiser
Date: 2021-12-02T08:16:18-05:00
New Revision: 2a1bf9e0cf78a0582b62de8e78375394bb8f6711

URL: https://github.com/llvm/llvm-project/commit/2a1bf9e0cf78a0582b62de8e78375394bb8f6711
DIFF: https://github.com/llvm/llvm-project/commit/2a1bf9e0cf78a0582b62de8e78375394bb8f6711.diff

LOG: Expand testing of necessary features for print-changed=dot-cfg.

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 at ca.ibm.com>
Reviewed By: hvdijk (Harald van Dijk)
Differential Revision: https://reviews.llvm.org/D113187

Added: 
    

Modified: 
    llvm/test/Other/ChangePrinters/DotCfg/lit.local.cfg

Removed: 
    


################################################################################
diff  --git a/llvm/test/Other/ChangePrinters/DotCfg/lit.local.cfg b/llvm/test/Other/ChangePrinters/DotCfg/lit.local.cfg
index a739faf919daa..73913bb97a72a 100644
--- a/llvm/test/Other/ChangePrinters/DotCfg/lit.local.cfg
+++ b/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


        


More information about the llvm-commits mailing list