p-org / PSharp

A framework for rapid development of reliable asynchronous software.
MIT License
390 stars 37 forks source link

Issue using /coverage:code #469

Closed ankushdesai closed 5 years ago

ankushdesai commented 5 years ago

I am trying to run PSharpTester with the /coverage:code option and am getting the following error:

Error: [PSharpTester] 'VSInstr' tool 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Team Tools\Performance Tools\x64\vsinstr.exe' not found.

I have the vsinstr installed in the following path: D:\Microsoft Visual Studio\2017\Professional\Team Tools\Performance Tools\x64

I tried to run PSharpTester from the Developer Command Prompt and made sure that vsinstr in the path.

ankushdesai commented 5 years ago

Does it have something to do with the paths being hard-coded in the App.Config file?

pdeligia commented 5 years ago

I don't think this is a bug, but the intended current design. I believe this is related to the paths in the App.Config file, as you mentioned, and described here:

https://github.com/p-org/PSharp/blob/master/Docs/Testing/CodeCoverageVisualisation.md#code-coverage-binary-instrumentation

I think you need to override the environment variables as the above document mentions? @akashlal is that correct?

akashlal commented 5 years ago

You can set a custom path by editing the file PSharpTester.exe.config that sits alongside PSharpTester.exe

akashlal commented 5 years ago

The documentation also says that these paths can be set on the environment as well.

overridden by environment variables with the same names as the app settings:
VSInstrToolPath
VSPerfCmdToolPath

This is useful in case you do not want to edit PSharpTester.exe.config.

ankushdesai commented 5 years ago

Thanks @akashlal and @pdeligia for the quick help. I will try this and re-open the issue if it doesnt work.