Merge "No tombstones under normal bionic unit tests run." into main am: 78a74b02ad
am: 2cafbeff4c
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2673489 Change-Id: Ib1fa7e8d80dd3601148e5aad9900745f29df39bb Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
21433531d4
2 changed files with 12 additions and 7 deletions
|
@ -34,12 +34,15 @@
|
|||
#if defined(__BIONIC__)
|
||||
|
||||
#include "android-base/file.h"
|
||||
#include "android-base/silent_death_test.h"
|
||||
#include "android-base/test_utils.h"
|
||||
#include "gwp_asan/options.h"
|
||||
#include "platform/bionic/malloc.h"
|
||||
#include "sys/system_properties.h"
|
||||
#include "utils.h"
|
||||
|
||||
using gwp_asan_integration_DeathTest = SilentDeathTest;
|
||||
|
||||
// basename is a mess, use gnu basename explicitly to avoid the need for string
|
||||
// mutation.
|
||||
extern "C" const char* __gnu_basename(const char* path);
|
||||
|
@ -133,7 +136,7 @@ class SyspropRestorer {
|
|||
}
|
||||
};
|
||||
|
||||
TEST(gwp_asan_integration, DISABLED_assert_gwp_asan_enabled) {
|
||||
TEST_F(gwp_asan_integration_DeathTest, DISABLED_assert_gwp_asan_enabled) {
|
||||
std::string maps;
|
||||
EXPECT_TRUE(android::base::ReadFileToString("/proc/self/maps", &maps));
|
||||
EXPECT_TRUE(maps.find("GWP-ASan") != std::string::npos) << maps;
|
||||
|
@ -173,7 +176,7 @@ TEST(gwp_asan_integration, sysprops_program_specific) {
|
|||
__system_property_set((std::string("libc.debug.gwp_asan.max_allocs.") + basename).c_str(),
|
||||
"40000");
|
||||
|
||||
RunSubtestNoEnv("gwp_asan_integration.DISABLED_assert_gwp_asan_enabled");
|
||||
RunSubtestNoEnv("gwp_asan_integration_DeathTest.DISABLED_assert_gwp_asan_enabled");
|
||||
}
|
||||
|
||||
TEST(gwp_asan_integration, sysprops_persist_program_specific) {
|
||||
|
@ -191,7 +194,7 @@ TEST(gwp_asan_integration, sysprops_persist_program_specific) {
|
|||
__system_property_set((std::string("persist.libc.debug.gwp_asan.max_allocs.") + basename).c_str(),
|
||||
"40000");
|
||||
|
||||
RunSubtestNoEnv("gwp_asan_integration.DISABLED_assert_gwp_asan_enabled");
|
||||
RunSubtestNoEnv("gwp_asan_integration_DeathTest.DISABLED_assert_gwp_asan_enabled");
|
||||
}
|
||||
|
||||
TEST(gwp_asan_integration, sysprops_non_persist_overrides_persist) {
|
||||
|
@ -235,7 +238,7 @@ TEST(gwp_asan_integration, sysprops_program_specific_overrides_default) {
|
|||
__system_property_set("libc.debug.gwp_asan.process_sampling.system_default", "0");
|
||||
__system_property_set("libc.debug.gwp_asan.max_allocs.system_default", "0");
|
||||
|
||||
RunSubtestNoEnv("gwp_asan_integration.DISABLED_assert_gwp_asan_enabled");
|
||||
RunSubtestNoEnv("gwp_asan_integration_DeathTest.DISABLED_assert_gwp_asan_enabled");
|
||||
}
|
||||
|
||||
TEST(gwp_asan_integration, sysprops_can_disable) {
|
||||
|
@ -261,7 +264,7 @@ TEST(gwp_asan_integration, env_overrides_sysprop) {
|
|||
__system_property_set("libc.debug.gwp_asan.process_sampling.system_default", "0");
|
||||
__system_property_set("libc.debug.gwp_asan.max_allocs.system_default", "0");
|
||||
|
||||
RunGwpAsanTest("gwp_asan_integration.DISABLED_assert_gwp_asan_enabled");
|
||||
RunGwpAsanTest("gwp_asan_integration_DeathTest.DISABLED_assert_gwp_asan_enabled");
|
||||
}
|
||||
|
||||
#endif // defined(__BIONIC__)
|
||||
|
|
|
@ -1049,11 +1049,13 @@ TEST(STDIO_TEST, popen_return_value_1) {
|
|||
}
|
||||
|
||||
TEST(STDIO_TEST, popen_return_value_signal) {
|
||||
FILE* fp = popen("kill -7 $$", "r");
|
||||
// Use a realtime signal to avoid creating a tombstone when running.
|
||||
std::string cmd = android::base::StringPrintf("kill -%d $$", SIGRTMIN);
|
||||
FILE* fp = popen(cmd.c_str(), "r");
|
||||
ASSERT_TRUE(fp != nullptr);
|
||||
int status = pclose(fp);
|
||||
EXPECT_TRUE(WIFSIGNALED(status));
|
||||
EXPECT_EQ(7, WTERMSIG(status));
|
||||
EXPECT_EQ(SIGRTMIN, WTERMSIG(status));
|
||||
}
|
||||
|
||||
TEST(STDIO_TEST, getc) {
|
||||
|
|
Loading…
Reference in a new issue