[cfe-dev] How to check paths in tests

Sean Silva silvas at purdue.edu
Mon Jun 24 22:22:35 PDT 2013


On Mon, Jun 24, 2013 at 8:08 PM, Dmitri Gribenko <gribozavr at gmail.com>wrote:

> On Mon, Jun 24, 2013 at 7:11 PM, Sean Silva <silvas at purdue.edu> wrote:
> > On Mon, Jun 24, 2013 at 3:22 PM, Rafael EspĂ­ndola
> > <rafael.espindola at gmail.com> wrote:
> >>
> >> Sean Silva suggests using something like {{{foo/bar/zed}}} to make the
> >> substitution more local.
> >
> >
> > I'm actually not sure I like this too much anymore. It's extremely
> cryptic.
> > My primary concern was something like:
> >
> > CHECK: error: frobnication at foo/bar/baz
> >
> > where I don't think you would want the test to just say
> >
> > CHECK-PATH: foo/bar/baz
> >
> > but rather want to check that "error: frobnication at" is there too.
> > However, having CHECK-PATH just replace `/` with the appropriate regex
> would
> > deal with this. It would lead to a slight loosening of cases like:
> >
> > CHECK-PATH: error: division operator `/` at foo/bar/baz
> >
> > would accept
> >
> > CHECK-PATH: error: division operator `\\` at foo/bar/baz
> >
> > but I think that this is not likely to be an issue in practice.
>
> What about:
>
> CHECK: error: division operator `/` at [[@PATH:foo/bar/baz]]
>

I like this idea. It's similar to how we handle e.g. `[[@LINE+4]]` <
http://llvm.org/docs/CommandGuide/FileCheck.html#filecheck-expressions>.

-- Sean Silva
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130624/e68cd573/attachment.html>


More information about the cfe-dev mailing list