小编Len*_*art的帖子

您如何选择要运行的特定 Google Mock 测试用例/单元测试?

我有多个单元测试,每个测试都在一个单独的文件中。

我的标准单元测试之一如下所示:

#include "gmock/gmock.h"
#include "gtest/gtest.h"

class ClassAUnitTest : public ::testing::Test {
protected:
    // Per-test-case set-up.
    // Called before the first test in this test case.
    // Can be omitted if not needed.
    static void SetUpTestCase() {
        //..
    }

    // Per-test-case tear-down.
    // Called after the last test in this test case.
    // Can be omitted if not needed.
    static void TearDownTestCase() {
        //..
    }

    // You can define per-test set-up and tear-down logic as usual.
    virtual void SetUp() { …
Run Code Online (Sandbox Code Playgroud)

c++ unit-testing googletest

3
推荐指数
1
解决办法
3883
查看次数

标签 统计

c++ ×1

googletest ×1

unit-testing ×1