Questions tagged [boost-test]

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

271 questions
1
vote
2 answers

Is it possible to envoke Boost.UnitTest tests within main in a way similar to the Boost.MinimalTestFacility?

I am extending a library for computational fluid dynamics, so I am dealing with legacy code. The applications involve initializing sometimes very large objects, most of which are codependent. The initialization is dependent on configuration and…
tmaric
  • 5,347
  • 4
  • 42
  • 75
1
vote
2 answers

Can I use BOOST_TEST_CASE for non-static class member function?

I am now using BOOST::UNIT_TEST framework to perform unit test, and it is a great tool to perform unit test. However, I found something inconvenient: when I add functions to test, it seems that the functions must be static or a free function as the…
feelfree
  • 11,175
  • 20
  • 96
  • 167
1
vote
1 answer

multiple build targets in boost build

I want to have two different targets for my unit test Jamfile. This is my currently directory structure : Jamroot src/Jamfile test/Jamfile and this is my test/Jamfile: using testing ; lib boost_unit_test_framework ; run [ glob *.cpp ]…
Carneiro
  • 3,479
  • 5
  • 24
  • 36
1
vote
2 answers

boost-test application initialisation

I'm just getting stated with boost-test and unit testing in general with a new application, and I am not sure how to handle the applications initialisation (eg loading config files, connecting to a database, starting an embedded python interpretor,…
Fire Lancer
  • 29,364
  • 31
  • 116
  • 182
1
vote
1 answer

Can't catch my exception

I've created the following exception class(es): namespace json { /** * @brief Base class for all json-related exceptions */ class Exception : public std::exception { }; /** * @brief Indicates an internal exception of the…
DeX3
  • 5,200
  • 6
  • 44
  • 68
1
vote
1 answer

Boost Test output in xcode 4

I am trying Boost.Test for the first time in Xcode 4. I could get the tests given in this example running well. Of course, I had to add #define BOOST_TEST_DYN_LINK in addition to what's given in the example. However, the output in the xcode console…
Nikhil J Joshi
  • 1,177
  • 2
  • 12
  • 25
1
vote
1 answer

boost.test - distinguishing test results from different build-configurations of same project

I have a VC++ project which has two build configurations, each causes a different 3rd-party library to be used. e.g Release_A & Release_B use libraries A & B, and wrap their functionality. We use a set of boost.test unit tests so we can be sure both…
Mr. Boy
  • 60,845
  • 93
  • 320
  • 589
1
vote
1 answer

boost test unit can not call mpi function

I have looked throughfully around but could not find any reference to this problem. I wrote a c++ program that I am testing with boost/unit. The serial version works fine and the unit test is working. Now I have made the program parallel via a…
z_fly_away
  • 37
  • 12
1
vote
1 answer

Boost tests in Visual Studio

I am trying to compile trivial unit test project in Visual Studio 2010. I have a testrunner.cpp: #define BOOST_TEST_DYN_LINK #define BOOST_TEST_MODULE "BaumWelch Unit Tests" #include and exampletests.cpp #include…
Grzenio
  • 35,875
  • 47
  • 158
  • 240
1
vote
1 answer

How can I check if the first 15 relevant digits in double values are the same in Boost Test framework?

I tried to use what seems to be designed for the job: BOOST_CHECK_CLOSE, so I have the following test: BOOST_AUTO_TEST_CASE( MultivariateNormalDensityTest ) { double TOLLERANCE=1e-14; Eigen::Vector3d mu(0.0, 1.0, 2.0); Eigen::Matrix3d…
Grzenio
  • 35,875
  • 47
  • 158
  • 240
1
vote
1 answer

Boost unit tests throwing exceptions in Visual Studio 2012

I recently upgraded my laptop to Windows 8 so that I can develop for W8 and WP8. I had some projects that were created with Visual Studio 2010 that used Boost.Test for unit testing. I tried converting the projects to VS2012 projects, but ran into…
Wagan8r
  • 468
  • 5
  • 18
1
vote
2 answers

How to write a script to perform automatic test with boost::unit_test?

I am a newbie of automatic unit test in C++. I have followed the instruction of boost::unit_test and finished a test scheme by calling function unit_test_main in boost::unit_test. It is no problem for me to run the test program. However, I have…
feelfree
  • 11,175
  • 20
  • 96
  • 167
1
vote
2 answers

testing new operator fail

I've created a class in which there's some new operator in the constructor. I've created the guard into the constructor to manage new operator failing, but now I want to test it. As example, I've a constructor that is like…
Jepessen
  • 11,744
  • 14
  • 82
  • 149
1
vote
1 answer

BOOST Unit Test stack overflow

I am now using Boost Unit Test to perform unit test for my project. Every time I run the unit test, I got a memory stack problem. I debug into the source code of BOOST library, and I find that the problem comes from invoking the following codes in…
feelfree
  • 11,175
  • 20
  • 96
  • 167
1
vote
1 answer

Boost Testing Framework return code

What is the meaning of return code of unit_test_main function from Boost Testing Framework ?
Marc Andreson
  • 3,405
  • 5
  • 35
  • 51