Boost Unit Test Adapter (Beta 5)

Free

The Boost Unit Test Adapter extension has been developed for the Visual Studio 2012 and Visual Studio 2013 Test Explorer window to allow integrated test execution under Visual Studio 2012 and Visual Studio 2013.

(8) Review
Visual Studio
2013, 2012
Download (2,343)
1/28/2015
0.9.4
View
E-mail Twitter del.icio.us Digg Facebook
Add to favorites
Description
Reviews (8)
Q and A (26)
Sign in to write a review
Sort by:

by omgallnamesarealreadytaken | January 27 2015

Can run but not debug.
On VS2013, getting - An exception occurred while invoking executor 'executor://boosttestexecutor/v1': Object reference not set to an instance of an object.

Tried to install from file and from the update menu. Doesn't seems to help

by gelo_mc | January 19 2015

Test discovery and execution no longer working after update to Beta 4. I'm using VS2012

ETAS GmbH February 12 2015
| Edit |
Delete

working again with V0.9.4

by OT Chen | March 20 2014

Great Adapter

by Duxiez | December 09 2013

Theres a bug when the '&' sign is used in a literally

Try to use this in a test:
std::cout << "we are having some & issues " <<std::endl;

it won't work. This does work:
std::cout << "we are having some amp issues " <<std::endl;

Please fix this bug. Otherwise, nice software

ETAS GmbH February 04 2014
| Edit |
Delete

Fixed in V0.6.2

by Hrayr Babajanyan | September 10 2013

I tried version 0.1 and it didn't even load the test list.
Just downloaded and installed version 0.2, after few attempts it finally loaded the test list, but when I try to run all tests or any selection or debug a test it fails with the following message in output:
------ Run test started ------
An exception occurred while invoking executor 'executor://boosttestexecutor/v1': Object reference not set to an instance of an object.
========== Run test finished: 0 run (0:00:00.3314) ==========

ETAS GmbH November 16 2013
| Edit |
Delete

Please try V0.5.

by TGoodhew | August 19 2013

For those suffering from an object reference not set error, you can download this extension via your browser then double click on it to launch the VSIX Installer. The extension will install correctly without error.

To uninstall you can use the Extensions & Updates dialog successfully.

Tony Goodhew, Program Manager, VS Pro

ETAS GmbH May 17 2014
| Edit |
Delete

Fixed with V0.2

by Richard Weber CMT | August 13 2013

Worked great for me so far.
Hope for a new release that supports BOOST_FIXTURE_TEST_CASE macro.

ETAS GmbH August 06 2014
| Edit |
Delete

BOOST_FIXTURE_TEST_CASE is supported with V0.8 now.

by legalize | July 09 2013

This looked interesting, but I can't evaluate it fully because it crashed during installation. I then uninstalled it.

"Object reference not set to an instance of an object."

ETAS GmbH August 27 2013
| Edit |
Delete

Issue is fixed in V0.2 now

Sign in to start a discussion


  • Does this project have a homepage, issue tracker, or source code available?
    2 Posts | Last post Thu 7:07 PM
    • I've been enjoying this extension and it was key in my decision to use Boost.Test and TurtleMock at my company. I have an interest in ensuring this is a reliable and sustained project but unfortunately I haven't been able find any kind of publicly available homepage, issue tracker, or source code. Does any of this exist or is this page the only public resource?
      
      That said, I do have an issue to report, fortunately it is easy to fix. The problem is that after creating a new Boost Unit Test Project the project fails to build. The problem appears to be an unset Platform Toolset.
      
      Thank you for this extension, since we started with boost.test I've been using it almost every day.
      
      
      Visual Studio 2013
      Boost 1.53.0
      Boost Test Runner Adapater 0.9.4
      
      
    • I just wanted to add that if I change the Project template file Boost Unit Test Project.vcxproj and remove the lines containing <PlatformToolset></PlatformToolset> the problem goes away.
  • Error parsing in VS 2013?
    6 Posts | Last post Thu 6:13 PM
    • I created a console application with a simple file, boost test 1.57.0 is statically linked.
      
      #define BOOST_TEST_MODULE MyTest
      #include <boost/test/unit_test.hpp>
      BOOST_AUTO_TEST_CASE(TestA)
      {
          BOOST_CHECK_EQUAL(1, 1);
      }
      
      
      
      Boost Unit Test Adapter: Object reference not set to an instance of an object.(-2147467261)
      Boost Unit Test Adapter:    at CheckForprojectOutPut_VS13.ProjectOutputCheckerVs13.IsProjectOutputSame(Project folderOrProject, String exeName)
         at BoostTestAdapter.BoostTestDiscovererInternal.GetProjectsRecursively(String exeName, Project folderOrProject, List`1& filesInProject)
         at BoostTestAdapter.BoostTestDiscovererInternal.GetProjectsRecursively(String exeName, Project folderOrProject, List`1& filesInProject)
         at BoostTestAdapter.BoostTestDiscovererInternal.PrepareTestCaseData(IEnumerable`1 sources)
         at BoostTestAdapter.BoostTestDiscoverer.GetTests(IEnumerable`1 sources, ITestCaseDiscoverySink discoverySink)
         at BoostTestAdapter.BoostTestDiscoverer.DiscoverTests(IEnumerable`1 sources, IDiscoveryContext discoveryContext, IMessageLogger logger, ITestCaseDiscoverySink discoverySink)
      
    • You need to write tests within a project of type "Boost Unit Test Project" and not within a Console Project. With Boost 1.55.0 and Visual Studio 2013, your code fragment works fine that way.
      Note also that the adapter is not tested with Boost 1.57.0.
    • When I create a sample boost test project with template code. I get the following error upon building.
      VS 2013 Community. Boost 1.57.0.
      
      1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.targets(64,5): error MSB4018: The "VCMessage" task failed unexpectedly.
      1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.targets(64,5): error MSB4018: System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
      1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.targets(64,5): error MSB4018:    at System.Text.StringBuilder.AppendFormat(IFormatProvider provider, String format, Object[] args)
      1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.targets(64,5): error MSB4018:    at System.String.Format(IFormatProvider provider, String format, Object[] args)
      1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.targets(64,5): error MSB4018:    at Microsoft.Build.Shared.ResourceUtilities.FormatString(String unformatted, Object[] args)
      1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.targets(64,5): error MSB4018:    at Microsoft.Build.Utilities.TaskLoggingHelper.FormatString(String unformatted, Object[] args)
      1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.targets(64,5): error MSB4018:    at Microsoft.Build.Utilities.TaskLoggingHelper.FormatResourceString(String resourceName, Object[] args)
      1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.targets(64,5): error MSB4018:    at Microsoft.Build.Utilities.TaskLoggingHelper.LogErrorWithCodeFromResources(String messageResourceName, Object[] messageArgs)
      1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.targets(64,5): error MSB4018:    at Microsoft.Build.CPPTasks.VCMessage.Execute()
      1>C:\Program Files (x86)\MSBuild\Micr
    • I have tried boost 1.55.0 and got the same error. Here is my VS info.
      
      Microsoft Visual Studio Community 2013
      Version 12.0.31101.00 Update 4
      Microsoft .NET Framework
      Version 4.5.51641
      
      Installed Version: Professional
      
      Team Explorer for Visual Studio 2013   
      Microsoft Team Explorer for Visual Studio 2013
      
      Visual Basic 2013   .....
      Microsoft Visual Basic 2013
      
      Visual C# 2013   ....
      Microsoft Visual C# 2013
      
      Visual C++ 2013   ....
      Microsoft Visual C++ 2013
      
      Visual F# 2013   ....
      Microsoft Visual F# 2013
      
      Visual Studio 2013 Code Analysis Spell Checker   ....
      Microsoft® Visual Studio® 2013 Code Analysis Spell Checker
      
      Portions of International CorrectSpell™ spelling correction system © 1993 by Lernout & Hauspie Speech Products N.V. All rights reserved.
      
      The American Heritage® Dictionary of the English Language, Third Edition Copyright © 1992 Houghton Mifflin Company. Electronic version licensed from Lernout & Hauspie Speech Products N.V. All rights reserved.
      
      Windows Phone SDK 8.0 - ENU   ......
      Windows Phone SDK 8.0 - ENU
      
      Application Insights Tools for Visual Studio Package   1.0
      Application Insights Tools for Visual Studio
      
      Common Azure Tools   1.3
      Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
      
      Microsoft Azure Mobile Services Tools   1.3
      Microsoft Azure Mobile Services Tools
      
      NuGet Package Manager   2.8.50926.663
      NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.
      
      PowerShell Tools   1.3
      Provides file classification services using PowerShell
      
      PreEmptive Analytics Visualizer   1.2
      Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.
      
      Windows Phone 8.1 SDK Integration   1.0
      This package integrates the tools for the Windows Phone 8.1 SDK into the menus and controls of Visual Studio.
    • I tested this against VS 2013 Ultimate Update 4 - same issue.
      
      Microsoft Visual Studio Ultimate 2013
      Version 12.0.31101.00 Update 4
      Microsoft .NET Framework
      Version 4.5.51641
      
      Installed Version: Ultimate
      
      Architecture and Modeling Tools  
      Microsoft Architecture and Modeling Tools
          
      UML® and Unified Modeling Language™ are trademarks or registered trademarks of the Object Management Group, Inc. in the United States and other countries.
      
      Team Explorer for Visual Studio 2013   
      Microsoft Team Explorer for Visual Studio 2013
      
      Visual Basic 2013   
      Microsoft Visual Basic 2013
      
      Visual C# 2013   
      Microsoft Visual C# 2013
      
      Visual C++ 2013  
      Microsoft Visual C++ 2013
      
      Visual F# 2013  
      Microsoft Visual F# 2013
      
      Visual Studio 2013 Code Analysis Spell Checker  
      Microsoft® Visual Studio® 2013 Code Analysis Spell Checker
      
      Portions of International CorrectSpell™ spelling correction system © 1993 by Lernout & Hauspie Speech Products N.V. All rights reserved.
      
      The American Heritage® Dictionary of the English Language, Third Edition Copyright © 1992 Houghton Mifflin Company. Electronic version licensed from Lernout & Hauspie Speech Products N.V. All rights reserved.
      
      Windows Phone SDK 8.0 - ENU   
      Windows Phone SDK 8.0 - ENU
      
      Common Azure Tools   1.3
      Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
      
      Microsoft Azure Mobile Services Tools   1.3
      Microsoft Azure Mobile Services Tools
      
      NuGet Package Manager   2.8.50926.663
      NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.
      
      PowerShell Tools   1.3
      Provides file classification services using PowerShell
      
      PreEmptive Analytics Visualizer   1.2
      Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.
      
      Release Management 
    •     1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.targets(64,5): error MSB4018: System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
      
      I was getting this error as well, I fixed it by setting the Platform Toolset. I guess the project template doesn't set this value which seams like a bug. I am running VS2013, boost.test 1.53.0, and Adapter Beta 5.
  • Visual Studio 15
    9 Posts | Last post Thu 1:51 AM
    • It's a really nice and helpful plugin. I'm planning to migrate to Visual Studio 15. Will be new studio version support expected? 
    • Hi,
      after Visual Studio 2015 is released, we will discuss internally and decide whether we will support Visual Studio 2015 or not. But the chances are quite good ;-)
    • Some extensions like Git Tools, Visual Assist are already working on alpha. I think it will be a good idea to adapt adapter to new VS branch, if extension API isn't changed dramatically.
    • This is a fantastic plugin and I was using it heavily on Visual Studio 2013. Now I have moved to 2014 for the support of C++14 and other stuff. It will be really really help to evaluate if we get this plugin support for evaluating.
    • After the Christmas break we will decide how to proceed and when we plan to support Visual Studio 2015.
    • Hello, Is there any momentum on supporting Visual Studio 2015? Having this plug-in will help in evaluating Visual Studio 2015 for my company's use. I am fine to take a developer release to test as well. Please let me know.
    • So, how about 15 version support? Have you any progress?
    • Not yet, sorry. We will wait until Visual Studio 2015 is released in the final (not preview) version.
    • Ok. Will wait final release.
  • Error while executing tests: The given key was not present in the dictionary.
    7 Posts | Last post Wed 10:03 AM
    • Hi,
      
      I'm using the latest Boost Unit Test Adapter version (0.9.2 ) with VS2013 update 4. I can't run any test successfully. I always got the following error:
        Boost Unit Test Adapter: Error while executing tests: The given key was not present in the dictionary.
        The following test could not be executed:   -> Can_do_something
      
      Also, it would be nice to group tests by "project" and then by "traits". When working with large solution with multiple test projects, only one grouping level is not enough.
      
    • Hi,
      for grouping we rely on the functionality of the test explorer in Visual Studio. Here it is not possible to group in different levels. So, we can only offer the grouping modes Visual Studio offers.
      Regarding the problem with your unit test "Can_do_something", I need more information: can you post the beginning of the test, so how the BOOST_TEST_CASE macro is used and how it is embedded in the file:
      - Are there any #ifdefs used?
      - Do you use more than one lever of test suites?).
      I don't need the actual test code, only the scaffolding of the test within the test file.
    • Sorry for the delay. I just tested with 0.9.3 and I have the same issue.
      
      There's no special #ifdefs.
      The project is a console project built with VS2013
      
      The exact output is:
      ------ Run test started ------
      Executing:   -> should_handle_empty_stop_time
      Error: The given key was not present in the dictionary.
      ========== Run test finished: 0 run (0:00:00,2230223) ==========
      
      The test scaffolding:
      BOOST_AUTO_TEST_SUITE(CalendarHelperTests)
      
      BOOST_AUTO_TEST_CASE(should_handle_simple_periods)
      {
      }
      
      BOOST_AUTO_TEST_CASE(should_handle_over_night_periods)
      {
      }
      
      BOOST_AUTO_TEST_CASE(should_handle_empty_start_time)
      {
      }
      
      BOOST_AUTO_TEST_CASE(should_handle_empty_stop_time)
      {
      }
      
      BOOST_AUTO_TEST_SUITE_END()
      
    • You need to write tests within a project of type "Boost Unit Test Project" and not within a Console Project. I tested your code fragment with Boost 1.55.0 and Visual Studio 2013, it works fine.
    • I didn't notice there was such a project type. I tested and it works.
      However, I have dozens of unit tests projects and recreating each one is not an option. Could you tell how this project type differs from standard console project so I can update my projects. I looked into a vcxproj created with your template but I can't find the differences.
    • Sorry the the delayed response.
      
      I just tried your code scaffold within a normal console project (exe, default settings when creating it). It works fine, so all 4 unit tests are shown in the test explorer and can be executed successfully. Expecially the stdafx files needed to be modified compared to the default state after creating a new project:
      - add the header to Boost library (stdafx.h)
          #include <boost/test/unit_test.hpp>
      - define boost test module (stdafx.cpp)
          #define BOOST_TEST_MODULE MyTest
      These settings don't need to be edited when using the provided "Boost Unit Test Project". But except that there is no obvious difference between a normal console project and the project we provide. So you don't need to replace the existing projects by the "special" ones.
      If you add a new file to your test project, I recommend using the provided "Boost Unit Test File" template. It makes the start easier, I think.
    • I have this same problem. 
      
      my project is of boost type and the only change i had to do is to make it a multi-byte character set project. each of my files has the structure:
       TEST_SUITE( X )
           |-- TEST_CASE( A1 )
           |-- TEST_CASE( A2 )
           |-- TEST_CASE( A3 )
      
      And the only extra thing I have tried is to delete the testCaseCollection.xml that contains this dictionary so it gets regenerated on compilation. 
      
      Please help me with this situation, because i dont know what more to do.
  • Test Explorer list is empty
    2 Posts | Last post Wed 7:24 AM
    • I have a Visual Studio Premium 2013 update 3 and a Boost Unit Test Adapter (Beta 5). 
      I can not see the test list in Test Explorer. I have tried opening a playlist saved for me and test list is empty. Everything builds correctly and I can run tests successfully from cmd. Do you have any suggestions? 
    • Can you give me some more information regarding the project you created:
      - Did you use the provided template project "Visual C++ -> Test -> Boost Unit Test Project" when you added a new project to your solution?
      - Did you use the provided test case template "Visual C++ -> Test -> Boost Unit Test File" when you added a new file to your project?
      - How did you structure the tests within a file? Note that currently it is not supported to use several levels of test suites, only a structure as shown in the following is supported:
         TEST_SUITE( X )
           |-- TEST_CASE( A1 )
           |-- TEST_CASE( A2 )
           |-- TEST_CASE( A3 )
  • Most of my cases are not running
    2 Posts | Last post Tue 4:31 PM
    • some of my test run and others of them don't run due, even if there are all in the same project (boost test type):
      
      Executing:   -> ______________________________________
      Error: The given key was not present in the dictionary.
      
      I think there are some problems with the testCaseCollection.xml, is there anyway to fix this issue?
    • actually i have solved part of my problems, but what is happening is when i execute not all my test are run this is the debug message i get
      An exception occurred while invoking executor 'executor://boosttestexecutor/v1': Call was rejected by callee. (Exception from HRESULT: 0x80010001 (RPC_E_CALL_REJECTED))
  • display BOOST_TEST_MESSAGE
    3 Posts | Last post January 30, 2015
    • I am not sure where the BOOST_TEST_MESSAGE("my message") message goes to.  Even I set BOOST_TEST_LOG_LEVEL=test_suite as my environment variable.  The message does not appear in the "Output" window.  
      Is there a way to display BOOST_TEST_MESSAGE("my message") message in the "Output" window or somewhere?
      Thank you very much.
    • BOOST_TEST_MESSAGE is a macro to write user log message. Our adapter only logs test suite messages. So you can only see your messages when executing the tests from command line with the parameter --log-level=message.
      See here for more information:
      http://www.boost.org/doc/libs/1_43_0/libs/test/doc/html/utf/user-guide/test-output/BOOST_TEST_MESSAGE.htmt
      http://www.boost.org/doc/libs/1_57_0/libs/test/doc/html/utf/user-guide/runtime-config/reference.html for more information
    • When I am writing test cases, I may want to temporarily print out some values by using BOOST_TEST_MESSAGE(). Unfortunately, the command line is rather clumsy. I think your tool is great because it give you visual view.  In addition, one can run tests by mouse clicks.
      
      It would be nice if the log_level is configurable. Or does it make sense to add an additional right mouse click selection, like "Run Selected Tests (log_level=test-suite)"?
  • Failure message escaped
    2 Posts | Last post December 19, 2014
    • Hi, 
      
      First of all the extension is great. The gripe I have is a minor one, but I suspect it might be a relatively simple fix. 
      
      In the Test Explorer, assertion messages are still coming out with some characters escaped, for example:
      
         BOOST_REQUIRE_LT(before, after)
      
      Displays:
      
         critical check before &lt; end failed [ 0 &gt;= 0 ]
      
      It's not the end of the world but it would make the message more readable if it displayed:
      
         critical check before < end failed [ 0 >= 0 ]
      
      Great tool otherwise!
      
    • Hi,
      thank you for your comment. We also observed this issue, but since it really is a minor one, we did not put any effort in fixeing it. I cannot say until when we will have this issue fixed, but since it is easy to fix, the date might not be too far in the future ;-)
  • Question about headers
    2 Posts | Last post December 11, 2014
    • Hey your plugin has been working great for me so far when I had my set of unit tests in seperate cpp files (and thus seperate executables). To make code coverage calculation a bit easier, i've decided to merge my test suites together in 1 big project; by putting the tests in a .hpp file, and having a main.cpp file that includes them all. However the plugin does not pick up the tests anymore. Is this a known issue?
    • Hi,
      the problem is that the part which is responsible for finding unit tests (a simple parser) expects tests to be in .cpp files. So, .hpp files will not be parsed for unit tests and, therefore, no unit tests can be found in your case.
  • Log file
    4 Posts | Last post October 24, 2014
    • Hi,
      
      I tested your adapter and it looks promising. All our tests are discovered but when I want to run tests it just outputs:
       -- Run test started -- 
      and then a few seconds later 
      -- Run test finished: 0 run
      
      Since we use a pretty complex build system it would be nice to have a log file where your adapter tells me a bit more about what went wrong. Is there such a file and if yes where is it? Or do you have any idea what could be the problem? 
      
      Thanks
    • Okay so I adjusted some environment variables and now most of the tests run. However I have one group of tests which use the BOOST_AUTO_TEST_CASE_TEMPLATE macro. These tests are nicely detected and even list a test case for each type which is great. But when I want to run them there is an error:
       
      Boost Unit Test Adapter: Error while executing tests: StartIndex cannot be less than zero.
      Parameter name: startIndex
      
      
    • I tried to reproduce the issue you described and can give you the following hints:
      Using the following example code I was able to successfully execute the unit tests:
      
        typedef boost::mpl::list<int, long, double> testTypes;
        BOOST_AUTO_TEST_CASE_TEMPLATE( TypeTest, T, testTypes )
        {
             BOOST_REQUIRE_EQUAL( sizeof(T), unsigned(4));
        }
      
      Also, if you wrap the test case within a test suite, it works fine.
      But it is important that you avoid using ifdefs because the parser, which is responsible for finding test cases within a source code file, is not able to handle ifdefs correctly. 
      
      If, for example, you use the following code snippet (the XXX is not set in the project properties)
      
        #ifdef XXX
        // ...
        // source code from above
        // ...
        #endif
      
      the tests cases will be displayed in the test explorer (which is wrong), but they are not been "compiled into" the executable (which is correct), resulting in the error you described.
      This is a known limitation of the adapter. We are working on a solution for that issue.
    • Thank you for the quick answer. Although the test file does not contain any ifdefs and I removed all ifdefs from the test fixture the same errors still occur. I looked through some of the included files and there are many ifdefs so I am not completely sure if this is the problem or not. Also all the testcases listed in the testexplorer are executed if I run the executable directly.  
      
      
      I will try again when you added support for ifdefs.
1 - 10 of 26 Items