从命令行使用 Boost::Test 测试 DLL

发布于 2025-01-08 03:44:51 字数 479 浏览 2 评论 0 原文

我正在用 C++ 开发一个 DLL,并希望使用 Boost 测试库

我发现这里可以使用test_runner.exe

如何获取test_runner.exe? 有没有不需要构建boost的方法或位置?

我从BoostPro下载页面安装了boost 1.47,但那里没有test_runner.exe。

谢谢。

I am developing a DLL in C++ and want to perform unit testing of that DLL using the Boost Test Libraries.

I found here that test_runner.exe can be used.

How to obtain test_runner.exe?
Are there any ways or locations which does not require to build boost?

I installed boost 1.47 from BoostPro download page, but there is no test_runner.exe there.

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

婴鹅 2025-01-15 03:44:51

您可以根据来源自行构建一个。它没有额外的依赖项,只有 Boost.Test 本身。

  1. 您可以引导升压安装
    下载boost源码,解压并运行bootstrap.bat

  2. 然后构建bjam并在libs/test/tools/test_runner下运行构建命令。
    bjam.exe 应该存在于未打包的发行版中。
    将当前文件夹切换到 libs/test/tools/test_runner 并使用所需参数(平台、配置等)从中运行 bjam.exe
    输出 console_test_runner.exe 将在 bin.v2\libs\test\tools\console_test_runner

    中可用,

You can build one yourself from sources. It has no extra dependencies, only Boost.Test itself.

  1. You can bootstrap boost installation
    Download source of boost, unzip and run bootstrap.bat.

  2. Then build bjam and run build command under libs/test/tools/test_runner.
    bjam.exe should exist in unpacked distribution.
    Switch current folder to libs/test/tools/test_runner and run bjam.exe from it with required parameters (platform, configuration, etc...).
    Output console_test_runner.exe will be available in bin.v2\libs\test\tools\console_test_runner

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文