OpenCppCoverage找不到句柄的路径
OpenCppCoverage Cannot find path for the handle
我正在使用Jenkins的CI工作流。
每次编译结束时生成一个bat文件,如下所示:
OpenCppCoverage -q --continue_after_cpp_exception --sources D:Jenkinsworkspacebfsearch --modules D:Jenkinsworkspacebfsearch --excluded_sources D:Jenkinsworkspacebfsearchtests --excluded_sources D:Jenkinsworkspacebfsearchbin --export_type=binary:coverage_results_bfs_add_test_TESTTARGET.exe.cov -- D:JenkinsworkspacebfsearchbintestsDebugbfs_add_test_TESTTARGET.exe
OpenCppCoverage -q --continue_after_cpp_exception --sources D:Jenkinsworkspacebfsearch --modules D:Jenkinsworkspacebfsearch --excluded_sources D:Jenkinsworkspacebfsearchtests --excluded_sources D:Jenkinsworkspacebfsearchbin --export_type=binary:coverage_results_bfs_cluster_around_center_tests_TESTTARGET.exe.cov -- D:JenkinsworkspacebfsearchbintestsDebugbfs_cluster_around_center_tests_TESTTARGET.exe
OpenCppCoverage -q --continue_after_cpp_exception --sources D:Jenkinsworkspacebfsearch --modules D:Jenkinsworkspacebfsearch --excluded_sources D:Jenkinsworkspacebfsearchtests --excluded_sources D:Jenkinsworkspacebfsearchbin --export_type=binary:coverage_results_bfs_multiple_cluster_centers_test_TESTTARGET.exe.cov -- D:JenkinsworkspacebfsearchbintestsDebugbfs_multiple_cluster_centers_test_TESTTARGET.exe
OpenCppCoverage -q --continue_after_cpp_exception --sources D:Jenkinsworkspacebfsearch --modules D:Jenkinsworkspacebfsearch --excluded_sources D:Jenkinsworkspacebfsearchtests --excluded_sources D:Jenkinsworkspacebfsearchbin --input_coverage=coverage_results_bfs_add_test_TESTTARGET.exe.cov --input_coverage=coverage_results_bfs_cluster_around_center_tests_TESTTARGET.exe.cov --input_coverage=coverage_results_bfs_multiple_cluster_centers_test_TESTTARGET.exe.cov --export_type=cobertura:coverage_results.xml -- D:JenkinsworkspacebfsearchbintestsDebugbfs_radius_test_TESTTARGET.exe
我的测试运行总是失败,由于一个明确的错误在opencppcoverage:错误:HandleInformation.cpp:85无法找到句柄的路径。句柄无效。
D:Jenkinsworkspacebfsearch>./runtests.bat
D:Jenkinsworkspacebfsearch>OpenCppCoverage -q --continue_after_cpp_exception --sources D:Jenkinsworkspacebfsearch --modules D:Jenkinsworkspacebfsearch --excluded_sources D:Jenkinsworkspacebfsearch\tests --excluded_sources D:Jenkinsworkspacebfsearch\bin --export_type=binary:coverage_results_bfs_add_test_TESTTARGET.exe.cov -- D:JenkinsworkspacebfsearchbintestsDebugbfs_add_test_TESTTARGET.exe
Error: HandleInformation.cpp:85 Cannot find path for the handle.The handle is invalid.
D:Jenkinsworkspacebfsearch>OpenCppCoverage -q --continue_after_cpp_exception --sources D:Jenkinsworkspacebfsearch --modules D:Jenkinsworkspacebfsearch --excluded_sources D:Jenkinsworkspacebfsearch\tests --excluded_sources D:Jenkinsworkspacebfsearch\bin --export_type=binary:coverage_results_bfs_cluster_around_center_tests_TESTTARGET.exe.cov -- D:JenkinsworkspacebfsearchbintestsDebugbfs_cluster_around_center_tests_TESTTARGET.exe
Error: HandleInformation.cpp:85 Cannot find path for the handle.The handle is invalid.
D:Jenkinsworkspacebfsearch>OpenCppCoverage -q --continue_after_cpp_exception --sources D:Jenkinsworkspacebfsearch --modules D:Jenkinsworkspacebfsearch --excluded_sources D:Jenkinsworkspacebfsearch\tests --excluded_sources D:Jenkinsworkspacebfsearch\bin --export_type=binary:coverage_results_bfs_multiple_cluster_centers_test_TESTTARGET.exe.cov -- D:JenkinsworkspacebfsearchbintestsDebugbfs_multiple_cluster_centers_test_TESTTARGET.exe
Error: HandleInformation.cpp:85 Cannot find path for the handle.The handle is invalid.
D:Jenkinsworkspacebfsearch>OpenCppCoverage -q --continue_after_cpp_exception --sources D:Jenkinsworkspacebfsearch --modules D:Jenkinsworkspacebfsearch --excluded_sources D:Jenkinsworkspacebfsearch\tests --excluded_sources D:Jenkinsworkspacebfsearch\bin --input_coverage=coverage_results_bfs_add_test_TESTTARGET.exe.cov --input_coverage=coverage_results_bfs_cluster_around_center_tests_TESTTARGET.exe.cov --input_coverage=coverage_results_bfs_multiple_cluster_centers_test_TESTTARGET.exe.cov --export_type=cobertura:coverage_results.xml -- D:JenkinsworkspacebfsearchbintestsDebugbfs_radius_test_TESTTARGET.exe
Argument of input_coverage <coverage_results_bfs_add_test_TESTTARGET.exe.cov> does not exist.
OpenCppCoverage Version: 0.9.5.2
Usage: [options] -- program_to_run optional_arguments:
Command line only:
-v [ --verbose ] Verbose mode.
-q [ --quiet ] Quiet mode.
-h [ --help ] Show help message.
--config_file arg Filename of a configuration file.
Command line and configuration file:
--modules arg (=*) The pattern that module's paths should
match. Can have multiple occurrences.
--excluded_modules arg The pattern that module's paths should NOT
match. Can have multiple occurrences.
--sources arg (=*) The pattern that source's paths should
match. Can have multiple occurrences.
--excluded_sources arg The pattern that source's paths should NOT
match. Can have multiple occurrences.
--input_coverage arg A output path of export_type=binary. This
coverage data will be merged with the
current one. Can have multiple occurrences.
--export_type arg (=html) Format: <exportType>:<outputPath>.
<exportType> can be: binary, cobertura, html
<outputPath> (optional) output file or
directory for the export.
Example: html:MyFolderMySubFolder
This flag can have multiple occurrences.
--working_dir arg The program working directory.
--cover_children Enable code coverage for children processes.
--no_aggregate_by_file Do not aggregate coverage for same file
path.
--unified_diff arg Format: <unifiedDiffPath>?<rootFolder>
<unifiedDiffPath> path of the unified diff
file. Git users can use git diff output.
<rootFolder> (optional) root folder for
paths in the diff file.
See documentation for limitations.
--continue_after_cpp_exception Try to continue after throwing a C++
exception.
Build step 'Execute Windows batch command' marked build as failure
Skipping Cobertura coverage report as build was not UNSTABLE or better ...
Can you help me with this? The same script was working a month ago, now it doesn't. Is there something related to windows updates ? I've also looked at the source code, there's no such code at HandleInformation.cpp:85 that can cause an error like that. Is source code updated in the repository?
我已经安装了最新版本,问题仍然存在。
这是我创建的一个快速项目来测试这个问题。
https://github.com/onatbas/OpenCppCoverageTestFail我包含了详细的输出。
我用的是windows 7 x64。我没有杀毒软件。
谢谢
基于https://github.com/OpenCppCoverage/OpenCppCoverage/issues/84,应该在OpenCppCoverage 0.9.8.0中修复
对于我来说,我能够通过使用命令提示符来解决这个问题,而这个命令提示符是作为Admin运行的。
选项一:您必须为"——input_coverage"的.cov files参数指定完整路径。所以你的最后一行应该是这样的:
--input_coverage=D:Jenkinsworkspacebfsearchbincoverage_results_bfs_add_test_TESTTARGET.exe.cov
--input_coverage=D:Jenkinsworkspacebfsearchbincoverage_results_bfs_cluster_around_center_tests_TESTTARGET.exe.cov
--input_coverage=D:Jenkinsworkspacebfsearchbincoverage_results_bfs_multiple_cluster_centers_test_TESTTARGET.exe.cov
选项二:在.bat文件的顶部有CD到bin文件。
cd D:Jenkinsworkspacebfsearchbin
相关文章:
- 外壳包装器句柄/执行交互式命令管道C++ UNIX
- 如何获取边缘窗口句柄 (HWND)?
- 枚举进程模块在有效句柄上返回无效句柄
- 在 c/c++ 中打开 PhysicalDrive 的句柄并写入 MBR 的 linux 等效是什么?
- 从运行服务的应用程序代码中提取窗口句柄
- 在读取文件后重置句柄
- 是否有像地图这样的C++结构,但我得到的不是值的键,而是值的句柄?
- Microsoft ODBC 无法创建有效的句柄
- 我是否可以使用 win32 句柄以编程方式记录发送到/接收到 USB/COM 的内容
- 获取特定进程的句柄数
- C++ 创建 NdisProt 驱动程序的句柄
- 是否需要关闭来自 WinHTTP 异步的句柄?
- 句柄OK全部崩溃
- 我需要通过窗口句柄(HWND)获取文件,我该怎么办?
- 什么是 C# 等同于C++句柄
- 如何获取句柄并枚举注册表路径:"REGISTRYA"?
- GetFinalPathByHandle为NtQuerySystemInformation返回的所有句柄返回相同的路径
- 如何使用Windows应用商店C++在没有窗口句柄的情况下渲染路径几何体
- 按句柄的目录路径
- OpenCppCoverage找不到句柄的路径