[cfe-dev] windows testing - lit.py failure

David Neto dneto.llvm at gmail.com
Fri Apr 8 12:43:34 PDT 2011


On Tue, Mar 15, 2011 at 9:27 PM, Óscar Fuentes <ofv at wanadoo.es> wrote:
>
> As for the python exception thrown from lit.cfg, I suggest filing a bug
> report (or, better, fixing the bug yourself ;-)
>
> [snip]
> _______________________________________________

I just came across this issue myself.

To recap:
- if you use Cmake to generate Nmake makefiles  (-G "NMake Makefiles")
- and you're using a Microsoft compiler (maybe this is not essential)
- then lit.py fails on startup

This is the error:

[100%] Running LLVM regression tests
Traceback (most recent call last):
  File "d:/llvm/llvm/utils/lit/lit.py", line 5, in <module>
    lit.main()
  File "d:\llvm\llvm\utils\lit\lit\main.py", line 515, in main
    testSuiteCache, localConfigCache)[1])
  File "d:\llvm\llvm\utils\lit\lit\main.py", line 230, in getTests
    ts,path_in_suite = getTestSuite(path, litConfig, testSuiteCache)
  File "d:\llvm\llvm\utils\lit\lit\main.py", line 199, in getTestSuite
    ts, relative = search(item)
  File "d:\llvm\llvm\utils\lit\lit\main.py", line 183, in search
    cache[path] = res = search1(path)
  File "d:\llvm\llvm\utils\lit\lit\main.py", line 174, in search1
    cfg = TestingConfig.frompath(cfgpath, None, litConfig, mustExist = True)
  File "d:\llvm\llvm\utils\lit\lit\TestingConfig.py", line 45, in frompath
    exec f in cfg_globals
  File "D:\llvm\llvm-nmake-dbg\test\lit.site.cfg", line 20, in <module>
    lit.load_config(config, "d:/llvm/llvm/test/lit.cfg")
  File "d:\llvm\llvm\utils\lit\lit\LitConfig.py", line 65, in load_config
    config = config)
  File "d:\llvm\llvm\utils\lit\lit\TestingConfig.py", line 45, in frompath
    exec f in cfg_globals
  File "d:/llvm/llvm/test/lit.cfg", line 166, in <module>
    site_exp[sub].replace('-fno-exceptions', '')))
KeyError: 'compile_cxx'


I tracked it down to Cmake generating a test/site.exp with nmake-style
continuation lines, and llvm/test/lit.cfg not handling those
continuation lines.

For example, in my site.exp I get the following (on LLVM 2.9):

set compile_c ""
set compile_cxx "c:/devstudio2008/VC/bin/amd64/cl.exe @ /Fd -c
<<  -ID:/llvm/llvm-nmake-dbg/include -Id:/llvm/llvm/include"
set link ""
set llvmgcc ""
set llvmgxx ""

But lit.cfg can't parse the "<< " line as a continuation of the
definition of compile_cxx.

I have a patch for lit.cfg that works against LLVM 2.8.  I'll file a
bug with the fix once I get download a trunk image.


thanks,
david




More information about the cfe-dev mailing list