Questions tagged [boost-test]

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

255 questions
0
votes
2 answers

How to define Boosts tests to run in code?

Using Boost.Test I'm trying to specify the BOOST_TESTS_TO_RUN environment variable in code, so that only some tests will be executed. Using #define BOOST_TESTS_TO_RUN. The command line parameter --run_tests works fine. But I'd like to do it via the…
Sergio Basurco
  • 2,998
  • 2
  • 15
  • 40
0
votes
1 answer

Explicitly specializing template, static vs. duplicate symbols

In a bunch of legacy code I have inherited, unit tests are implemented using Boost.Test. To enable checking std::wstring and icu::UnicodeString for equality via BOOST_CHECK_EQUAL(), the original author implemented explicit template specializations…
DevSolar
  • 59,831
  • 18
  • 119
  • 197
0
votes
1 answer

Boost Unit Test Framework dependencies execution order

I am trying to set dependencies in the Boost Unit Testing Framework. I have found this thread tbat has an example of how to use the test_unit::depends_on() method. So far so good, I can write some magickery around that to smooth it out. However, the…
namezero
  • 1,951
  • 3
  • 19
  • 35
0
votes
1 answer

Boost unit test Qt signal

Using Boost Unit Test framework to perform unit test on C++\Qt code. We are basically using BOOST_FIXTURE_TEST_CASE macro as shown in documentation. For each test we create an instance of QApplication to setup the event loop and enable the test code…
Lars
  • 506
  • 6
  • 12
0
votes
0 answers

What to do when an error occurs in Boost Test fixture?

I want to be able to prematurely exit a test suite (in Boost Test) from within the fixture constructor due to the possibility of errors in the initialization code (non-existent input file in particular). Should I just call exit() or is there a…
Elektito
  • 3,375
  • 4
  • 36
  • 67
0
votes
1 answer

Error while running boost test project: testcaseName: No such file or directory

I'm trying to make use of boost unit test suite. #define BOOST_TEST_DYN_LINK #define BOOST_TEST_MODULE main_test_module #include #include .... // introducing some functions and variables…
Roman
  • 1,204
  • 4
  • 15
  • 33
0
votes
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,379
  • 3
  • 22
  • 33
0
votes
1 answer

Boost.Test howto create "test dependency"

I'm using boost.test as test suite. I want to know if is possible make some prerequisite for test. For example uniqut_ptr< MyClass > g_class; BOOST_AUTO_TEST_CASE( test1 ) { BOOST_REQUIRE_NO_THROW( g_class = CreateMyClass()…
Elvis Dukaj
  • 6,441
  • 10
  • 38
  • 77
0
votes
0 answers

Difference between CLOSE and CLOSE_FRACTION

Can anybody explain the difference between BOOST_CHECK_CLOSE and BOOST_CHECK_CLOSE_FRACTION? I just skimmed through the boost.test Testing Tools Reference and I'm pretty sure that they have an equal description.
anhoppe
  • 3,441
  • 3
  • 41
  • 53
0
votes
2 answers

BOOST_CHECK_EQUAL_COLLECTIONS in Google Test

I have been trying to find an assertion in the Google C++ Testing Framework / gtest which is equivalent to the BOOST_CHECK_EQUAL_COLLECTIONS assertion found in the Boost Test Library. However; without success. So my question is two-fold: Does gtest…
safl
  • 939
  • 3
  • 10
  • 17
0
votes
1 answer

trouble building boost test with cmake

I'm rather new to C++, Boost test, and CMake, so please pardon my stumblings here. Here is my top level CMakeLists.txt cmake_minimum_required(VERSION 2.8) project(JANKEN) set ( CMAKE_CXX_COMPILER gcc ) set(CMAKE_CXX_FLAGS "-g -std=c++11 -Wall…
piyo
  • 341
  • 4
  • 18
0
votes
3 answers

Strange execution errors in application

I've got a unit test I'm writing which seems to have some kind of a pointer problem. Basically, it's testing a class that, once constructed, returns information about a file. If all the files expected are detected, then the test operates correctly.…
Billy ONeal
  • 97,781
  • 45
  • 291
  • 525
0
votes
0 answers

boost unit test cpp file can not see one object file in a library

I have a test.cpp file, written for using boost unit test. test.cpp : #define BOOST_TEST_DYN_LINK #include ......... I am trying to linking this test.cpp with a library named liba. g++ test.cpp -L/liba_directory -la …
user1470393
  • 177
  • 3
  • 12
0
votes
0 answers

link problems when using a test dll and a production dll

I want to write unit tests for internal components of a DLL, and in the testing project I can only access exported symbols. I want to test internal classes also, and I don't want to export them just for the tests. I'm using boost test, visual…
shoren
  • 911
  • 8
  • 19
0
votes
1 answer

Using BoostTest to run unit tests multiple times without quitting test runner

I want to use Boost Test to run unit tests multiple times without quitting the test runner. Here is the pseudo-code to demonstrate what I want to do: void main() { for(int i = 0; i < 10; ++i) { char *arguments[] ={…
1 2 3
16
17