Boost Test Library is a portable test framework for performing unit testing in c++
Questions tagged [boost-test]
271 questions
0
votes
1 answer
Template resolution - operator<< not found with boost-test
The following code works fine:
#define BOOST_TEST_MODULE TestFoo
#include
#include
#include
template
std::ostream& operator<<(std::ostream& os, const std::vector &v)
{
…

Henning Koehler
- 2,456
- 1
- 16
- 20
0
votes
1 answer
Boost data-driven test output: "Assertion occurred in a following context"
I have a question regarding the output of the following minimal example that uses Boost test.
#define BOOST_TEST_MODULE ExampleTestSuite
#include
#include
using…

Francis
- 529
- 4
- 15
0
votes
1 answer
Trouble with Boost test with argc and argv
I am getting very frustrated in trying to getting Boost test to
use argc and argv. Based on other answers from Stack Overflow, the
following code (with Boost 1.67.0) is the closest I've gotten. However,
it won't compile, because it expects an…

granite chimp
- 21
- 4
0
votes
1 answer
Wrong number of template arguments in macro
I recently upgraded from Ubuntu 16.04 to 18.04 and since then part of my C++ code doesn't compile anymore (but this could also be just coincidence).
Here a minimal example of what isn't compiling:
#include
#include…

mooha
- 1
- 1
0
votes
1 answer
I am novice to Test Framework tools, Want to develope tests which I can integrate to Jenkins
I want to develop Test frame work, which will run the executable ( of the projects) and read the input and validate the value entered.
I was reading through gTest and Boost Test, from what I found is used to Module testing ( methods testing) . my…

pari
- 185
- 1
- 1
- 10
0
votes
0 answers
How to build Boost.Test dynamic library and link it to my project in CMake?
What I did:
I built the library as described here:
> cd $boost_path
> bootstrap.bat
> b2 address-model=64 architecture=x86 --with-test link=shared --prefix=$boost_installation_prefix install
My $boost_path is P:\boost_1_65_1 and…

Moody
- 1,297
- 2
- 12
- 21
0
votes
1 answer
Link error when adding unit tests to legacy solution
I'm currently evaluating unit testing frameworks for our dev team and hit a problem I can't figure out how to solve.
Our application is build using Visual Studio 2017. The solution contains 17 projects. Most of them developed by another team…

PixelSupreme
- 395
- 2
- 9
0
votes
1 answer
Suppress exit signal in Boost.Test
I would like to test a method in my program, which handles shutdown of the application. At the end this method calls exit(0);
As expected this shuts also my test application down.
Is there a possibility to catch the exit signal in this particular…

Simon
- 1,616
- 2
- 17
- 39
0
votes
0 answers
Boost::Test: automatic test suite name generation based on current file name?
Is there any way to make Boost.Test take the name of the file as automatic test suite name, in a portable manner?
Something like BOOST_AUTO_TEST_SUITE(__FILE__) (this doesn't work because __FILE__ contains full path and is not a string…

Alex Jenter
- 4,324
- 4
- 36
- 61
0
votes
2 answers
Running nested sub test cases with Boost.Test
Simply said, can I achieve something like this with Boost.Test 1.58?
BOOST_AUTO_TEST_CASE(my_test)
{
auto context = construct_context();
auto values = context.get_values();
BOOST_REQUIRE(!values.empty()); // #1: breaks whole test case
…

Target-san
- 451
- 3
- 11
0
votes
0 answers
BoostTest: Can't access to protected members
I'm using the BoostTest Framework (version 1.57.0) with Turtle as mock libary (version 1.3.0).
I'm able to access public and private functions in a test case, but I can't access protected functions.
I'm able to mock these protected functions with…

Dave
- 97
- 2
- 6
0
votes
2 answers
C++ thread does not join even after long waiting
I am trying to test my boost asio socket listener using boost unit test. The purpose of the listener is simply listening on a port and read what ever comes in and save it into a queue and send back a http response header.
As a first step, I have…

Kid
- 169
- 1
- 19
0
votes
1 answer
Bazel test with Boost.UTF
For many reasons, I prefer Boost.UTF to gtest (or other alternatives).
I recently decided to use Bazel as my build system, and since I'm essentially at tutorial level, I looked online for a way to use Boost in Bazel, but none of them seems to handle…

Dirich
- 412
- 3
- 13
0
votes
1 answer
How to test client-server flows with boost::test
Currently I do it this way (pseudocode):
#include
#include
bool testingClient = true;
BOOST_AUTO_TEST_SUITE(ProtocolSchema)
BOOST_AUTO_TEST_CASE(server)
{
testingClient = false;
// start server listener
…

Pavel P
- 15,789
- 11
- 79
- 128
0
votes
1 answer
Boost testrunner in Eclipse fails to generate valid XML
I am attempting to run unit tests from Eclipse on C++ code. My Eclipse is Mars.2 Release (4.5.2). I originally downloaded the Java Developer's version, but I've installed C/C++ plugins. I wrote a simple class and then a boost unit test for that…

Brick
- 3,998
- 8
- 27
- 47