This is an archive of the discontinued LLVM Phabricator instance.

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

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

Diff Detail

Event Timeline

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

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.Sep 10 2020, 1:50 AM
gribozavr2 added inline comments.
clang/unittests/Tooling/Syntax/MutationsTest.cpp
48
70

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
1–2 ↗(On Diff #290880)
This revision is now accepted and ready to land.Sep 10 2020, 1:50 AM
eduucaldas marked 3 inline comments as done.
  • MutationsTest: Split tests and infrastructure
  • SynthesisTest: Split tests