KratosMultiphysics / Kratos

Kratos Multiphysics (A.K.A Kratos) is a framework for building parallel multi-disciplinary simulation software. Modularity, extensibility and HPC are the main objectives. Kratos has BSD license and is written in C++ with extensive Python interface.
https://kratosmultiphysics.github.io/Kratos/
Other
1.01k stars 244 forks source link

[GTest] How do i debug a c++ test with Gtest? #12607

Open aronnoordam opened 1 month ago

aronnoordam commented 1 month ago

When I run a c++ test with gtest, the test runs, but my breakpoints are not hit.

How can I make sure my breakpoints are hit?

I've build everything with the debug configuration

loumalouomega commented 1 month ago

First I would use filter to run just the test you are trying to debug.

./you_application_test --gtest_filter="*your_test_name*"

For the rest it works as any gtest, so i guess should be --gtest_break_on_failure

aronnoordam commented 1 month ago

I've already used both suggestions, but it doesnt work.

For clarification, im using pycharm to start the Gtest process, then in visual studio I attach to my python process

This workflow works for me when running MainKratos.py, but not when running the c++ tests