[PATCH] Move commonly useful code for AST testing into MatchVerfier.h.
Philip Craig
philipjcraig at gmail.com
Wed Jan 30 17:33:49 PST 2013
LGTM.
BTW, I don't know what your plans for this are, but I think I got the design of this a bit wrong. We probably want to give the MatchVerifier a list of things to check, rather than deriving a single RangeVerifier or LocationVerifier from it. So the two KNR ParmVarDecl tests could be combined into something like:
TEST(ParmVarDecl, KNRLocation) {
MatchVerifier<ParmVarDecl> Verifier;
Verifier.add(LocationVerifier(1, 8));
Verifier.add(RangeVerifier(1, 8, 1, 8));
EXPECT_TRUE(Verifier.match("void f(i) {}", varDecl(), Lang_C));
}
================
Comment at: unittests/AST/SourceLocationTest.cpp:57
@@ -221,3 +56,3 @@
EXPECT_FALSE(Verifier.match("int i;", varDecl()));
}
----------------
These tests belong to the MatchVerifier module. Might be worth putting in a FIXME to move them when we have a better spot to put them.
http://llvm-reviews.chandlerc.com/D352
BRANCH
clang-ast-test
ARCANIST PROJECT
clang
More information about the cfe-commits
mailing list