help running clang tests on Windows

I’ve been unable to run the clang tests on Windows for years. Usually I go to a Linux VM to do it. Could someone help me get it to work on Windows?

I right-click build on “check-clang” in VS. The relevant tail messages:

56> Running the Clang regression tests

56> lit.py: LitConfig.py:94: note: Unable to find ‘bash.exe’.

56> lit.py: lit.cfg:200: note: using clang: ‘d:/Clang/llvm/bin/Debug/clang.exe’

56> lit.py: TestingConfig.py:108: fatal: unable to parse config file ‘D:/Clang/llvm/tools/clang/test/lit.cfg’, traceback: Traceback (most recent call last):

56> File “D:\Clang\llvm\utils\lit\lit\TestingConfig.py”, line 95, in load_from_path

56> exec(compile(data, path, ‘exec’), cfg_globals, None)

56> File “D:/Clang/llvm/tools/clang/test/lit.cfg”, line 264, in

56> getClangBuiltinIncludeDir(config.clang))) )

56> File “D:/Clang/llvm/tools/clang/test/lit.cfg”, line 226, in getClangBuiltinIncludeDir

56> env=config.environment)

56> File “C:\Tools\Python27\lib\subprocess.py”, line 679, in init

56> errread, errwrite)

56> File “C:\Tools\Python27\lib\subprocess.py”, line 896, in _execute_child

56> startupinfo)

56> WindowsError: [Error 2] The system cannot find the file specified

If I run it from a cmd window:

d:\Clang\llvm\tools\clang\test>python d:\Clang\llvm\utils\lit\lit.py -sv --param=build_mode=Win32 --param=build_config=D

ebug --param=clang_site_config=d:\Clang\llvm\tools\clang\test\lit.site.cfg d:\Clang\llvm\tools\clang\test

lit.py: LitConfig.py:94: note: Unable to find ‘bash.exe’.

lit.py: lit.cfg:200: note: using clang: ‘d:/Clang/llvm/bin/Debug/clang.exe’

lit.py: TestingConfig.py:108: fatal: unable to parse config file ‘D:/Clang/llvm/tools/clang/test/lit.cfg’, traceback: Tr

aceback (most recent call last):

File “d:\Clang\llvm\utils\lit\lit\TestingConfig.py”, line 95, in load_from_path

exec(compile(data, path, ‘exec’), cfg_globals, None)

File “D:/Clang/llvm/tools/clang/test/lit.cfg”, line 264, in

getClangBuiltinIncludeDir(config.clang))) )

File “D:/Clang/llvm/tools/clang/test/lit.cfg”, line 226, in getClangBuiltinIncludeDir

env=config.environment)

File “C:\Tools\Python27\lib\subprocess.py”, line 679, in init

errread, errwrite)

File “C:\Tools\Python27\lib\subprocess.py”, line 896, in _execute_child

startupinfo)

WindowsError: [Error 2] The system cannot find the file specified

Some paths:

d:\Clang\llvm\tools\clang\test>where bash

C:\msys\1.0\bin\bash.exe

C:\Program Files (x86)\Git\bin\bash.exe

d:\Clang\llvm\tools\clang\test>where python

C:\Tools\Python27\python.exe

d:\Clang\llvm\tools\clang\test>echo %PATH%

c:\tools\bin;C:\gnuwin32\bin;D:\usr\local\cell\host-win32\ppu\bin;D:\usr\local\cell\host-win32\sn\bin;D:\usr\local\cell\

host-win32\bin;D:\usr\local\cell\host-win32\Cg\bin;C:\Windows\System32;D:\usr\local\psp2\PSP2\Tools\Target Manager Serve

r\bin;D:\usr\local\psp2\PSP2\Tools\Publishing Tools\bin;C:\Program Files (x86)\RSA SecurID Token Common;C:\msys\1.0\bin;

C:\Program Files (x86)\Java\jre6\bin;C:\Program Files (x86)\SN Systems\Common\bin;C:\Program Files (x86)\SN Systems\PSP\

bin;C:\Program Files (x86)\SN Systems\PS3\bin;C:\Program Files (x86)\CollabNet\Subversion Client;C:\Program Files (x86)\

NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPower

Shell\v1.0;C:\Program Files\Intel\DMIX;C:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn;c:\Tools\bin;C:\Progr

am Files (x86)\CMake 2.8\bin;C:\Tools\Python27;D:\usr\local\psp\gcc-2.12.2\bin;C:\Program Files (x86)\doxygen\bin;%SCE_P

SP2_SDK_DIR%\sdk\host_tools\build\bin;d:\Clang\llvm\debug\bin;D:\Sony\dtrace\internal\deci\src\application\dtrace\build\

Debug\dtrace_tmapi;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Git\cmd;C:\Program Files (x86)\Git\

bin;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0;C:\Program Files\Microsoft Network Monitor 3;C:\Pr

ogram Files\Microsoft\Web Platform Installer;C:\Program Files\Microsoft SQL Server\110\Tools\Binn;c:\tools\Python27\Sc

ripts;C:\Program Files (x86)\HTML Help Workshop;C:\msys\1.0\bin;C:\MinGW\bin;c:\gunwin32\bin;C:\Program Files (x86)\Micr

osoft Visual Studio 11.0\VC\bin;C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE;D:\usr\local\psp2\Common

\SceVSI-VS12\bin;D:\usr\local\psp2\Common\SceVSI-VS11\bin;D:\usr\local\psp2\Common\SceVSI\bin;D:\usr\local\psp2\ORBIS SD

Ks\1.750_mod\host_tools\bin;D:\usr\local\psp2\ORBIS\Tools\Target Manager Server\bin;D:\usr\local\psp2\ORBIS\Tools\Publis

hing Tools\bin;

Please CC john_thompson@playstation.sony.com

Thanks.

-John

Dear John:

I’m able to run the tests in Windows 8.1 x64 with Visual Studio 2013 v12. The only thing I can think of there is that there is a missing program somewhere. I didn’t install bash, but I did install GnuWin32, which I see listed in your path. I assume that you have an up-to-date installation thereof? I’ve also run into problems in the past not having the right python version. I have 2.7.8, so I don’t see that as a problem. The only other thing that I see in your message is a missing GnuWin32 utility. I don’t know how to read Python error messages very well, so that’s about as far as I can help you. All I can say at this point is, works for me. :frowning:

Well, okay, maybe I see one other thing. Usually gnuwin32/bin should be at the end of your path, I think, not at the beginning, so as not to clobber windows utilities, but that’s probably not your issue either.

Hi

From c:\llvm the command line I run:

python msvc/RelWithDebInfo/bin/llvm-lit.py tools/clang/test -s

where c:\llvm\msvc is the build directory. MSYS 1 utils are on PATH, I don’t think you need GnuWin32 in addition to MSYS. Pyhton is 2.7.8.

One more thing, I think you have both GIT MSYS and original MSYS on path, may cause problems.

Yaron