Page MenuHomePhabricator

[SyntaxTree] Specialize `TreeTestBase` for `BuildTreeTest` and `MutationsTest`
ClosedPublic

Authored by eduucaldas on Wed, Sep 9, 5:51 AM.

Diff Detail

Event Timeline

eduucaldas created this revision.Wed, Sep 9, 5:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptWed, Sep 9, 5:51 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
eduucaldas requested review of this revision.Wed, Sep 9, 5:51 AM
eduucaldas added inline comments.Wed, Sep 9, 5:56 AM
clang/unittests/Tooling/Syntax/MutationsTest.cpp
60–70

I think it makes sense to split this into a separate file as well.

If agreed this will be done in a separate patch, because it will also incur the creation of a Synthesis.h.

Currently BuildTree.h is backed by Synthesis.cpp and BuildTree.cpp which I don't think makes a lot of sense

  • [SyntaxTree] Extract SynthesisTest from MutationsTest
gribozavr2 accepted this revision.Thu, Sep 10, 1:50 AM
gribozavr2 added inline comments.
clang/unittests/Tooling/Syntax/MutationsTest.cpp
48
56–57

Could we split it into multiple test cases?

TEST_P(MutationTest, RemoveStatement_BinaryExpression) {
  CheckTransformation(
    RemoveStatement,
    "void test() { [[100+100;]] test(); }",
    "void test() {  test(); }");
}

Also consider moving the std::function argument in CheckTransformation to the first position for readability of the call.

clang/unittests/Tooling/Syntax/SynthesisTest.cpp
2–3
This revision is now accepted and ready to land.Thu, Sep 10, 1:50 AM
eduucaldas marked 3 inline comments as done.
  • MutationsTest: Split tests and infrastructure
  • SynthesisTest: Split tests