1 Star 0 Fork 2

YoungHF2020/testngpp-mockcpp-sample

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
build.sh 1.35 KB
一键复制 编辑 原始数据 按行查看 历史
sinojelly 提交于 2021-04-02 17:27 . add .a, add comment expor var=xxx
#!/bin/bash
# build mockcpp and it's tests, and at last run all tests.
# $1 --- compiler name (GNU)
# $2 --- [optional] compiler major version (The first part of cxx compiler version)
# You can set PREBUILT_TESTNGPP_PATH to your prebuilt mockcpp and testngpp path, if you want to use you own prebuilt tools.
# such as: export USER_TESTNGPP_PATH=/home/sinojelly/test_tools/testngpp_install
# fast fail
set -e
. "tests/testngpp/build_functions.sh"
MY_OS_NAME=""
MY_CXX_COMPILER_NAME=""
MY_CXX_COMPILER_MAJOR_VERSION=""
CMAKE_COMPILER_PARAM=""
MAKE_BUILD_TYPE=""
AUTO_COMPILER="GNU" # $1
AUTO_CXX_VER=`gcc -dumpversion | awk -F. '{print $1}'` # $2
InitEnviroment $AUTO_COMPILER $AUTO_CXX_VER
BUILD_DIR="build_$MY_CXX_COMPILER_NAME"
OS_COMPILER="$MY_OS_NAME/$MY_CXX_COMPILER_NAME/$MY_CXX_COMPILER_MAJOR_VERSION"
echo "OS_COMPILER in Shell : $OS_COMPILER"
RUN_USER_TESTNGPP_PATH=""
CMAKE_USER_TESTNGPP_PATH=""
if [ -d $USER_TESTNGPP_PATH ]; then
RUN_USER_TESTNGPP_PATH=$USER_TESTNGPP_PATH
CMAKE_USER_TESTNGPP_PATH="-DCMAKE_USER_TESTNGPP_PATH=$USER_TESTNGPP_PATH"
fi
cmake -S . -B $BUILD_DIR/project
cmake -S tests/ut -B $BUILD_DIR/ut $CMAKE_USER_TESTNGPP_PATH
CompileProject $MY_CXX_COMPILER_NAME $BUILD_DIR/project
CompileProject $MY_CXX_COMPILER_NAME $BUILD_DIR/ut
RunTestsFromPrebuiltTools $BUILD_DIR ut $MAKE_BUILD_TYPE $OS_COMPILER $RUN_USER_TESTNGPP_PATH
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/younghf2020/testngpp-mockcpp-sample.git
[email protected]:younghf2020/testngpp-mockcpp-sample.git
younghf2020
testngpp-mockcpp-sample
testngpp-mockcpp-sample
master

搜索帮助