click the workspace and set like this, but the path you should replace by yourself.(if you install follow the step,you could not change it.) https://hack.limbicmedia.ca/installing-google-test/
How to install Gtest On MacOS
git clone https://github.com/google/googletest.git cd googletest makedir build && cd build cmake -DCMAKE_CXX_STANDARD=17 .. make sudo make install ######test mkdir gtestDemo vi CMakeList.txt
echo “export CPLUS_INCLUDE_PATH=/usr/local/include" >> ~/.zshrc echo "export LIBRARY_PATH=/usr/local/lib" >> ~/.zshrc source ~/.zshrc #tell terminal there are new variables
#CMakeList.txt cmake_minimum_required(VERSION 3.0) set(CMAKE_CXX_STANDARD 17) project(demo) find_package(GTEST REQUIRED) add_executable(${PROJECT_NAME} main.cpp) target_link_libraries(${PROJECT_NAME} ${GTEST_LIBRARIES})
#main.cpp #include <iostream> #include <gtest/gtest.h> int add(int a, int b) { return a + b; } int sub(int a, int b) { return a - b; } // case1 TEST(test, c1) { EXPECT_EQ(3, add(1, 2)); EXPECT_EQ(12, add(2, 6)); } // case2 TEST(test, c2) { EXPECT_EQ(-1, sub(1, 2)); } GTEST_API_ int main(int argc, char ** argv) { testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); }
cmake . make ./demo
#you can also use the g++ command g++ -std=c++11 -stdlib=libc++ main.cpp -o main
Xcode 中的使用
Conference
https://blog.csdn.net/v55538679/article/details/77824214
本网页所有视频内容由 imoviebox边看边下-网页视频下载, iurlBox网页地址收藏管理器 下载并得到。
ImovieBox网页视频下载器 下载地址: ImovieBox网页视频下载器-最新版本下载
本文章由: imapbox邮箱云存储,邮箱网盘,ImageBox 图片批量下载器,网页图片批量下载专家,网页图片批量下载器,获取到文章图片,imoviebox网页视频批量下载器,下载视频内容,为您提供.
阅读和此文章类似的: 全球云计算