Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugging Environment not set #2

Open
lisona opened this issue Feb 3, 2014 · 3 comments
Open

Debugging Environment not set #2

lisona opened this issue Feb 3, 2014 · 3 comments

Comments

@lisona
Copy link

lisona commented Feb 3, 2014

The settings from Properties-->Configuration Properties-->Debugging-->Environment are not used when running the tests (VS2012). In our project the environment contains additional path to load external libraries. GoogleTestRunner fails, when trying to detect the tests contained in the executable, because it cannot start the exe due to missing libraries. Unfortunately all possible error messages are swallowed too, which makes finding the cause considerably hard.
Is it possible, that the debugging environment is set during discovery of tests and possible error messages are displayed to the user?

@markusl
Copy link
Owner

markusl commented Feb 3, 2014

Hello lisona.

I've encountered the described problem myself, but haven't found any answer yet. This seems to be a limitation in Microsoft API. The code used so launch debugger is found at https://github.com/markusl/GoogleTestRunner/blob/master/GoogleTestRunner/GoogleTestExecutor.fs#L23

I don't know the internals of "LaunchProcessWithDebuggerAttached", but i suspect it should use the same debugger settings user has specified in the IDE.

Regards,
Markus

@lisona
Copy link
Author

lisona commented Feb 3, 2014

Hello Markus,
I see what you mean. For me the problem starts already at discovering the tests, because this involves calling the executable with "--gtest_list_tests". It tries to load the library and crashes, because it cannot load a lib due to missing environment settings.
It tried to find the code involved:
In GoogleTestDiscoverer.fs (line 60) you calling the ProcessUtil.getOutputOfCommand which starts the test-executable to discover all tests. Probably you could pass an additional "EnvironmentVariables=..." to ProcessStartInfo? Same with framework.LaunchProcessWithDebuggerAttached in GoogleTestExecutor.fs. I could not find any official documentation, but it seems to me, that the arguments are as follows: LaunchProcessWithDebuggerAttached(filePath, workingDirectory, arguments, environmentVariables), where "environmentVariables" are probably the Debug->Environment-Settings. I just don't know where you get these settings from. Is it part of the whatever-MS-Test-API?

I am a bit emberassed that I can't help any further, but I am neither a VS nor F# or .Net specialist. I don't even have VS2013, which is required to build the GoogleTestRunner.

Kind regards,
André

@delaitre
Copy link

delaitre commented Mar 9, 2015

Just to say, I suffer the same problem here. The PATH is setup with paths to our dlls and thus need to be used in order to have the executable working...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants