1 Star 0 Fork 2

YoungHF2020/testngpp-mockcpp-sample

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
build.ps1 2.10 KB
一键复制 编辑 原始数据 按行查看 历史
# This is a Windows PowerShell script
# On windows 7, open cmd.exe, input powershell, hit enter, then you can run this script.
# If you use powershell the first time, excute this cmd first: set-executionpolicy remotesigned
# $args[0] --- [optional] compiler index in table $global:SUPPORTED_COMPILER in tests\testngpp\build_functions.ps1
# You can set $env:USER_TESTNGPP_PATH to your prebuilt mockcpp and testngpp path, if you want to use you own prebuilt tools.
# such as: $env:USER_TESTNGPP_PATH="D:\Develop\test_tools\testngpp-install"
$global:USER_CHOICE=$null
$global:SUPPORTED_COMPILER=$null
. "$PSScriptRoot\tests\testngpp\build_functions.ps1"
# If no input parameter
if (-not $args[0]) {
# Detect the compiler
cmake -B build tests/testngpp
ReadUserChoice
} else {
$global:USER_CHOICE=$args[0]
}
$global:MY_OS_NAME=$null
$global:MY_CXX_COMPILER_NAME=$null
$global:MY_CXX_COMPILER_MAJOR_VERSION=$null
$global:CMAKE_COMPILER_PARAM=$null
$global:MAKE_BUILD_TYPE=$null
InitEnviroment $global:SUPPORTED_COMPILER[$global:USER_CHOICE].name $global:SUPPORTED_COMPILER[$global:USER_CHOICE].major_ver $global:SUPPORTED_COMPILER[$global:USER_CHOICE].cmake_param
$BUILD_DIR="build_$global:MY_CXX_COMPILER_NAME"
$OS_COMPILER="$global:MY_OS_NAME\$global:MY_CXX_COMPILER_NAME\$global:MY_CXX_COMPILER_MAJOR_VERSION"
echo "OS_COMPILER in Powershell: $OS_COMPILER"
$RUN_USER_TESTNGPP_PATH=""
$CMAKE_USER_TESTNGPP_PATH=""
if ($env:USER_TESTNGPP_PATH -and (test-path $env:USER_TESTNGPP_PATH)) {
$RUN_USER_TESTNGPP_PATH=$env:USER_TESTNGPP_PATH
$CMAKE_USER_TESTNGPP_PATH="-DCMAKE_USER_TESTNGPP_PATH=$env:USER_TESTNGPP_PATH"
}
if (-not ($args[1] -eq "test")) {
Invoke-Expression "cmake $global:CMAKE_COMPILER_PARAM -S . -B $BUILD_DIR/project"
Invoke-Expression "cmake $global:CMAKE_COMPILER_PARAM -S tests/ut -B $BUILD_DIR/ut $CMAKE_USER_TESTNGPP_PATH"
CompileProject $global:MY_CXX_COMPILER_NAME $BUILD_DIR/project
CompileProject $global:MY_CXX_COMPILER_NAME $BUILD_DIR/ut
}
RunTestsFromPrebuiltTools $BUILD_DIR ut $global: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

搜索帮助