CLion 使用googleTest demo
CLion 使用googleTest demo 1. 基本步骤 创建C/C++项目 将googleTest克隆下来 git clone https://github.com/google/googletest.git 将整个googleTest复制到项目里 配置CMakeLists.txt,下面是示范 cmake_minimum_required(VERSION 3.9) project(GTest) set(CMAKE_CXX_STANDARD 11) set(googleTestDir ./googletest) #Add the google test subdirectory add_subdirectory(${googleTestDir}) #include googletest/include dir include_directories(${googleTestDir}/googletest/include) #include the googlemock/include dir include_directories(${googleTestDir}/googlemock/include) set(SOURCE_FILE src/add.cpp test/addTest.cpp src/add.h ) add_executable(GTest ${SOURCE