Boost logo

Boost Testing :

From: Voronkov Konstantin (beowinkle_at_[hidden])
Date: 2005-07-28 06:22:45


Hello, All!

I developed Test Case which is run under Boost Regression
  Tests? The Test Case is build based on Boost.Test Automatic
Registration facility. The test consist of checks which should
fail. As result of bjam invokation of Test Case I see there is
no error which I expect. There is also no output to console,
even if I output some data in the Test Case.

Is it possible to use Boost.Test automatic registration
  facility together with Boost Regression Tests?

*****This is the content of the Test Case(autoRegTestsSample.cpp)
#define BOOST_AUTO_TEST_MAIN
#include "boost/test/auto_unit_test.hpp"
#include "boost/test/included/unit_test_framework.hpp"
#include "boost/test/unit_test_log.hpp"

BOOST_AUTO_UNIT_TEST(testEqual)
{
   // HERE I EXPECT SOME OUTPUT TO CONSOLE
   std::cout << "autoRegTestsSample" << std::endl;
   BOOST_MESSAGE("message in TestEqual");
   const long l = 3;
   BOOST_CHECK_EQUAL(l, 3L);
}

BOOST_AUTO_UNIT_TEST(testError)
{
   BOOST_WARN("warning 1");
   // HERE I EXPECT ERROR
   BOOST_ERROR("invoking error 1");
}

*****This is bjam output

...found 377 targets...
...updating 5 targets...
vc-C++
..\..\bin\boost\myTest\test\autoRegTestsSample.test\vc7\debug\threading-multi\autoRegTestsSample.obj
autoRegTestsSample.cpp
vc-Link
..\..\bin\boost\myTest\test\autoRegTestsSample.test\vc7\debug\threading-multi\autoRegTestsSample.exe
LINK : LNK6004:
..\..\bin\boost\myTest\test\autoRegTestsSample.test\vc7\debug\threading-multi\autoRegTestsSample.exe
not found or not built by the last incremental link; performing full link
execute-test
..\..\bin\boost\myTest\test\autoRegTestsSample.test\vc7\debug\threading-multi\autoRegTestsSample.run
The system cannot find the file specified.
         1 file(s) copied.
**passed**
..\..\bin\boost\myTest\test\autoRegTestsSample.test\vc7\debug\threading-multi\autoRegTestsSample.test
...updated 5 targets...
...found 377 targets...
...updating 3 targets...
vc-Link
..\..\bin\boost\myTest\test\autoRegTestsSample.test\vc7\debug\threading-multi\autoRegTestsSample.exe
LINK : LNK6004:
..\..\bin\boost\myTest\test\autoRegTestsSample.test\vc7\debug\threading-multi\autoRegTestsSample.exe
not found or not built by the last incremental link; performing full link
execute-test
..\..\bin\boost\myTest\test\autoRegTestsSample.test\vc7\debug\threading-multi\autoRegTestsSample.run
The system cannot find the file specified.
         1 file(s) copied.
**passed**
..\..\bin\boost\myTest\test\autoRegTestsSample.test\vc7\debug\threading-multi\autoRegTestsSample.test
...updated 3 targets...

Best Regards,
Voronkov Konstantin


Boost-testing list run by mbergal at meta-comm.com