From 103b998a52fa80eee2c85a420533bf75a0b11e41 Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Mon, 23 Sep 2019 09:03:10 -0700 Subject: [PATCH] Stop executing if skip occurs. Bug: 141358530 Test: Forced a skip and verified it registers as a skip. Change-Id: I9915c67ebae4389a26f28e16375ad4a41f3e4837 --- tests/sys_ptrace_test.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/sys_ptrace_test.cpp b/tests/sys_ptrace_test.cpp index 90539fe8c..15e9a2491 100644 --- a/tests/sys_ptrace_test.cpp +++ b/tests/sys_ptrace_test.cpp @@ -176,6 +176,9 @@ static void run_watchpoint_test(std::function child_func, size_t offse ASSERT_EQ(SIGSTOP, WSTOPSIG(status)) << "Status was: " << status; check_hw_feature_supported(child, HwFeature::Watchpoint); + if (::testing::Test::IsSkipped()) { + return; + } set_watchpoint(child, uintptr_t(untag_address(&data)) + offset, size); @@ -224,6 +227,10 @@ TEST(sys_ptrace, watchpoint_stress) { if (!CPU_ISSET(cpu, &available_cpus)) continue; run_watchpoint_stress(cpu); + if (::testing::Test::IsSkipped()) { + // Only check first case, since all others would skip for same reason. + return; + } run_watchpoint_stress(cpu); run_watchpoint_stress(cpu); #if defined(__LP64__) @@ -343,6 +350,9 @@ TEST(sys_ptrace, hardware_breakpoint) { ASSERT_EQ(SIGSTOP, WSTOPSIG(status)) << "Status was: " << status; check_hw_feature_supported(child, HwFeature::Breakpoint); + if (::testing::Test::IsSkipped()) { + return; + } set_breakpoint(child);