简体   繁体   中英

How to run Google tests (C++ unit tests) in a QNX Virtual machine, using resharper?

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.

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM