# third_party_gtest **Repository Path**: itopen/third_party_gtest ## Basic Information - **Project Name**: third_party_gtest - **Description**: get from https://github.com/google/googletest - **Primary Language**: Unknown - **License**: BSD-3-Clause - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-05-04 - **Last Updated**: 2024-05-04 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # gtest库交叉编译和demo用例编写 ## 一、googletest代码下载 官方路径 https://github.com/google/googletest 个人仓 https://gitee.com/itopen/third_party_gtest.git ## 二、gtest代码编译 ### 2.1 依赖库安装 ```shell # riscv64-linux-gnu-g++安装 sudo apt-get install g++-riscv64-linux-gnu # 依赖库安装 sudo apt-get install cmake sudo apt-get install glibc-doc sudo apt-get install manpages-posix-dev ``` ### 2.2 gtest交叉编译 ```shell git clone https://gitee.com/itopen/third_party_gtest.git cd third_party_gtest mkdir build && cd build cmake ../CMakeLists.txt -DCMAKE_CXX_COMPILER=riscv64-linux-gnu-g++ -DCMAKE_INSTALL_PREFIX=$PWD/install make -j$(nproc) && sudo make install ``` ### 2.3 gtest库处理 将编译的库文件拷贝到工具链的lib中,默认是/usr/riscv64-linux-gnu/lib 将编译的头文件拷贝到工具链的include中,默认是/usr/riscv64-linux-gnu/include ## 三、测试用例 参考测试用例仓的third_party/gtest里的代码 https://gitee.com/itopen/test.git