[LLVMdev] Win32 COFF Support

Michael Spencer bigcheesegs at gmail.com
Mon Jun 14 14:48:11 PDT 2010


On Mon, Jun 14, 2010 at 5:15 PM, Nathan Jeffords
<blunted2night at gmail.com> wrote:
> I have not, I was going to look at it tonight. I tried an earlier version
> and got stuck trying to figure out how to invoke lit.py. Looking over
> 'http://llvm.org/docs/TestingGuide.html' its still clear to be how to do
> that.
> In my setup, I have an out of tree build. Could you give be an example of
> the command line to invoke the tests?
> -Nathan

I also do an out of tree build. You should be able to run it from
inside of visual studio by just building the check project. I ripped
out the command from the visual studio project because I wanted to be
able to run tests on single files. All of the paths are absolute, but
here's my script:

@echo off
sed -e s#@LLVM_SOURCE_DIR@#C:/Users/Michael/Projects/llvm# ^
    -e s#@LLVM_BINARY_DIR@#C:/Users/Michael/Projects/llvm-build/VS9# ^
    -e s#@LLVM_TOOLS_DIR@#C:/Users/Michael/Projects/llvm-build/VS9/bin/Debug# ^
    -e s#@LLVMGCCDIR@## ^
    -e s#@PYTHON_EXECUTABLE@#C:/Python26/python.exe# ^
    C:/Users/Michael/Projects/llvm/test/lit.site.cfg.in ^
    > C:/Users/Michael/Projects/llvm-build/VS9/test/lit.site.cfg

sed -e s#@LLVM_SOURCE_DIR@#C:/Users/Michael/Projects/llvm# ^
    -e s#@LLVM_BINARY_DIR@#C:/Users/Michael/Projects/llvm-build/VS9# ^
    -e s#@LLVM_TOOLS_DIR@#C:/Users/Michael/Projects/llvm-build/VS9/bin/Debug# ^
    -e s#@LLVMGCCDIR@## ^
    -e s#@LLVM_BUILD_MODE@#Debug# ^
    -e s#@ENABLE_SHARED@#0# ^
    -e s#@SHLIBPATH_VAR@#LD_LIBRARY_PATH# ^
    C:/Users/Michael/Projects/llvm/test/Unit/lit.site.cfg.in ^
    > C:/Users/Michael/Projects/llvm-build/VS9/test/Unit/lit.site.cfg

"C:\Python26\python.exe" C:/Users/Michael/Projects/llvm/utils/lit/lit.py ^
                         --param
llvm_site_config=C:/Users/Michael/Projects/llvm-build/VS9/test/lit.site.cfg
^
                         --param
llvm_unit_site_config=C:/Users/Michael/Projects/llvm-build/VS9/test/Unit/lit.site.cfg
^
                         -sv ^
                         --no-progress-bar ^
                         C:/Users/Michael/Projects/llvm-build/VS9/test/%1"

I run it from my llvm-build/VS9 directory which is the root of my out
of source build.

You can generate the exact same thing by opening up
build-dir/test/check.vcproj in a text editor and then go to the bottom
and grab the CommandLine attribute off one of the tools and replace
$(OutDir) with either Debug or Release. This will have all the correct
paths for your system.

Once I have this, I just run:

C:\Users\Michael\Projects\llvm-build\VS9>run-tests.bat MC/COFF/basic-coff.ll

I wonder if something like this should be added to CMake for MSVC
generators. Using visual studio to run tests is rather useless unless
you want to run all of them.

- Michael Spencer



More information about the llvm-dev mailing list