Boost Unit Test Adapter (Beta 2)

Free

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

(6) Review
Visual Studio
2012
Download (1,187)
8/6/2014
0.8
View
E-mail Twitter del.icio.us Digg Facebook
Add to favorites
Description
Reviews (6)
Q and A (15)
Sign in to write a review
Sort by:

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 Tue 8:49 AM
| Edit |
Delete

Issue is fixed in V0.2 now

Sign in to start a discussion


  • BOOST_FIXTURE_TEST_SUITE and BOOST_FIXTURE_TEST_CASE support
    1 Posts | Last post August 06, 2014
    • Hello together,
      
      Today we released the V0.8 Version with BOOST_FIXTURE_TEST_SUITE and BOOST_FIXTURE_TEST_CASE macro support.
      
      We are still working on the VS2013 support and are very close to a solution - stay tuned.
      
      Regards
  • Boost Unit Test Adapter seems not to work when test fixtures are used
    3 Posts | Last post August 06, 2014
    • I am trying to run the unit test adapter with tests using fixtures.
      When using per test case fixtures (http://www.boost.org/doc/libs/1_44_0/libs/test/doc/html/utf/user-guide/fixture/per-test-case.html) my test cases are somehow not displayed in the VS Test Explorer.
      Here is the source code I used for testing:
      
      #define BOOST_TEST_MAIN
      
      #include "stdafx.h"
      #include <boost/test/unit_test.hpp>
      #include "ObjectUnderTest.h"
      
      
      struct MyFixture
      {
      	MyFixture()
      	{
      		ObjectUnderTest = new CObjectUnderTest();
      		BOOST_TEST_MESSAGE( "setup fixture" );
      	}
      
      	~MyFixture()
      	{
      		delete ObjectUnderTest;
      		BOOST_TEST_MESSAGE( "teardown fixture" );
      	}
      
      	CObjectUnderTest* ObjectUnderTest;
      };
      
      BOOST_AUTO_TEST_SUITE(foo)
      	BOOST_FIXTURE_TEST_CASE(bar, MyFixture)
      	{
      		BOOST_CHECK(ObjectUnderTest->IsAnything() == true);	
      	}
      BOOST_AUTO_TEST_SUITE_END()
      
      I also tried to use test suite level fixtures (http://www.boost.org/doc/libs/1_44_0/libs/test/doc/html/utf/user-guide/fixture/test-suite-shared.html). In this case I got following error when running the test:
      An exception occurred while invoking executor 'executor://boosttestexecutor/v1': StartIndex cannot be less than zero.
      
      Do you have any advice how to get the test adapter running with tests that use fixtures?
      
      Thanks,
      Stefan
    • The macro BOOST_FIXTURE_TEST_CASE is not supported yet. That's why unit tests using that macro are not displayed in VS. It is on our ToDo list to support that macro in the near future.
      
    • BOOST_FIXTURE_TEST_CASE is supported with V0.8 now.
  • Class not working
    3 Posts | Last post June 30, 2014
    • using BOOST_AUTO_TEST_SUITE(foo) doesn't seem to work in latest version (test appears under "No Class"). Any idea why?
    • In general it is working. Could you give us some more details please?
    • All test suites are displayed in the category "Traits" and not in "Class". Compared to the built-in unit test framework where all tests are wrapped in classes the Boost unit test framework does not use classes but functions. Therefore "Traits" seemed to be the better place for showing test suites (and all tests within a suite).
  • Any chance to port it to VS 2013?
    7 Posts | Last post June 27, 2014
    • subj
    • Our next version will support Visual Studio 2013. You can expect a new version most likely in the next month.
    • Are there any news about the VS 2013 support?
    • Is there an update on the support for Visual Studio 2013 please?
    • Any updates on VS2013 support? :)
      
      Thanks!
    • +1, THANK YOU!
    • With Visual Studio 2013 some APIs and file formats have been changed, but I think we have a solution now. Hopefully we can publish it by end of July.
  • Source Code?
    2 Posts | Last post June 27, 2014
    • Thx for this great extension. Is there a way to get source code? I want to contribute on porting for VS 2013 and other issues.
    • We are thinking about publishing the source code in GitHub. Stay tuned.
  • Automated test on TFS
    6 Posts | Last post April 20, 2014
    • I'm trying to make the latest boost test adapter (0.7) work with VS2012 Update 4. I'm running W8.1 update 1 x64 and I am building against boost 1.53. My goal is to make the tests work with TFS 2012 build.
      
      I have trouble making the adapter work reliably in visual studio and I can't make it work at all manually;
      
      I've now created a minimal test project with a single suite with a single failing test, it will sometimes work in visual studio from the test explorer but I cannot make it work through vstest.console.exe in any form, I've tried X64 and X86 they both give the same error;
      
      Error: An exception occurred while invoking executor 'executor://boosttestexecutor/v1': Object reference not set to an i
      nstance of an object.
      
      What I'm trying to run is the following (in the correct output dir of course)
      
      vstest.console BoostUnitTests.exe /Platform:X86 /UseVsixExtensions:true  /InIsolation
      
      or
      
      vstest.console BoostUnitTests.exe /Platform:X64 /UseVsixExtensions:true  /InIsolation
      
      Any hints on what I'm doing wrong or how to make this work or get some kind of diagnostics output? I've tried DebugView/FusLogVw etc, but I've come up with nothing that helps.
      
      Please advice, I'm at the verge of building my own adapter now :)
      
      
      
      
      
      
    • I've just discovered that the adapter is in fact crudely parsing the C++ files to discover tests, I was under the impression that the adapter utilized the generated exe to list/execute tests. I'm starting to understand why this does not work now. I also noticed that this parsing is directly implemented in the test adapter and there is apparently no intermediate files (e.g. xml) or tiers that would make this more modular, is that correct? I.e. the adapter will always depend on the source code to be available during discovery?
    • After doing a bit of research, may I offer my humble suggestions to work around some of the issues I discovered;
      
      1. AFAIC understand the adapter depends on the VS IDE to work;
       - Allow a "preprocessor" mode, where a pre-generated test database is loaded from e.g. an XML file, this will allow "discovering" and executing tests via vstest.console etc. and also enable automatic tests in TFS builds, with a bit of work.
      2. Separate the "preprocessor" test discoverer into an assembly which can be run separately as well as from the adapter.
      - Allow pre-generated test database to be generated both from the IDE and possibly manually or from e.g. msbuild.
      
      When Boost Test gets the ability to list/discover tests in the near future, the pre-generated file can be directly generated/converted. Apparently this is already implemented according to the author;
      
      http://stackoverflow.com/questions/8550704/boost-unit-test-list-available-tests
      
      Thanks :)
    • Hi Thomas,
      
      first of all, thank you for your elaborate comment on the Boost Unit Test extension for Visual Studio.
      When reading through your comment, I wondered why you want to use the tool vstest.console.exe for executing your Boost unit tests. This is not necessary since all Boost tests are deployed in an executable which can run without any other tool such as vstest.console.
      For additional test output, please refer to
      http://www.boost.org/doc/libs/1_53_0/libs/test/doc/html/utf/user-guide/runtime-config.html
      
      or
      
      http://www.boost.org/doc/libs/1_53_0/libs/test/doc/html/utf/user-guide/runtime-config/reference.html
    • Regarding the discovery of unit tests, the C++ sources are required. We wait until Boost Test is able to list/discover tests, then we will modify our parsing algorithm.
    • I'm aware of the fact that I can run the boost unit test executable to get the output directly, but Team Foundation Server builds already has support for running automated tests through the Visual Studio Test Runner in the default build template and has a special UI section for tests. Other (.Net) unit test projects and VS C++ unit test project support this mechanism already, and therefore integrate with TFS build automatically. The boost unit test adapter would IMHO be more useful if it also supported this use-case.
      
      Running the exe directly from a TFS build process template and make it integrate with the build as other unit tests does would require creating a unit test adapter that would parse the output from the exe, which your adapter already does :)
  • Tests not loaded
    8 Posts | Last post March 21, 2014
    • When I create tests, they are not loaded by the adapter, nor do they appear in the Test Explorer.
      
      The test project is created in an empty solution and the only change is that BoostUnitTest.cpp contains the line BOOST_CHECK(true). The project links against libboost_unit_test_framework-vc110-gd-1_55.lib, and the executable can run with no issue (reports two test cases, both tests succeed). The configuration is Debug|x64, and the only changes from default are the Boost library to use, and library and include directories. I am using Visual Studio 2012 Premium Update 4 and version 0.6.2 of the adapter. I have tried installing the extension both through the Visual Studio GUI and using the downloaded vsix.
      
      On a side note, when I create a new boost test project, I get the following error: 
      
      "The file targetver.h could not be found within the project templates. continuing to run, but the resulting project may not build properly."
      
      This is the test output:
      
      ------ Discover test started ------
      ========== Discover test finished: 0 found (0:00:00,0858069) ==========
      
      
    • Where can I get Alpha 5? It worked better.
    • With version 0.6.3, the "targetver.h" issue is fixed.
    • @timme25: What worked better in Alpha 5?
    • @Etas GmbH (stimm)
      Tried it out, and the targetver.h issue is fixed, however, the tests are still not found by the adapter. Is there any additional info that you need to debug the issue?
    • My experience is also that Alpha 5 worked better, Alpha 6 cannot list the test any more i.e. tests do not show up in test explorer
    • @Morten Already In Use:
      I checked the issue you described with Alpha 5 and Alpha 6. In both versions there is a problem when using 64-bit configurations.
      We will analyze the issue and fix it asap.
    • Version 0.7 (Beta 1) now supports 64-bit platforms.
  • Supporting 64-bit solution platform setting
    1 Posts | Last post March 21, 2014
    • Hi,
      
      Version 0.7 is supporting 64-bit solution platform setting now.
      
      Regards,
  • Visual Studio 2013 support
    1 Posts | Last post March 03, 2014
    • Hi,
      
      The current plugin version 0.6.3 does not work with Visual Studio 2013. We are working on this issue.
      
      Regards,
  • Tests load failure
    2 Posts | Last post February 13, 2014
    • Hi
      
      I'm getting the error below while the adapter is trying to load tests from solution (multiple test projects), subsequently only part of tests are loaded.
      
      ---
      
      An exception occurred while test discoverer 'BoostTestDiscoverer' was loading tests. Exception: An item with the same key has already been added.
      
      ---
      
      Could you advise me a work around? Is it possible to tackle the problem in a bugfix release? ;)
      
      Best regards
      
      PT
    • I need some more information about the issue you described:
      - Do you use the same test case name twice?
      - Do you use the same test suite name twice?
1 - 10 of 15 Items