question

ginusam-0519 avatar image
0 Votes"
ginusam-0519 asked DylanZhu-MSFT answered

Does unit test written in CPPUnit and running in Visual Studio 2019 generate a log


The unit test written in CPPUnit and running in VS 2019, gives the following error message
"
Message:
Failed to set up the execution context to run the test
"
The error is thrown before the execution of the test starts.

Since the error message does not say what is the actual cause of the error, it would be good to get some logging data if available which can help in identifying the cause of the error.

So is there a log file that is created by VS when running the test


vs-testing
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

DylanZhu-MSFT avatar image
0 Votes"
DylanZhu-MSFT answered

Hi ginusam,

After my research, the cppunit test cannot generate log file which is like activity log in VS IDE. Maybe you can use Logger::WriteMessage method to look for where the error throws.

In addition, I find a similar thread with same error message, maybe it can help you: https://stackoverflow.com/questions/51226286/failed-to-set-up-execution-context-when-running-vc-unit-test-with-external-d/51239176

Best Regards,
Dylan


If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.