Boost Test Library is a portable test framework for performing unit testing in c++
Questions tagged [boost-test]
271 questions
0
votes
1 answer
Boost.Test: How to automatically attach debugger (GDB)?
When executing Boost tests for a project, I see
Test command: ...
Environment variables:
BOOST_TEST_AUTO_START_DBG=yes
BOOST_TEST_BUILD_INFO=yes
BOOST_TEST_CATCH_SYSTEM_ERRORS=yes
BOOST_TEST_COLOR_OUTPUT=yes
BOOST_TEST_DETECT_FP_EXCEPTIONS=yes
…

Alexander Shukaev
- 16,674
- 8
- 70
- 85
0
votes
1 answer
Boost Test entry/exit fixture with manual registration
I am using Boost 1.61 and I am working with the following type of Boost Test setup where I am manually registering tests:
// testsuite.cpp
#include
using boost::unit_test::test_suite;
test_suite* init_unit_test_suite(int,…

Francis
- 529
- 4
- 15
0
votes
1 answer
what predefined to use for doxygen with Boost.Test macros
The Boost.Test framework test macros are confusing doxygen. Is there a way to help doxygen work better with the BOOST_TEST_* and BOOST_AUTO_TEST_* macros? ref api page?

Phil
- 5,822
- 2
- 31
- 60
0
votes
2 answers
CMake + Boost test: ignore tests that fail to build
We have C++ project that has a relatively big number of test suites implemented in Boost/Test. All tests are kept out of main project's tree, every test suite is located in separate .cpp file. So, our current CMakeLists.txt for tests looks like…

ProtoDrake
- 1
- 1
0
votes
1 answer
Boost.Test Test file content with regular expression
I'm right now implementing a library for exporting data into various formats with a multitude of settings. I'm also using Boost.Test, but there is seemingly no function to test the file contents.
For my purposes it should be enough to check if the…

Aleph0
- 5,816
- 4
- 29
- 80
0
votes
1 answer
Boost test unresolved external with static variable
Alright, so I've looked through a number of the questions asked on stack overflow regarding this and haven't been able to find anything that quite answers my issue.
This is the error that I'm getting when linking a boost test project against my…

A LK
- 1
- 1
0
votes
1 answer
Having a solution that contains MFC project and console application for unit testing
I have a solution which containes serveral projects (An MFC Application and the others are DLL projects). Is it possible to add another console application project (BOOST TEST) to unit test a specific DLL project, without modifying anything in the…

Aminos
- 754
- 1
- 20
- 40
0
votes
1 answer
Boost.Test - Undefined symbol when overriding main
I want to provide my own main function while using Boost.Test. So I have included the following macros:
#define BOOST_TEST_ALTERNATIVE_INIT_API
#define BOOST_TEST_NO_MAIN
My main function looks like this:
int main(int argc, char* argv[])
{
int…

ksl
- 4,519
- 11
- 65
- 106
0
votes
1 answer
BOOST_CHECK_EQUAL flag on result C++
I would like to get a flag result of test for to do something like this:
BOOST_CHECK_EQUAL(...);
if (flag == sucess){
then this
}
else
{
this
}
any idea how to do that?
Thanks.

Gaetan Griffon Du Bellay
- 9
- 1
- 3
0
votes
0 answers
runtime_error when calling boost test function
Trying to run some tests through the use of the boost test library by using the following code:
int main(int arg, char *argv[])
{
string help = "help";
#ifdef TESTING_CONSTANT
TestingPeerClass testingClass;
…

Adrian De Barro
- 495
- 2
- 6
- 21
0
votes
1 answer
Boost.Test doesn't treat memory leaks as failure
#define BOOST_TEST_MODULE test
#include
BOOST_AUTO_TEST_CASE(test)
{
int * i = new int;
BOOST_CHECK(i==0);
}
Above test case obviously fails. The memory leak is also reported properely.
However, if I change the…

Slyps
- 607
- 4
- 9
0
votes
1 answer
Visual Studio - how to display exit code in output window without access to `main`
How do I get Visual Studio 2013 to display the exit code in the Output window when a program completes if I don't have access to main?
I'm using Boost test to run some tests. main is defined by the framework so I cannot simply print the exit code to…

ksl
- 4,519
- 11
- 65
- 106
0
votes
1 answer
Boost Test and QtTest memory access violation with Botan
I've been struggling with this and so far couldn't make it work. A simple main using botan works fine, but when i put the same code in a unittest it fails.
// keygeneration_test.cpp
#define BOOST_TEST_DYN_LINK
#include …

Sebastian
- 1,243
- 1
- 18
- 34
0
votes
0 answers
How to display plots in Jenkins of measured durations from tests in C++ over multiple builds
I have multiple test cases which actually measure the duration of a calculation using Boost timers.
The test cases are defined using Boost Test.
For running the tests I use CTest since I use CMake.
The tests are all specified with add_test().
Since…

Baradé
- 1,290
- 1
- 15
- 35
0
votes
3 answers
How to make expectations on a mock object created inside the tested object?
I want to unit test a class that looks like this:
template
class MyClass {
...
void someMethod() {
T object;
object.doSomething();
}
...
};
I want to unit test this class, so I create a mock class for T:
struct…

petersohn
- 11,292
- 13
- 61
- 98