diff options
author | rmcilroy@chromium.org <rmcilroy@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2014-04-23 10:20:00 +0000 |
---|---|---|
committer | rmcilroy@chromium.org <rmcilroy@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2014-04-23 10:20:00 +0000 |
commit | 1c8e155b3a4488910fa63a867de31f1735595e2f (patch) | |
tree | c240ae0dcd2938dbacfa57df42902cf66f1ad0fd /src | |
parent | minidump-2-core: Allow user to override shared lib basedir. (diff) | |
download | breakpad-1c8e155b3a4488910fa63a867de31f1735595e2f.tar.xz |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/client/linux/minidump_writer/linux_core_dumper_unittest.cc | 11 | ||||
-rw-r--r-- | src/common/linux/elf_core_dump_unittest.cc | 9 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/client/linux/minidump_writer/linux_core_dumper_unittest.cc b/src/client/linux/minidump_writer/linux_core_dumper_unittest.cc index 449aab3f..8f6a423e 100644 --- a/src/client/linux/minidump_writer/linux_core_dumper_unittest.cc +++ b/src/client/linux/minidump_writer/linux_core_dumper_unittest.cc @@ -79,7 +79,18 @@ TEST(LinuxCoreDumperTest, VerifyDumpWithMultipleThreads) { const string core_file = crash_generator.GetCoreFilePath(); const string procfs_path = crash_generator.GetDirectoryOfProcFilesCopy(); + +#if defined(__ANDROID__) + struct stat st; + if (stat(core_file.c_str(), &st) != 0) { + fprintf(stderr, "LinuxCoreDumperTest.VerifyDumpWithMultipleThreads test is " + "skipped due to no core file being generated"); + return; + } +#endif + LinuxCoreDumper dumper(child_pid, core_file.c_str(), procfs_path.c_str()); + EXPECT_TRUE(dumper.Init()); EXPECT_TRUE(dumper.IsPostMortem()); 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())); |