Nils
Nils

Reputation: 13777

Google Test Framework on Windows check if you are running interactively

I am using the google test framework on windows either interactively within Visual studio or non-interactive on a build server. When running interactively I have set the environment variable GTEST_CATCH_EXCEPTIONS=0 so I land in the debugger in case of an exception on the build server this is set to 1.

Now I wonder how I can figure out weather this is set or not inside a test. This could certainly be done using the Windows API, but I think the google test framework configuration could also be accessed directly somehow, just could not figure so far.

Upvotes: 3

Views: 976

Answers (1)

Fraser
Fraser

Reputation: 78378

You can use the bool variable testing::GTEST_FLAG(catch_exceptions) to determine this.

Upvotes: 1

Related Questions