[llvm] r348058 - [lit] Add a generic build script with a lit substitution.

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 30 16:22:21 PST 2018


Author: zturner
Date: Fri Nov 30 16:22:21 2018
New Revision: 348058

URL: http://llvm.org/viewvc/llvm-project?rev=348058&view=rev
Log:
[lit] Add a generic build script with a lit substitution.

This adds a script called build.py as well as a lit substitution
called %build that we can use to invoke it.  The idea is that
this allows a lit test to build test inferiors without having
to worry about architecture / platform specific differences,
command line syntax, finding / configurationg a proper toolchain,
and other issues.  They can simply write something like:

%build --arch=32 -o %t.exe %p/Inputs/foo.cpp

and it will just work.  This paves the way for being able to
run lit tests with multiple configurations, platforms, and
compilers with a single test.

Differential Revision: https://reviews.llvm.org/D54914

Modified:
    llvm/trunk/utils/lit/lit/llvm/config.py

Modified: llvm/trunk/utils/lit/lit/llvm/config.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/llvm/config.py?rev=348058&r1=348057&r2=348058&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/llvm/config.py (original)
+++ llvm/trunk/utils/lit/lit/llvm/config.py Fri Nov 30 16:22:21 2018
@@ -33,6 +33,8 @@ class LLVMConfig(object):
                                                 ['cmp.exe', 'grep.exe', 'sed.exe'])
             if path is not None:
                 self.with_environment('PATH', path, append_path=True)
+            # Many tools behave strangely if these environment variables aren't set.
+            self.with_system_environment(['SystemDrive', 'SystemRoot', 'TEMP', 'TMP'])
             self.use_lit_shell = True
 
         # Choose between lit's internal shell pipeline runner and a real shell.  If




More information about the llvm-commits mailing list