From 1c8e155b3a4488910fa63a867de31f1735595e2f Mon Sep 17 00:00:00 2001 From: "rmcilroy@chromium.org" Date: Wed, 23 Apr 2014 10:20:00 +0000 Subject: Skip ElfCoreDumpTest and LinuxCoreDumperTest on Android if no core file is dumped. On certain versions of Android (specifically JellyBean MR2 on Nexus 7, possibly others too) no ELF core dump is created for crashing processes. Check for this and skip the test if so. BUG=364943 R=thestig@chromium.org Review URL: https://breakpad.appspot.com/1624003 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1318 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/common/linux/elf_core_dump_unittest.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/common/linux/elf_core_dump_unittest.cc') diff --git a/src/common/linux/elf_core_dump_unittest.cc b/src/common/linux/elf_core_dump_unittest.cc index 4eae9680..63ecb2f3 100644 --- a/src/common/linux/elf_core_dump_unittest.cc +++ b/src/common/linux/elf_core_dump_unittest.cc @@ -146,6 +146,15 @@ TEST(ElfCoreDumpTest, ValidCoreFile) { expected_thread_ids.insert(crash_generator.GetThreadId(i)); } +#if defined(__ANDROID__) + struct stat st; + if (stat(crash_generator.GetCoreFilePath().c_str(), &st) != 0) { + fprintf(stderr, "ElfCoreDumpTest.ValidCoreFile test is skipped " + "due to no core file being generated"); + return; + } +#endif + MemoryMappedFile mapped_core_file; ASSERT_TRUE(mapped_core_file.Map(crash_generator.GetCoreFilePath().c_str())); -- cgit v1.2.1