[GeoMechanicsApplication] Improved handling of unit tests that need to run conditionally#13677
[GeoMechanicsApplication] Improved handling of unit tests that need to run conditionally#13677
Conversation
Use `GTEST_SKIP` rather than not compiling unit tests that need to be run conditionally. So far, several unit tests are skipped when non-debug builds are used. With these changes, the total number of unit tests that is run is identical for all build types. However, the number of skipped tests may differ.
rfaasse
left a comment
There was a problem hiding this comment.
Thanks for picking this up. In principle I agree with the changes, but I'm not too sure if it makes it clear e.g. in the pipelines why they are skipped:
Also locally, you'll always get these skipped test cases at the end (like in the first picture) without a reason being printed. Maybe we should add clearly to the names of the test that they should do something only in debug?
The new names give a hint about the reason why the tests were skipped.
markelov208
left a comment
There was a problem hiding this comment.
Hi Anne, thank you for the PR. GTEST_SKIP is better and clear approach. Do we a have a style to name unit tests?
rfaasse
left a comment
There was a problem hiding this comment.
Now indeed it's clear why these tests would've been skipped from the logging, thanks for this improvement!
Sure, it will be nice to have a certain style. In other places a class name is used and underscore to improve readability. It can be more things. |

📝 Description
Use
GTEST_SKIPrather than not compiling unit tests that need to be run conditionally. So far, several unit tests are skipped when non-debug builds are used.With these changes, the total number of unit tests that is run is identical for all build types. However, the number of skipped tests may differ.