OSDN Git Service

[lit] Improve tool substitution in lit.
authorZachary Turner <zturner@google.com>
Fri, 6 Oct 2017 17:54:46 +0000 (17:54 +0000)
committerZachary Turner <zturner@google.com>
Fri, 6 Oct 2017 17:54:46 +0000 (17:54 +0000)
commit19ac6f8ea49ce239065d44c6f8f06a8f24859941
tree23768f730b0ee5a4f388a7780bcb3c042bd39fc7
parente959bd0e6085525c807b74693251ab474594c352
[lit] Improve tool substitution in lit.

This addresses two sources of inconsistency in test configuration
files.

1. Substitution boundaries.  Previously you would specify a
   substitution, such as 'lli', and then additionally a set
   of characters that should fail to match before and after
   the tool.  This was used, for example, so that matches that
   are parts of full paths would not be replaced.  But not all
   tools did this, and those that did would often re-invent
   the set of characters themselves, leading to inconsistency.
   Now, every tool substitution defaults to using a sane set
   of reasonable defaults and you have to explicitly opt out
   of it.  This actually fixed a few latent bugs that were
   never being surfaced, but only on accident.

2. There was no standard way for the system to decide how to
   locate a tool.  Sometimes you have an explicit path, sometimes
   we would search for it and build up a path ourselves, and
   sometimes we would build up a full command line.  Furthermore,
   there was no standardized way to handle missing tools.  Do we
   warn, fail, ignore, etc?  All of this is now encapsulated in
   the ToolSubst class.  You either specify an exact command to
   run, or an instance of FindTool('<tool-name>') and everything
   else just works.  Furthermore, you can specify an action to
   take if the tool cannot be resolved.

Differential Revision: https://reviews.llvm.org/D38565

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315085 91177308-0d34-0410-b5e6-96231b3b80d8
test/lit.cfg.py
utils/lit/lit/llvm/__init__.py
utils/lit/lit/llvm/config.py
utils/lit/lit/llvm/subst.py [new file with mode: 0644]
utils/lit/lit/util.py