diff options
| author | 2018-06-14 13:55:49 +0100 | |
|---|---|---|
| committer | 2018-06-14 16:50:31 +0100 | |
| commit | 0b0d3b421782fbe04085765df9e99fb05a93a01c (patch) | |
| tree | cb894e3132f0e10f928bfd594d5ef3c46c6b7690 /runtime/exec_utils_test.cc | |
| parent | 41a50f3627e4d84941aaf36d821ea8ba47750b56 (diff) | |
Re-enable ART code paths and tests for ASan that were disabled for Valgrind.
Test: SANITIZE_HOST=address ASAN_OPTIONS='detect_leaks=0' make test-art-host
Bug: 29282211
Change-Id: I127a8c11c7d3b778c8d538aec0782a10f042225c
Diffstat (limited to 'runtime/exec_utils_test.cc')
| -rw-r--r-- | runtime/exec_utils_test.cc | 42 |
1 files changed, 15 insertions, 27 deletions
diff --git a/runtime/exec_utils_test.cc b/runtime/exec_utils_test.cc index a9c1ea2ae0..c138ce3f9e 100644 --- a/runtime/exec_utils_test.cc +++ b/runtime/exec_utils_test.cc @@ -36,12 +36,9 @@ TEST_F(ExecUtilsTest, ExecSuccess) { command.push_back("/usr/bin/id"); } std::string error_msg; - if (!(kRunningOnMemoryTool && kMemoryToolDetectsLeaks)) { - // Running on Valgrind fails due to some memory that leaks in thread alternate signal stacks. - // TODO: Valgrind is no longer supported, but Address Sanitizer is: - // check whether the following code works with ASan. - EXPECT_TRUE(Exec(command, &error_msg)); - } + // Historical note: Running on Valgrind failed due to some memory + // that leaks in thread alternate signal stacks. + EXPECT_TRUE(Exec(command, &error_msg)); EXPECT_EQ(0U, error_msg.size()) << error_msg; } @@ -52,13 +49,10 @@ TEST_F(ExecUtilsTest, ExecError) { std::vector<std::string> command; command.push_back("bogus"); std::string error_msg; - if (!(kRunningOnMemoryTool && kMemoryToolDetectsLeaks)) { - // Running on Valgrind fails due to some memory that leaks in thread alternate signal stacks. - // TODO: Valgrind is no longer supported, but Address Sanitizer is: - // check whether the following code works with ASan. - EXPECT_FALSE(Exec(command, &error_msg)); - EXPECT_FALSE(error_msg.empty()); - } + // Historical note: Running on Valgrind failed due to some memory + // that leaks in thread alternate signal stacks. + EXPECT_FALSE(Exec(command, &error_msg)); + EXPECT_FALSE(error_msg.empty()); } TEST_F(ExecUtilsTest, EnvSnapshotAdditionsAreNotVisible) { @@ -76,13 +70,10 @@ TEST_F(ExecUtilsTest, EnvSnapshotAdditionsAreNotVisible) { } command.push_back(kModifiedVariable); std::string error_msg; - if (!(kRunningOnMemoryTool && kMemoryToolDetectsLeaks)) { - // Running on Valgrind fails due to some memory that leaks in thread alternate signal stacks. - // TODO: Valgrind is no longer supported, but Address Sanitizer is: - // check whether the following code works with ASan. - EXPECT_FALSE(Exec(command, &error_msg)); - EXPECT_NE(0U, error_msg.size()) << error_msg; - } + // Historical note: Running on Valgrind failed due to some memory + // that leaks in thread alternate signal stacks. + EXPECT_FALSE(Exec(command, &error_msg)); + EXPECT_NE(0U, error_msg.size()) << error_msg; } TEST_F(ExecUtilsTest, EnvSnapshotDeletionsAreNotVisible) { @@ -103,13 +94,10 @@ TEST_F(ExecUtilsTest, EnvSnapshotDeletionsAreNotVisible) { } command.push_back(kDeletedVariable); std::string error_msg; - if (!(kRunningOnMemoryTool && kMemoryToolDetectsLeaks)) { - // Running on Valgrind fails due to some memory that leaks in thread alternate signal stacks. - // TODO: Valgrind is no longer supported, but Address Sanitizer is: - // check whether the following code works with ASan. - EXPECT_TRUE(Exec(command, &error_msg)); - EXPECT_EQ(0U, error_msg.size()) << error_msg; - } + // Historical note: Running on Valgrind failed due to some memory + // that leaks in thread alternate signal stacks. + EXPECT_TRUE(Exec(command, &error_msg)); + EXPECT_EQ(0U, error_msg.size()) << error_msg; // Restore the variable's value. EXPECT_EQ(setenv(kDeletedVariable, save_value, kOverwrite), 0); } |