linux下如何使用googletest
2023-02-28 20:32 作者:Scorpioscc | 我要投稿
一個簡單的使用googletest的demo
1.相關(guān)地址
googletest地址:????https://github.com/google/googletest.git
本項目地址:????https://github.com/abc6324562/Study.git
2.目錄展示和相關(guān)的bash命令
a.編譯gtest庫
cd googletest/
mkdir build
cd build
cmake ..
make
make install
b.編譯測試代碼
????g++ unittest/unittest_demo.cpp googletest/googletest/src/gtest_main.cc src/demo.cpp -o test.bin -I googletest/googletest/include/ -I src/ -L googletest/build/lib/ -lgtest -lpthread
c.執(zhí)行測試
????./test.bin
