[all-commits] [llvm/llvm-project] 1d83a1: [clang][dataflow] Replace TEST_F with TEST where p...

Sam Estep via All-commits all-commits at lists.llvm.org
Thu Jun 30 09:03:47 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1d83a16bd3faa1dfb6e8ed40c53d018dc03e2c81
      https://github.com/llvm/llvm-project/commit/1d83a16bd3faa1dfb6e8ed40c53d018dc03e2c81
  Author: Sam Estep <sam at samestep.com>
  Date:   2022-06-30 (Thu, 30 Jun 2022)

  Changed paths:
    M clang/unittests/Analysis/FlowSensitive/ChromiumCheckModelTest.cpp
    M clang/unittests/Analysis/FlowSensitive/MatchSwitchTest.cpp
    M clang/unittests/Analysis/FlowSensitive/MultiVarConstantPropagationTest.cpp
    M clang/unittests/Analysis/FlowSensitive/SingleVarConstantPropagationTest.cpp
    M clang/unittests/Analysis/FlowSensitive/TestingSupportTest.cpp
    M clang/unittests/Analysis/FlowSensitive/TransferTest.cpp

  Log Message:
  -----------
  [clang][dataflow] Replace TEST_F with TEST where possible

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

Reviewed By: ymandel, sgatev

Differential Revision: https://reviews.llvm.org/D128924




More information about the All-commits mailing list