Questions tagged [boost-unit-test-framework]
33 questions
30
votes
5 answers
How to compare vectors with Boost.Test?
I am using Boost Test to unit test some C++ code.
I have a vector of values that I need to compare with expected results, but I don't want to manually check the values in a loop:
BOOST_REQUIRE_EQUAL(values.size(), expected.size());
for( int i = 0;…

mskfisher
- 3,291
- 4
- 35
- 48
16
votes
1 answer
How do I get BOOST_TEST_MESSAGE to display on the screen?
I'm fumbling my way through the Boost Unit Testing Framework and have set up a basic functioning unit test. I'm using BOOST_TEST_MESSAGE to let the user know which tests are running, but the messages don't display on the screen. For example:
#define…

quant
- 21,507
- 32
- 115
- 211
6
votes
3 answers
What is the "mks" unit reported by the Boost Unit Test Framework?
When executed with all logging enabled (e.g. test --log_level=all), a unit test created with the Boost Unit Test Framework will report how long an individual test case took with a message like this:
Leaving test case "testRecursiveSchedule"; testing…

OldPeculier
- 11,049
- 13
- 50
- 76
6
votes
2 answers
Can I get log output only for failures with boost unit tests
I have some logging in my application (it happens to be log4cxx but I am flexible on that), and I have some unit tests using the boost unit test framework. When my unit tests run, I get lots of log output, from both the passing and failing tests…

kdt
- 27,905
- 33
- 92
- 139
5
votes
2 answers
Boost unit test dynamic linking on Ubuntu
I am trying to build a unit test using Boost's unit test framework. I would like to dynamically link test suite libraries with the auto generated test module that Boost provides. Here is the basic construction I've been…

putnampp
- 341
- 2
- 8
5
votes
1 answer
automake: automatically run unit tests
I am maintaining an autoconf package and wanted to integrate automatic testing. I use the Boost Unit Test Framework for my unit tests and was able to sucessfully integrate it into the package.
That is it can be compiled via make check, but is is not…

Paddre
- 798
- 1
- 9
- 19
4
votes
1 answer
class, BOOST_TEST_MODULE, BOOST_AUTO_TEST_SUITE: problems from naming?
So, I have started using boost unit testing.
When I try and build a simple test that creates an instance of a class I get a compilation error.It works fine without an instance of the class.
The compilation error message…

PopcornKing
- 1,370
- 3
- 18
- 23
4
votes
1 answer
How to use a templated function as custom predicate for Boost::Unit-test
I am trying to build a custom predicate for BOOST_CHECK_PREDICATE where the predicate itself is a templated function. My example looks as follows:
#define BOOST_TEST_MODULE Module
#define BOOST_TEST_MAIN
#include
//…

user1832210
- 53
- 4
3
votes
2 answers
Handling large volume of boost unit test related warnings with clang-tidy
I'm in the process of setting up a project. I have skeleton tests in place using boost unit-test. Unfortunately a large number of warnings are spawned from the macro expansions. Is there a way to disable these, without have to specify individual…

Jibbity jobby
- 1,255
- 2
- 12
- 26
2
votes
1 answer
Issue with BOOST unit_test_framework / Google Test on macOS Mojave
During a build process (unit tests) there are a bunch of errors like: "error: no member named 'xxx' in the global namespace
using::xxx;" ('xxx' is a type, e.g. uint8_t).
DETAILS:
in case if I include only , the source of…

olpo.graphy
- 405
- 8
- 17
2
votes
1 answer
boost unit test filter when using a fixture
I need to specify a specific unit test to run. Of course, I looked at Stack Overflow Answers after I looked at the documentation, but neither used a fixture.
How do I specify a test case to run if I have:
BOOST_AUTO_TEST_SUITE(mysuite)
struct…

Christopher Pisz
- 3,757
- 4
- 29
- 65
2
votes
0 answers
How to create a custom output/report format for boost unit test?
How can a custom report format for boost unit test be created?
I'm looking at the docs, and am only able to find bits and pieces, it's unclear how it all fits together. I think I want a unit_test_log_formatter, but aren't sure how to add it. Or…

edA-qa mort-ora-y
- 30,295
- 39
- 137
- 267
2
votes
1 answer
Compilation using Boost Test Unit in std c++11
I'm trying to compile a very simple program using Boost Test Unit
#define BOOST_TEST_MODULE My Test
#include
BOOST_AUTO_TEST_CASE(first_test) { int i = 1; BOOST_CHECK(i == 1); }
If I compile this small…

José
- 1,774
- 1
- 17
- 21
2
votes
2 answers
Linking errors when building against Boost Unit Test Framework
I am trying to use Boost Unit Test Framework by building a stand alone library as detailed here:
http://www.boost.org/doc/libs/1_35_0/libs/test/doc/components/utf/compilation.html
So I created a VC library project containing the mentioned files and…

Rafid
- 18,991
- 23
- 72
- 108
1
vote
1 answer
Octave-C++-API and Boost Unit Tests result in Segmentation Fault
I try to unit test my C++ code where I use the octave-C++-API. If I use anything from octave in the boost unit test I get the error:
Segmentation fault (core dumped)
The compilation works just fine and if use both octave and boost separately it…

jlammering
- 21
- 4