Visual Studio test explorer doesn't find my Boost Tests

Viewed 1060

I'm using Visual Studio Enterprise 2017, version 15.9.12. on a Windows 7 64bits.

I'm trying to run my boost test using Test Explorer, but it doesn't appear on it.

Test Adapter for Boost.Test is installed.

Boost is also installed (I have following the instructions from: How to use Boost.Test for C++ in Visual Studio).

I have installed the Boost.Test dynamic library.

The code for the test file is:

#define BOOST_TEST_MODULE mytests
#include <boost/test/included/unit_test.hpp>

BOOST_AUTO_TEST_CASE(myTestCase)
{
  BOOST_TEST(1 == 1);
  BOOST_TEST(true);
}

On Test Explorer, when I click on Run All I get the following warning:

The debug symbols could not be found for "AstroTime.Test.exe". To make use of the "--list_content" detection, make sure that the debug symbols are available or use '<ForceListContent>' through a .runsettings file.

And after that message I get the following Informational message:

Test Adapter for Google Test: starting the execution of tests ...

But I haven't used any Google Test template.

I have tried to recompile it, but without success.

What do I have to do to see the boost tests on Test Explorer?

1 Answers

I have found the answer at the visual studio developer community: "Tests: Could not locate debug symbols".

I have added a file inside the test project folder with the extension .runsettings and the contents:

<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<BoostTest>
<ForceListContent>true</ForceListContent>
</BoostTest>
</RunSettings>

Then, I have followed this instructions: Configure unit tests by using a .runsettings file.

And now it works.

Related