修复了测试框架编译缺少头文件的问题
添加了测试示例
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
project(bus_test)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
|
||||
add_subdirectory(./GTest)
|
||||
|
||||
include_directories(GTest/googletest/include)
|
||||
|
21
test/io_test.cpp
Normal file
21
test/io_test.cpp
Normal file
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// Created by ricardo on 2022/5/7.
|
||||
//
|
||||
#include "gtest/gtest.h"
|
||||
#include "gmock/gmock.h"
|
||||
extern "C"
|
||||
{
|
||||
#include "rail.h"
|
||||
}
|
||||
|
||||
using ::testing::Return;
|
||||
using ::testing::AtLeast;
|
||||
using ::testing::Exactly;
|
||||
|
||||
using namespace testing;
|
||||
|
||||
TEST(test, test)
|
||||
{
|
||||
int result = add(1, 1);
|
||||
EXPECT_EQ(2, result);
|
||||
}
|
Reference in New Issue
Block a user