GMock: gtest_filter ignored on Android

Issue

I am running some unit tests using GTest/GMock on Android. I have noticed that it ignores my argument of --gtest_filter=MyTestCase.MyTest – all of my tests run no matter what I put in the filter. I’ve made sure that it gets passed in to InitGoogleMock.

Has anyone managed to use --gtest_filter when running their tests on Android?

Solution

Mystery solved, --gtest_filter was my first argument, but GTest parses arguments from index 1 rather than 0, as argument 0 is expected to be the executable name in unix land :).

Answered By – Jack

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published