Questions tagged [boost-test]

Boost Test Library is a portable test framework for performing unit testing in c++

271 questions
1
vote
1 answer

Boost.Test custom test summary

Is there a way to read the test results (all assertions that either passed ot failed) at runtime using Boost Unit Testing framework ? What I want is to produce custom test log and output it to the console in a custom human readable format after each…
Marc Andreson
  • 3,405
  • 5
  • 35
  • 51
0
votes
2 answers

boost::test and verifying code is executed

I have a test that is successful (among other things) if a certain callback is run exactly N times. Of course, I can write a bit of code to count how many times the callback is run and then execute a boost::test case against that condition. But…
jma
  • 3,580
  • 6
  • 40
  • 60
0
votes
1 answer

Testing a DLL with Boost::Test from command line

I am developing a DLL in C++ and want to perform unit testing of that DLL using the Boost Test Libraries. I found here that test_runner.exe can be used. How to obtain test_runner.exe? Are there any ways or locations which does not require to build…
sergtk
  • 10,714
  • 15
  • 75
  • 130
0
votes
1 answer

BOOST_CHECK_EQUAL_COLLECTIONS with unsigned char outputs non-printable characters on mismatch

Is there any way to change the unsigned char output formatting of BOOST_CHECK_EQUAL_COLLECTIONS? I'm using Boost.Test 1.37.0 to validate values in an unsigned char array: // result.Message is a fixed-size unsigned char array // result.Length is…
mskfisher
  • 3,291
  • 4
  • 35
  • 48
0
votes
2 answers

Boost.Test spits out garbage instead of readable error messages

I am using Boost.Test and my test fails. That's fun and all, but the results are horrifying. This is the output of Boost.Test: $ zwja/Build/Products/Debug/test ; exit; < Running 2 test…
user142019
0
votes
1 answer

Function refuses to work in Boost test function

I cant understand why in the class constructor I can call this function but when called in the test function, it errors out with E:\Projects\NasuTek-Plugin-Engine\tests\CheckAddonEngine.cpp:64: error: conversion from…
DrHouse
  • 99
  • 1
  • 8
0
votes
0 answers

Error with testing a template with boost::test

I'm trying to test a little buffer template with boost::test. This is my template. template class Buffer { public: Buffer(); template Buffer(T* data); template…
Jepessen
  • 11,744
  • 14
  • 82
  • 149
0
votes
1 answer

boost.test: compile errors when STL code is included within a test suite

My setup: windows 10 msys2 with g++ 12.2.0 boost.test 1.81.0 My test file: // test.cpp #define BOOST_TEST_MAIN #define BOOST_TEST_MODULE a_nice_testing_attempt #include // this is…
deponovo
  • 1,114
  • 7
  • 23
0
votes
0 answers

valgrind reports leaks in boost test framework with no tests

I am using the latest apt packages on Ubuntu 18.04.6: Boost 1.65.1 valgrind-3.13.0 Here is the test file; it intentionally doesn't include any tests: // temp.cpp #define BOOST_TEST_MODULE some_name_here #include…
jagprog5
  • 69
  • 1
  • 4
0
votes
0 answers

Boost unit test linker error in header-only version

Boost is installed by unzipping the file from boost.org and running bootstrap.bat and b2.exe. On completion, the stage\lib directory is populated with over a hundred .LIBs. In an effort to sidestep a linker error, I tried following the instructions…
0
votes
0 answers

Link.exe tries to open a nonexistent Boost_Test import library

I am trying to compile and run C++ tests with CTest and Boost's unit test framework, linked dynamically. CMakeLists.txt contains this (unrelated commands excluded): [...] find_package(Boost REQUIRED COMPONENTS…
0
votes
2 answers

Problem in using Boost Unit Test

I want to start to use Boost Test library to create tests for my application. Following the tutorial that I've found at http://www.boost.org/doc/libs/1_47_0/libs/test/doc/html/tutorials/new-year-resolution.html I've started my test class. So, I've…
jepessen
  • 1
  • 2
0
votes
1 answer

How to use boost tests with SFML and cmake?

I'm writing a simple game in C++ with use of SFML. I want to use boost tests, but when i try to i get undefined reference in every place i use SFML features (the game itself works fine, it's just the test that don't). Sample test: #include…
czarniecki
  • 63
  • 5
0
votes
1 answer

Assembler error in MIPS build of Boost.Test program

I'm writing a unit test program with Boost.Test and cross-compiling it for several embedded platforms in an OpenWrt environment. The Boost version is 1.58. All is fine when building for ARM (using gcc 5.2), however when building for MIPS (using gcc…
Wolfram Rösler
  • 302
  • 1
  • 12
0
votes
2 answers

Boost Test run function on failure

I have many tests which depend on stochastic procedures. Rarely, the tests fail, as you basically get unlucky with the random numbers. However, sometimes the failure is actually a bug, and I'd like to reproduce it. I have a global random generator…
Svalorzen
  • 5,353
  • 3
  • 30
  • 54