You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何通过GitHub Actions运行Microsoft C++单元测试框架?已遇执行问题

在GitHub Actions中运行Microsoft C++单元测试框架测试失败

我正尝试使用GitHub Actions运行基于Microsoft Unit Testing Framework for C++的单元测试,已尝试将测试DLL与解决方案的EXE放置在同一目录,但该方法无效。以下是我的GitHub Actions构建配置:

runs-on: windows-latest

steps:
# 使用tmp v3 git分支
- uses: actions/checkout@v3
# 获取依赖项
- name: getting dependencies
  working-directory: UnitTest
  run:  ./BuildTest.bat
# 环境配置
- name: set up
  working-directory: UnitTest
  run:  ./SetUpTest.bat
# 添加msbuild到PATH
- name: add msbuild to PATH
  uses: microsoft/setup-msbuild@v1.1
# # 构建Release版本解决方案
# - name: build release
#   run: msbuild Dare.sln /p:Configuration=Release
# 构建Debug版本解决方案
- name: build debug
  run: msbuild Dare.sln /p:Configuration=Debug

# 列出文件(调试用)
- name: list
  working-directory: bin/Debug-windows-x86_64/DareEditor
  run : ls 

# 运行单元测试
- name: run unit test
  working-directory: bin/Debug-windows-x86_64/DareEditor
  # run : ls 
  # run: ./DareEditor.exe /Platform:x64 ./x64\Debug\UnitTest1.dll
  # run: ./DareEditor.exe /Platform:x64 ./x64\Debug\UnitTest1.dll
  run: ./DareEditor.exe 

内容的提问来源于stack exchange,提问作者nekomaster88

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.21 20:03:19