This is an archive of the discontinued LLVM Phabricator instance.

[clang][dataflow] Replace TEST_F with TEST where possible
ClosedPublic

Authored by samestep on Jun 30 2022, 8:55 AM.

Details

Summary

Many of our tests are currently written using TEST_F where the test fixture class doesn't have any SetUp or TearDown methods, and just one helper method. In those cases, this patch deletes the class and pulls its method out into a standalone function, using TEST instead of TEST_F.

There are still a few test files leftover in clang/unittests/Analysis/FlowSensitive/ that use TEST_F:

  • DataflowAnalysisContextTest.cpp because the class contains a Context field which is used
  • DataflowEnvironmentTest.cpp because the class contains an Environment field which is used
  • SolverTest.cpp because the class contains a Vals field which is used
  • TypeErasedDataflowAnalysisTest.cpp because there are several different classes which all share the same method name

Diff Detail

Event Timeline

samestep created this revision.Jun 30 2022, 8:55 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 30 2022, 8:55 AM
samestep requested review of this revision.Jun 30 2022, 8:55 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 30 2022, 8:55 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
samestep edited the summary of this revision. (Show Details)Jun 30 2022, 8:59 AM
samestep added reviewers: ymandel, gribozavr2, sgatev.
ymandel accepted this revision.Jun 30 2022, 9:01 AM

Thanks!

This revision is now accepted and ready to land.Jun 30 2022, 9:01 AM
sgatev accepted this revision.Jun 30 2022, 9:03 AM

Thanks!

This revision was landed with ongoing or failed builds.Jun 30 2022, 9:03 AM
This revision was automatically updated to reflect the committed changes.