Boost.Test error messages no longer appear in VS2010 error list

I am using Boost.Test Unit Test Framework for my own C ++ projects. Everything works fine, but after upgrading to Visual Studio 2010, I have one problem. Messages about failed tests no longer appear in the error list after the tests were run as a post-build step. It’s a pity, because the combination of Boost.Test with the native C ++ project has come close (although still far away) to the comfort that I'm used to from unit testing of managed projects. I use the configuration recommended by Boost.Test authors here . Can someone help with this minor but a bit tedious question?

Hi,

Floor

+7
source share
2 answers

Visual Studio 2005 build output for compiler errors is as follows:

|.\ut_TEMPLATE.cpp(8) : error C2065: 'x' : undeclared identifier 

While Visual Studio 2010 compiler errors appear in the output window:

 |1>ut_TEMPLATE.cpp(8): error C2065: 'x' : undeclared identifier 

(Edit: see gbjbaanb 's comment about >1 )

Now, cross-checking which BOOST_ERROR outputs (you can use simple printf to play if you have exe in the post build phase):

VS 2005:

 |./ut_TEMPLATE.cpp(8): error in "test_TEST": check true == false failed [1 != 0] 

VS 2010:

 |1> ut_TEMPLATE.cpp(10): error in "test_TEST": check true == false failed [true != false] 

A slight difference, but not too big and more thorough check using manual printing:

 printf("ut_TEMPLATE.cpp(00): error : in \"test_TEST\": check true == false failed [true != false]" "\n"); ^^^ .. Note colon here 

We also get VS 2010 to recognize this output as errors:

 BOOST_AUTO_TEST_CASE(test_TEST) { printf("ut_TEMPLATE.cpp(00): error : in \"test_TEST\": check true == false failed [true != false]" "\n"); BOOST_CHECK_EQUAL( true, false); } 1>------ Build started: Project: ut_TEMPLATE, Configuration: Release Win32 ------ 1> ut_TEMPLATE.cpp 1> ut_TEMPLATE.vcxproj -> ....\UnitTests\ut_TEMPLATE\..\..\..\Release\ut_TEMPLATE.exe 1> Running 1 test case... 1>ut_TEMPLATE.cpp : error : in "test_TEST": check true == false failed [true != false] 1> ut_TEMPLATE.cpp(9): error in "test_TEST": check true == false failed [true != false] 1>C:\Programme\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: The command ""....\\ut_TEMPLATE.exe" --result_code=no --report_level=no 1>C:\Programme\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: :VCEnd" exited with code -1. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== 

So, you /we/Boost.Test should configure its output so that the VS2010 IDE still recognizes the error message.

+3
source

If you do not want to wait for the release and want to fix the formatting yourself

open

BOOST_PATH \ boost \ test \ real \ compiler_log_formatter.ipp

edit (line 163 in boost_1_46_1)

 output << "error in \"" << test_phase_identifier() << "\": "; 

to

 output << "error : in \"" << test_phase_identifier() << "\": "; 

and compile boost again with bjam.

 cd BOOST_PATH bjam.exe 
+4
source

All Articles