Boost Test Library is a portable test framework for performing unit testing in c++
Questions tagged [boost-test]
271 questions
0
votes
0 answers
How to define a "sample" for boost test dataset with an arity > 1
I'd prefer to group my function params and expected results together in a logical group but I cannot figure out how to create a boost dataset sample with arity > 1 on my own without zipping together other data sets. Below is some code that I am…

Adrian Cornish
- 23,227
- 13
- 61
- 77
0
votes
1 answer
How do you add Boost tests to a run configuration as a custom executable?
I have a test file that uses Boost libraries and it builds correctly. My goal is to run the test cases by setting up a run configuration in QT Creator.
I have tried to set the test file as an executable with cmake, and it builds…

John Glen
- 771
- 7
- 24
0
votes
0 answers
delete an object containing smart_pointer as members results in program crash
I have a very simple class working with the boost::asio::ip::tcp::socket which offers this simple interface:
class SimpleClient{
//private
boost::scoped_ptr signal_socket;
protected:
…

Gionata Benelli
- 357
- 1
- 3
- 20
0
votes
1 answer
Boost.Test - How to write a test that doesn't run automatically
A project I am working on uses continuous integration (CI) system that automatically builds and runs all test suites. Auto tests are run without any command line arguments. I would like to add long running tests into existing suites and I don't want…

pic11
- 14,267
- 21
- 83
- 119
0
votes
1 answer
Boost.Test linker error by use with precompiled headers (PCH)
I have a linker error when using Boost.Test with precompiled header (PCH) that does not occur without PCH. I use the dynamically linked library as described in Usage variants.
How can I fix the error to use Boost.Test also with PCH?
The problem…

Olx
- 163
- 8
0
votes
1 answer
Constant strings initialized as empty
I am dealing with something mysterious or I am not thinking straight. Details are below, I held off on all usings-s, #include-s, etc. in favor of brevity. My code compiles fine.
Pseudo Code:
File: Constants.hpp
namespace TestConstants
{
const…

Aniruddha Gore
- 57
- 7
0
votes
1 answer
Controlling output of Boost.Test source location format
Catch2 and Boost.Test provide similar features for writing unit tests.
For a certain project I have to use Boost.Test instead of Catch2.
The problem I have is that both use different format outputs.
For example, Catch2 will say that the was a fail…

alfC
- 14,261
- 4
- 67
- 118
0
votes
1 answer
g++ compile included header: no such file or directory
So this has been asked alot of times but I havent been able to solve my problem within 2 hours, I hope someone can help me, probably there are only 1 or 2 minor things off...
Im including a .hpp in my file, vscode has no problems (includepath…

cdol
- 28
- 6
0
votes
1 answer
Cannot allocate memory using boost test
I have a test case like this:
BOOST_AUTO_TEST_CASE(Test) {
std::thread([](){
BOOST_CHECK(system("script.sh") >= 0);
}).detach();
//other checks here
}
When I run only this test suite everything is ok. When I run my 80 tests then…

greywolf82
- 21,813
- 18
- 54
- 108
0
votes
1 answer
CMake project cannot link with Boost.Test statically or dynamically
I am trying to setup a simple C++ project with CMake and Boost libraries (Boost.Test in this case). I am following this guide except trying to link statically: https://www.jetbrains.com/help/clion/boost-test-support.html. I have installed Boost…

Jordan
- 902
- 2
- 10
- 37
0
votes
0 answers
Boost.Tests vc142 from Vcpkg on Visual Studio 2019
I'm new to both vcpkg and boost library and I've been researching, and trying, how to setup boost-unit-tests-framework on VS 2019 but all docs seem out of date.
My goal is to run boost tests from test explorer in visual studio.
Vcpkg
Cloned Vcpkg…

L4ZZA
- 83
- 12
0
votes
1 answer
implementing a BOOST_TEST test_runner for running multiple tests from different shared libraries
I am trying to implement a test_runner for BOOST_TEST that plugs-in to a set of shared_libs containing the tests.
I got the initial sample libs/test/tools/console_test_runner from official boost src. But unfortunately, this code does not compile and…

ashishsony
- 2,537
- 3
- 26
- 38
0
votes
1 answer
How to get boost tests discovered by Visual Studio Test Explorer in a cmake project
I have a small c++ project that I converted to cmake (from visual studio's native solutions), as this now appears to be industry standard.
However, there are appear to be some negative side effects: The boost tests are no longer discovered by visual…

Nickpick
- 6,163
- 16
- 65
- 116
0
votes
1 answer
How to get the return values for a function in boost test functions?
I am trying to write boost unit tests for a C++ repository. I want to assert the return values of the function, but the visual studio complains it as an unresolved external symbol. If the BOOST_AUTO_TEST_CASE(my_boost_test) uses user-defined types…

chester cheetah
- 83
- 7
0
votes
1 answer
Observing test failure messages
I am using boost test within a home-grown GUI, and want to access test results (e.g. the failure message and location when a test fails)
The unit_test::test_observer class provides the virtual method:
void…

jxf
- 163
- 1
- 9