C++test Catch2 & CMake - Invalid path to the test executable

Hey there,

I'm quite new to CMake and started a small project yesterday. Today I wanted to add some little unit-tests and had some issues making resharper++ happy. It always prompts me when I try to run the tests from my "Unit Test Explorer" or "Unit Test Session". The test executable is correctly built, but unfortunatly I'm not able to tell resharper++ where to find it.

I already found a similar topic here but that doesn't help me much, because I use CMake.

Btw, this is the error message from the log:

2019.06.23 01:38:18.299 ERROR Invalid path to the test executable. Please specify test run configuration via the project debugging properties or on the "ReSharper | Options | Tools | Unit Testing | C++ Tests" options page.
at JetBrains.ReSharper.Feature.Services.Cpp.UnitTesting.CppTaskRunner.ParsePath(String pathStr, FileSystemPath projectLocation, String description)
at JetBrains.ReSharper.Feature.Services.Cpp.UnitTesting.CppTaskRunner.GetProcessStartinfo(CppProjectTask task, String extraCommandLineArguments, Dictionary`2 environmentVariables)
at JetBrains.ReSharper.Feature.Services.Cpp.UnitTesting.Catch.CatchRemoteTaskRunner.DiscoverTests(CppProjectTask projectTask, CppTaskTreeNode rootNode)
at JetBrains.ReSharper.Feature.Services.Cpp.UnitTesting.Catch.CatchRemoteTaskRunner.RunInternal(IUnitTestRun run)
at JetBrains.ReSharper.Feature.Services.Cpp.UnitTesting.CppTaskRunner.Run(IUnitTestRun run)

I'm also not able to make it run via resharper config; perhaps I'm just a little bit dumb :D

 

greetings.

 

EDIT: Ok, got it. It seems the "command" and "working directory" paths have to be set.

2 comments
Comment actions Permalink

Hello,

Why didn't it work the first time you tried it, did you set only "Command" without setting "Working directory"?

0
Comment actions Permalink

Hey there,

yes, indeed. I specified the test.exe and the absolut path in the command field, but it didn't work. After that I played a little bit around and setup a random path in "working directory" (it doesn't have to match the path in "command"). Surprisingly this fixed my issue and the Resharper++ were able to run the test.

0

Please sign in to leave a comment.