Skip to content

A more friendly way to update the unit test cases in gtest_interpreter.cpp #6676

@SeaRise

Description

@SeaRise

Enhancement

The expected results of the unit test cases in the gtest_interpreter are currently handwritten in the code.
Once the expected results have changed, we have to update them using the following steps

for (auto updated_case : all_cases)
{
    1. run unit test and fail
    2. update the new expect result
}

When there are many cases to be updated, the developer will spend more time updating the cases.
Here we should try to provide some ways to simplify the time it takes to update the case.
There are two options available

  • Move the input and output of the case from gtest_interpreter.cpp to gtest_interpreter.in and gtest_interpreter.out, then provide a command to a command to update and overwrite the contents of gtest_interpreter.out base on the input of gtest_interpreter.in. Just like tidb --record
  • Provide a command to batch compare all cases in A so that the steps to update a case can be simplified to the following
1. auto all_new_expect_results = compareAll();
2. update new expect results

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/enhancementThe issue or PR belongs to an enhancement.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions