2

Currently how I run my unit tests:

I have a visual studio project, which builds a C++ google test (unit test) executable.

I then copy this exe to my Virtual Machine with QNX and run it manually, to get the unit test results.

Can I use resharper to automate this?

Resharper is able to detect and list tests from test file. But on running them, it throws error as it is not able to execute the tests in Windows.

Below is the exact error, I get, on running any of the tests.

ReSharper Ultimate – Error while running unit tests: Invalid path

Can I set up resharper and Visual studio environment, so that, I can run tests directly from visual studio, which will copy the exe to the Virtual Machine and give me the execution results?

This will avoid me manually copy pasting the exe and running command to execute the tests?

I searched a lot regarding this in google. But couldn't find much help.

I'm new to google test and resharper. So any help would be greatly appreciated. Thanks in advance.

Manjunath K Mayya
  • 1,078
  • 1
  • 11
  • 20
  • Why don't you write bash file instead? which will build your unitest case project and run them. – Mayur Dec 12 '18 at 10:19

2 Answers2

1

No, I'm afraid ReSharper cannot do that out of the box.

Though it is quite powerful, so if you manage to write a script that does the VM specific part, ReSharper should be able to cope with it. What that script needs to do is:

  • It must be run on the host (Windows).
  • Copy the test binary to the QNX system in the VM.
  • Execute the test.
  • Capture the test's output and redirect it to the host's stdout.

The ReSharper options can be set here:

Menu ReSharper > Options...
In the left pane scroll down to Tools > Unit Testing > C++ Tests

In the text field Command: you need to enter the path to the script.
See https://www.jetbrains.com/help/resharper/Reference_Options_Tools_Unit_Testing_CPP_Tests.html for more details.

salchint
  • 371
  • 3
  • 10
0

I think you'll find that the msg box showing "ReSharper Ultimate – Error while running unit tests: Invalid path" has been caused by the last update to VS 2017, which has broken things. I usually run my google tests through resharper c++, and until a few days ago, it worked. Now, I see this exact same error.

tyotypic
  • 61
  • 1
  • 1
  • 8
  • Did you also use VM to run the tests? If so how did you set up resharper so that it copies the exes to VM and then execute it. Note: I cannot directly execute the tests in windows environment as I am building targets for QNX machine. – Manjunath K Mayya Nov 14 '18 at 03:47