Questions tagged [boost-test]

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

271 questions
5
votes
2 answers

No Output from Boost Test

I am trying to implement unit test with boost test libraries. I started by reading the manual at the boost site. After this i make a simple test program in one of my already existing project. The only problem which i face is that i am unable to see…
Jame
  • 21,150
  • 37
  • 80
  • 107
5
votes
3 answers

Defining BOOST_TEST_DYN_LINK causes application to crash in Visual Studio

In the boost unit testing documentation it specifically states that you need to define BOOST_TEST_DYN_LINK in order to link with the boost unit test library. I am using this basic example: #define BOOST_TEST_DYN_LINK #define BOOST_TEST_MODULE…
tjwrona1992
  • 8,614
  • 8
  • 35
  • 98
5
votes
1 answer

using the testcase name in output file names

I use boost::test to run integration tests on a class that creates directories and files. I would like these files to be named test-case specific so if I run into trouble I can easily find which test case left its directories/files around. So I…
andreas buykx
  • 12,608
  • 10
  • 62
  • 76
5
votes
0 answers

What is a modern way to implement a test-suite-builder for a test-class with boost?

The examples in the documentation of Boost.Test seem to be mostly refering to C++03 code. I wonder if there is a more C++14/C++17-way of putting together the BOOST_TEST_CASEs in init_unit_test_suite? This is what I derived from the documentation. I…
towi
  • 21,587
  • 28
  • 106
  • 187
5
votes
1 answer

What physical layout for Unit-Tested projects?

At the moment, I'm learning about Unit-Testing and I want to integrate testing to my current (10 files of OpenGL experiments) project. For this purpose I downloaded Boost.Test, and while I can figure out how it works on a single file sample, I have…
bisthebis
  • 523
  • 2
  • 10
5
votes
3 answers

Problem with BOOST_CHECK_CLOSE_FRACTION

I'm using the Boost::Test library, and I am trying to check if an actual percent value is close to the expected value: BOOST_CHECK_CLOSE_FRACTION( items[i].ExpectedPercent, items[i].ActualCount / totalCount, 0.05); For some reason this…
iano
  • 2,061
  • 1
  • 18
  • 22
5
votes
3 answers

Command line args in boost test

I wish to process extra command line arguments for my boost test. I'm using it to test a feature automatically and I need to specify things like servername, user, pass, etc... When I pass my test executable extra command arguments besides the ones…
Edward Strange
  • 40,307
  • 7
  • 73
  • 125
4
votes
3 answers

Boost Test with CMake - undefined main

I'm having trouble building a little program that uses Boost.Test on my Mac with a Boost installed by MacPorts at /opt/local/lib/ Here's my minimal source file, test.cpp: #define BOOST_TEST_MODULE MyTest #include…
exclipy
  • 1,423
  • 1
  • 15
  • 21
4
votes
2 answers

boost unit test - list available tests

I've written some scripts to automate the running of our unit tests, written using the boost unit testing framework. I'd like to add functionality to allow the selection and subsequent running of a subset of all tests. I know I can run a subset of…
Roel
  • 19,338
  • 6
  • 61
  • 90
4
votes
4 answers

boost::test, junit XML output

I select a framework for unit tests in C++ The best (for me) solution is boost::test, because it goes in boost :) But there is 1 problem - the framework must be able to generate XML output in JUnit format, but by default boost::test can generate…
Alek86
  • 1,489
  • 3
  • 17
  • 26
4
votes
1 answer

Is there a way to test nontype templates using Boost Test?

I am using Boost Unit Test to perform unit test for my project. I need to test some non-type templates, however seems that using the macro BOOST_AUTO_TEST_CASE_TEMPLATE(test_case_name, formal_type_parameter_name, collection_of_types) I can test only…
Andrea
  • 47
  • 1
  • 9
4
votes
1 answer

Boost Test Library run suite twice with different "parameters"

I have a suite of tests that can be run in a few different modes. Other than some global configuration, or a fixture config, the test case code is the same. Is there some way in the boost test library to achieve this without having to write a…
edA-qa mort-ora-y
  • 30,295
  • 39
  • 137
  • 267
4
votes
1 answer

Boost Test output spamming with "disabled" when running named test

I'm running a Boost Test test/suite by name, using: ./MyTestExe --run_test=my_test Unfortunately i'm getting hundreds of: "Test case "bla" is skipped because disabled" But I didn't disable it, I simply chose to not run it. Is there a way to remove…
user997112
  • 29,025
  • 43
  • 182
  • 361
4
votes
1 answer

Disable BOOST_CHECK for nullptr

With Boost Test earlier than version 1.64, you cannot do this: SomeType* a_pointer = getPointer(); BOOST_CHECK_EQUAL(a_pointer, nullptr); This is because nullptr_t has ambiguous overloads: Boost issue #12778 and a related SO question. As in the…
Inductiveload
  • 6,094
  • 4
  • 29
  • 55
4
votes
1 answer

finding memory leaks in a boost::test::unit_test

This question is a continuation to a previous question on boost::test::unit_test. I've written a unit test and built the unit test. Here's the build output: 2>------ Build started: Project: UnitTests, Configuration: Debug Win32 ------ 2> …
user206705