lit: Provide file location in cfg error messages
authorAlp Toker <alp@nuanti.com>
Wed, 8 Jan 2014 14:20:59 +0000 (14:20 +0000)
committerAlp Toker <alp@nuanti.com>
Wed, 8 Jan 2014 14:20:59 +0000 (14:20 +0000)
commit598887906b975dbb28dd73600763edda1aad7c45
tree522c05b6009b3d54544b83d2dabebdb6ee46b182
parent38b362617c678f959f54a53becee9df693d25b60
lit: Provide file location in cfg error messages

Python doesn't do a good job at diagnosing string exec() so use execfile()
where available.

This should be a timesaver when trying to get to the bottom of build bot
failures.

Before:

    File "llvm/utils/lit/lit/TestingConfig.py", line 93, in load_from_path
      exec("exec data in cfg_globals")
    File "<string>", line 1, in <module>
    File "<string>", line 194, in <module>
  NameError: name 'typo' is not defined

After:

    File "llvm/utils/lit/lit/TestingConfig.py", line 95, in load_from_path
    execfile(path, cfg_globals)
    File "clang/test/lit.cfg", line 194, in <module>
      typo
      ^~~~
  NameError: name 'typo' is not defined

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198766 91177308-0d34-0410-b5e6-96231b3b80d8
utils/lit/lit/TestingConfig.py