[llvm-commits] [llvm] r126383 - /llvm/trunk/test/lit.cfg

NAKAMURA Takumi geek4civic at gmail.com
Thu Feb 24 04:34:34 PST 2011


Author: chapuni
Date: Thu Feb 24 06:34:34 2011
New Revision: 126383

URL: http://llvm.org/viewvc/llvm-project?rev=126383&view=rev
Log:
test/lit.cfg: Add PATHEXT to 'substitution', to recognize tools on Windows hosts. Thanks to Danil Malyshev!

Some tests on Windows use the "not" utility and fail with an error "program not executable". The reason for this error is that the name of the executable file sended to the "not" without the extension.

Modified:
    llvm/trunk/test/lit.cfg

Modified: llvm/trunk/test/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/lit.cfg?rev=126383&r1=126382&r2=126383&view=diff
==============================================================================
--- llvm/trunk/test/lit.cfg (original)
+++ llvm/trunk/test/lit.cfg Thu Feb 24 06:34:34 2011
@@ -175,6 +175,10 @@
 # (llvm_tools_dir in lit parlance).
                 # Don't match 'bugpoint-' or 'clang-'.
                                         # Don't match '/clang'.
+if os.pathsep == ';':
+    pathext = os.environ.get('PATHEXT', '').split(';')
+else:
+    pathext = ['']
 for pattern in [r"\bbugpoint\b(?!-)",   r"(?<!/)\bclang\b(?!-)",
                 r"\bgold\b",
                 r"\bllc\b",             r"\blli\b",
@@ -204,6 +208,11 @@
     substitution = re.sub(r"^(\\)?((\| )?)\W+b([0-9A-Za-z-_]+)\\b\W*$",
                           r"\2" + llvm_tools_dir + "/" + r"\4",
                           pattern)
+    for ext in pathext:
+        substitution_ext = substitution + ext
+        if os.path.exists(substitution_ext):
+             substitution = substitution_ext
+             break
     config.substitutions.append((pattern, substitution))
 
 excludes = []





More information about the llvm-commits mailing list