0

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 boost?

I installed boost 1.47 from BoostPro download page, but there is no test_runner.exe there.

Thanks.

Community
  • 1
  • 1
sergtk
  • 10,714
  • 15
  • 75
  • 130

1 Answers1

2

You can build one yourself from sources. It has no extra dependencies, only Boost.Test itself.

  1. You can bootstrap boost installation
    Download source of boost, unzip and run bootstrap.bat.

  2. Then build bjam and run build command under libs/test/tools/test_runner.
    bjam.exe should exist in unpacked distribution.
    Switch current folder to libs/test/tools/test_runner and run bjam.exe from it with required parameters (platform, configuration, etc...).
    Output console_test_runner.exe will be available in bin.v2\libs\test\tools\console_test_runner

sergtk
  • 10,714
  • 15
  • 75
  • 130
Gennadiy Rozental
  • 1,905
  • 2
  • 13
  • 17
  • Gennadiy, I finally resolved my initial issue – when console_test_runner.exe catches exception and output error message, it is trimmed to 512 chars – this is limited by constant REPORT_ERROR_BUFFER_SIZE in file boost\test\impl\execution_monitor.ipp . Can you increase it, say to something like 16384? 512 is absolutely not enough, especially with template types and using BOOST_THROW_EXCEPTION to have detailed error message. I checked in boost 1.52 – it is still 512 bytes. (I am not sure if it is good idea to write this suggestion here, but I am not familiar how to make suggestions to boost) – sergtk Dec 07 '12 at 01:38