Questions tagged [boost.test]

A test-framework provided by Boost

Boost.Test Logo

The Boost Test Library provides a matched set of components for writing test programs, organizing tests in to simple test cases and test suites, and controlling their runtime execution.

(The above is a direct quote from the source)

Documentation: http://www.boost.org/doc/libs/1_56_0/libs/test/doc/html/intro.html

24 questions
8
votes
2 answers

Boost.Test check whether a pointer is null

I have the following test : BOOST_CHECK_NE(pointer, nullptr); The compilation fails due to /xxx/include/boost/test/tools/detail/print_helper.hpp:50:14: error: ambiguous overload for ‘operator<<’ (operand types are ‘std::ostream {aka…
Barth
  • 15,135
  • 20
  • 70
  • 105
4
votes
1 answer

How to make boost.Test log/print std types

#include BOOST_AUTO_TEST_CASE(test1) { std::optional opt1(10); BOOST_TEST(t == 11); std::optional opt2(11); BOOST_CHECK_EQUAL(opt1, opt2); } Is there any way to make boost test print…
mkmostafa
  • 3,071
  • 2
  • 18
  • 47
4
votes
0 answers

Setting the library path for Boosts tests with CMake in Windows

I've started a little project on GitHub for an OpenSceneGraph plugin. Here, I plan on learning how to setup projects with CMake, unit testing with Boost.Test and continuous integration, with Travis-CI. It has this structure: root |-> cmake |->…
Adri C.S.
  • 2,909
  • 5
  • 36
  • 63
3
votes
1 answer

Boost.Tests where is entry point?

I'm using JetBrain's CLion and try to run some boost tests, but they won't. Here's my code: #define BOOST_TEST_MAIN 1 #define BOOST_TEST_MODULE ! #include #include BOOST_AUTO_TEST_CASE(MyTest) { …
2
votes
1 answer

A simple Boost Data Test doesn't compile if an argument is named t

In the Boost.Test documentation, the following example is given #define BOOST_TEST_MODULE dataset_example62 #include #include #include namespace…
Randy Marsh
  • 135
  • 3
2
votes
2 answers

Mark variable as not NULL after BOOST_REQUIRE in PVS-Studio

I'm using PVS-Studio to analyze my Testcode. There are often constructs of the form const noAnimal* animal = dynamic_cast(...); BOOST_REQUIRE(animal); BOOST_REQUIRE_EQUAL(animal->GetSpecies(), ...); However I still get a warning V522…
Flamefire
  • 5,313
  • 3
  • 35
  • 70
2
votes
2 answers

Boost.Test show Test durations

I'm using Boost.Test (1.60.0) to test my projects. In order to identify the most time consuming tests, I wanted to know the test duration of every test in milliseconds. The total amount of time consumed by all tests would be also nice. Does…
Aleph0
  • 5,816
  • 4
  • 29
  • 80
1
vote
1 answer

Compile several test source files as a single merged file with CMake

I have a library that has many different cpp test files. They look like this, A.cpp, B.cpp, C.pp, etc. A.cpp: #define BOOST_TEST_MODULE "C++ Unit Tests A" #include #include…
alfC
  • 14,261
  • 4
  • 67
  • 118
1
vote
1 answer

How is Boost.Test tested?

Does the Boost.Test framework itself have any tests? Boost seems to have lots of regression tests for the other libraries, written in Boost.Test of course. But how does one make sure that the test framework itself is correct?
1
vote
0 answers

When a boost auto test-case name has a comma in it, boost complains: "Test setup error: no test cases matching filter or all test cases were disabled"

Test-case template is not running (which I assume is because of the comma), when using boost::mpl. The code works in boost 1.55 as the test case name being used is a mangled name of the template. But upgrading to boost 1.64 the demangled name is now…
1
vote
1 answer

Do Boost.Test's data test cases really require C++11?

I work in a specific enterprise environment and there's no C++11 infrastructure at the moment. Recently I started writing unit-tests and decided to utilize Boost.Test framework since Boost is known for its' portability and…
Roman K.
  • 13
  • 2
1
vote
1 answer

Running Boost.Test without main method invocation

I'm trying to test parts of my code. I wrote the following test.h file: #include BOOST_AUTO_TEST_CASE(my_test) { BOOST_CHECK(true); } If I run the test, my application's main method is invoked and since the command…
BullyWiiPlaza
  • 17,329
  • 10
  • 113
  • 185
1
vote
1 answer

BOOST.TEST Trouble having BOOST test cases in a dll and runner in exe

I am using Boost.Test for my unit testing. I would like to have all test code in a separate dll so that the test code is not shipped and my production code doesn't bloat. For this I considered having manual test cases in the dll and have the dll…
G_K
  • 26
  • 4
0
votes
0 answers

How to get intellisense working for boost.test with vscode on mac?

Has anyone got intellisense working for c++ boost.test with Visual Studio code? boost is installed in /usr/local/Cellar/boost/1.80.0/include Things have tried: add the above path to c++ intellisense configuration as…
Jesse Zhuang
  • 388
  • 1
  • 4
  • 14
0
votes
0 answers

Boost.test LNK2019: missing signatures

I'm trying to build an unit test for a dll project (ArchiCAD addon, actual file extension is .apx btw). Test discovery failed and testing it in command prompt showed that the stuff required adding ArchiCAD's library to %PATH%. So I added to my test…
Gyula Sámuel Karli
  • 3,118
  • 2
  • 15
  • 18
1
2