简体   繁体   English

是否可以仅运行Boost单元测试模块的子集?

[英]Is it possible to run only subsets of a Boost unit test module?

I am using the Boost 1.34.1 unit test framework. 我正在使用Boost 1.34.1单元测试框架。 (I know the version is ancient, but right now updating or switching frameworks is not an option for technical reasons.) (我知道版本很古老,但由于技术原因,现在更新或切换框架不是一种选择 。)

I have a single test module ( #define BOOST_TEST_MODULE UnitTests ) that consists of three test suites ( BOOST_AUTO_TEST_SUITE( Suite1 ); ) which in turn consist of several BOOST_AUTO_TEST_CASE() s. 我有一个测试模块( #define BOOST_TEST_MODULE UnitTests ),它包含三个测试套件( BOOST_AUTO_TEST_SUITE( Suite1 ); ),它们又由几个BOOST_AUTO_TEST_CASE()组成。

My question: 我的问题:

Is it possible to run only a subset of the test module, ie limit the test run to only one test suite, or even only one test case? 是否可以只运行测试模块的一个子集,即将测试运行限制为仅一个测试套件,甚至只限一个测试用例?

Reasoning: 推理:

I integrated the unit tests into our automake framework, so that the whole module is run on make check . 我将单元测试集成到我们的automake框架中,以便整个模块在make check上运行。 I wouldn't want to split it up into multiple modules, because our application generates lots of output and it is nice to see the test summary at the bottom ("X of Y tests failed") instead of spread across several thousand lines of output. 我不想将它分成多个模块,因为我们的应用程序会生成大量输出,很高兴看到底部的测试摘要(“Y测试中的X失败”)而不是分散在几千行输出中。

But a full test run is also time consuming, and the output of the test you're looking for is likewise drowned; 但是,完整的测试运行也很耗时,您正在寻找的测试结果同样被淹没; thus, it would be nice if I could somehow limit the scope of the tests being run. 因此,如果我能以某种方式限制正在运行的测试的范围,那将是很好的。

The Boost documentation left me pretty confused and none the wiser; Boost文档让我很困惑,没有一个更聪明; anyone around who might have a suggestion? 周围有谁可能有建议? (Some trickery allowing to split up the test module while still receiving a usable test summary would also be welcome.) (一些技巧允许在仍然接收可用的测试摘要的同时拆分测试模块也是受欢迎的。)

看看--run_test参数 - 它应该提供你所追求的东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM