Questions tagged [boost-test]

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

271 questions
4
votes
2 answers

Testing a DLL with Boost::Test?

I am developing a DLL in C++ and want to perform unit testing of that DLL using the Boost Test Libraries. I read the Boost test manual thoroughly but since I am new, I have the following question: Should I add test classes in the same VC project in…
Jame
  • 21,150
  • 37
  • 80
  • 107
4
votes
1 answer

C++ Boost Test, package structure, and Eclipse project settings

I'm using C++98, and besides the standard library, I only have access to an old version of Boost (which thankfully has Boost Test). The documentation though is daunting, long, and I just don't know where to begin. I have some experience doing unit…
user7851115
4
votes
1 answer

How can I use Boost Test with Boost Units

I expected this to compile properly: #include #include #include using boost::units::quantity; using boost::units::degree::degrees; using…
sbabbi
  • 11,070
  • 2
  • 29
  • 57
4
votes
1 answer

Boost Test dynamically or statically linked?

We use Boost statically linked with our app but now I want to use Boost Test with an external test runner and that requires the tests themselves to link dynamically with Boost.Test through the use of the required BOOST_TEST_DYN_LINK define. Is this…
Halt
  • 2,924
  • 4
  • 22
  • 26
4
votes
1 answer

Iteration limit in Boost Preprocessor

I am writing a unit test using the Boost::Test framework for a comparison function. For each test case I create a series of input elements and compare them pairwise to check the return value of the comparison function for each pair. I can either…
petersohn
  • 11,292
  • 13
  • 61
  • 98
4
votes
2 answers

Boost Test register exception translator

Does anybody know how to register my custom exception translator when using auto test cases in Boost.Test? I've found some examples (very few actually), but they do not show how to use this feature with auto test cases which are the biggest…
iwasz
  • 128
  • 3
  • 6
4
votes
3 answers

Boost Test Error: main already defined

I have a Visual Studio project where I want to do some unit tests with Boost.Test. And I have 2 files: File 1: #define BOOST_TEST_MODULE FileX #include #include…
Jacob Krieg
  • 2,834
  • 15
  • 68
  • 140
4
votes
3 answers

Using Boost Floating Point Comparison to get a bool return value

After having gone through several articles on here and searching, there are many good solutions to comparing floating point numbers. Such as the Boost…
user3325798
  • 63
  • 1
  • 6
4
votes
1 answer

Boost::Test -- generation of Main()?

I'm a bit confused on setting up the boost test library. Here is my code: #include "stdafx.h" #define BOOST_TEST_DYN_LINK #define BOOST_TEST_MODULE pevUnitTest #include BOOST_AUTO_TEST_CASE( TesterTest ) { …
Billy ONeal
  • 104,103
  • 58
  • 317
  • 552
4
votes
4 answers

When to use manual registration in Boost Test library?

I always used automatic registration with Boost Test. Now I wonder, what manual registration is for ? Are there cases that automatic registration cannot handle ? Additional remark, this time I will use turtle for mocks as well. Edit: Seems that my…
Thelvyn
  • 264
  • 3
  • 8
4
votes
1 answer

Should i put unit tests in a separate library? Separate subdirectory?

I have a large library of code which has a few (much too few) unit tests; i am adding code to the library, trying to make unit tests for the new code (i also want to add unit tests for old code in future, when i get more experienced). We currently…
anatolyg
  • 26,506
  • 9
  • 60
  • 134
3
votes
1 answer

Documenting Boost.Test test cases

Is there any way to use documentary comments for test-cases defined using Boost.Test macros ? Can I use Doxygen-styled comments, will they be parsed correctly?
Marc Andreson
  • 3,405
  • 5
  • 35
  • 51
3
votes
1 answer

Difference between boost.test headers

What is the difference between the headers boost/test/unit_test.hpp and boost/test/included/unit_test.hpp? Both appear to work in my project and I am unsure which I should be using.
Jim Jeffries
  • 9,841
  • 15
  • 62
  • 103
3
votes
1 answer

Use several test files with Boost.Test and modern CMake

I am trying to use Boost.Test (v1.69.0) with modern CMake (v3.15.0) to write and build my unit tests. The main difficulty is to split my tests in several test files: in this case Boost.Test cannot find tests. I use the Boost distribution provided by…
Neraste
  • 485
  • 4
  • 15
3
votes
1 answer

Boost unit test in separate cpp files

I want to separate my Boost unit tests into separate .cpp files (e.g. Test1.cpp, Test2.cpp, Test3.cpp ... etc) So that I do not have 1000 tests in a single cpp file. So far I have been getting all kinds of errors when I try to…
ivCoder
  • 49
  • 3