Help with running clang unit tests on Windows?

Can someone help with running tests on Windows?

Here’s a session running from a Windows command shell:

d:\Clang\llvmnewmod\tools\clang\test\Lexer>which bash

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

d:\Clang\llvmnewmod\tools\clang\test\Lexer>which python

C:\Tools\Python27\python.EXE

d:\Clang\llvmnewmod\tools\clang\test\Lexer>echo %LLVMDIR%

d:\Clang\llvmnewmod

d:\Clang\llvmnewmod\tools\clang\test\Lexer>clangtest wchar.c

d:\Clang\llvmnewmod\tools\clang\test\Lexer>python.exe d:\Clang\llvmnewmod\utils\lit\lit.py --param clang_site_config=d:\Clang\llvmnewmod\tools\clang\test\lit.site.cfg --param clang_unit_site_config=d:\Clang\llvmnewmod\tools\clang\test\Unit\lit.site.cfg --param build_config=Debug --param build_mode=Win32 -sv --noprogress-bar wchar.c

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

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

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

ck: Traceback (most recent call last):

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

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

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

getClangBuiltinIncludeDir(config.clang))) )

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

stdout=subprocess.PIPE)

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

I believe this script worked for me a couple of years ago.

Here’s a sesson running from bash in a Windows command shell:

bash-3.1$ which bash

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

bash-3.1$ which python

c:\Tools\Python27\python.EXE

bash-3.1$ echo $LLVMDIR

/d/Clang/llvmnewmodbash-3.1$ pwd

/d/Clang/llvmnewmod/tools/clang/test/Lexer

bash-3.1$ python.exe $LLVMDIR/utils/lit/lit.py --param clang_site_config=$LLVMDIR/tools/clang/test/lit.site.cfg --param

clang_unit_site_config=$LLVMDIR/tools/clang/test/Unit/lit.site.cfg --param build_config=Debug --param build_mode=Win32

-sv --no-progress-bar wchar.c

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

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

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

ck: Traceback (most recent call last):

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

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

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

getClangBuiltinIncludeDir(config.clang))) )

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

stdout=subprocess.PIPE)

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

bash-3.1$

Any idea what’s wrong?

Thanks.

-John

Any idea what’s wrong?

Missing gnuwin32 maybe?

Cheers,
Rafael

Are you trying to run unit tests (gtest) or tests from the testsuite (test subdirectory)? I recently noticed that paths changed on windows, what used to be build-dir\bin\Debug is now build-dir\Debug\bin

I’m trying to run the test suite tests under tools/clang/test. I have GnuWin32 installed, and what should be the right path to the clang bin:

d:\Clang\llvmnewmod\tools\clang\test\Lexer>which grep

c:\Tools\GnuWin32\bin\grep.EXE

d:\Clang\llvmnewmod\tools\clang\test\Lexer>which clang

d:\Clang\llvmnewmod\debug\bin\clang.EXE

It’s been a while since I updated GnuWin32 though. I’t try that and perhaps update python too.

-John