Death tests on Android?

79 views
Skip to first unread message

Don Turner

unread,
Mar 8, 2018, 5:12:22 PM3/8/18
to Chromium-dev, Victor Costan
I'm using Google Test to run unit tests on an Android app. On trying to run a death test I found that GTest doesn't support ASSERT_DEATH on Android Issue: https://github.com/google/googletest/issues/1496

Victor (cc'd) mentioned that the Chrome team are able to run death tests on Android, so I'm interested to know: 

#1 How these tests are run
#2 Whether there's any possibility of integrating this feature back into GTest so that other developers can benefit

Any help greatly appreciated. 

Thanks, 

Don

Daniel Cheng

unread,
Mar 9, 2018, 2:00:03 PM3/9/18
to dont...@google.com, Chromium-dev, Victor Costan
My understanding is standard practice in Chromium is to simply use {ASSERT,EXPECT}_DEATH_IF_SUPPORTED, which is a no-op on Android? https://cs.chromium.org/chromium/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-port.h?rcl=703b4a85a21e394252560a89cc856b384b48c286&l=824

Daniel


--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/4817094d-2751-463b-8657-e5d56038a968%40chromium.org.

Victor Costan

unread,
Mar 9, 2018, 2:09:56 PM3/9/18
to Daniel Cheng, dont...@google.com, Chromium-dev, Victor Costan
https://cs.chromium.org/chromium/src/base/process/memory_unittest.cc uses ASSERT_EXIT in OutOfMemoryDeathTest.

I ran into this while working on a googletest roll. Those tests definitely run on Android: https://ci.chromium.org/buildbot/tryserver.chromium.android/android_n5x_swarming_rel/363182

If we don't support death tests on Android at all, that'd be very useful to know! We're currently running death tests using an older style (fast) instead of the recommended way (threadsafe), and the two blockers are figuring out the Android situation (biggest) [1], and figuring out a couple of Crashpad failures on Mac [2].

Thank you,
    Victor


[1] Observe failures by patching in https://crrev.com/c/939850 and tweaking slightly


Reply all
Reply to author
Forward
0 new messages