Vladimir Marko | 1352f13 | 2017-04-28 15:28:29 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2015 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #ifndef ART_OATDUMP_OATDUMP_TEST_H_ |
| 18 | #define ART_OATDUMP_OATDUMP_TEST_H_ |
| 19 | |
| 20 | #include <sstream> |
| 21 | #include <string> |
| 22 | #include <vector> |
| 23 | |
| 24 | #include "android-base/strings.h" |
| 25 | |
Andreas Gampe | 2c30e4a | 2017-08-23 11:31:32 -0700 | [diff] [blame] | 26 | #include "arch/instruction_set.h" |
David Sehr | 891a50e | 2017-10-27 17:01:07 -0700 | [diff] [blame] | 27 | #include "base/file_utils.h" |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 28 | #include "base/os.h" |
Vladimir Marko | 1352f13 | 2017-04-28 15:28:29 +0100 | [diff] [blame] | 29 | #include "base/unix_file/fd_file.h" |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 30 | #include "base/utils.h" |
Andreas Gampe | 2c30e4a | 2017-08-23 11:31:32 -0700 | [diff] [blame] | 31 | #include "common_runtime_test.h" |
| 32 | #include "exec_utils.h" |
| 33 | #include "gc/heap.h" |
| 34 | #include "gc/space/image_space.h" |
Vladimir Marko | 1352f13 | 2017-04-28 15:28:29 +0100 | [diff] [blame] | 35 | |
| 36 | #include <sys/types.h> |
| 37 | #include <unistd.h> |
| 38 | |
| 39 | namespace art { |
| 40 | |
| 41 | class OatDumpTest : public CommonRuntimeTest { |
| 42 | protected: |
| 43 | virtual void SetUp() { |
| 44 | CommonRuntimeTest::SetUp(); |
| 45 | core_art_location_ = GetCoreArtLocation(); |
| 46 | core_oat_location_ = GetSystemImageFilename(GetCoreOatLocation().c_str(), kRuntimeISA); |
Anestis Bechtsoudis | a1f56a8 | 2017-10-08 23:37:10 +0300 | [diff] [blame] | 47 | tmp_dir_ = GetScratchDir(); |
| 48 | } |
| 49 | |
| 50 | virtual void TearDown() { |
| 51 | ClearDirectory(tmp_dir_.c_str(), /*recursive*/ false); |
| 52 | ASSERT_EQ(rmdir(tmp_dir_.c_str()), 0); |
| 53 | CommonRuntimeTest::TearDown(); |
| 54 | } |
| 55 | |
| 56 | std::string GetScratchDir() { |
| 57 | // ANDROID_DATA needs to be set |
| 58 | CHECK_NE(static_cast<char*>(nullptr), getenv("ANDROID_DATA")); |
| 59 | std::string dir = getenv("ANDROID_DATA"); |
| 60 | dir += "/oatdump-tmp-dir-XXXXXX"; |
| 61 | if (mkdtemp(&dir[0]) == nullptr) { |
| 62 | PLOG(FATAL) << "mkdtemp(\"" << &dir[0] << "\") failed"; |
| 63 | } |
| 64 | return dir; |
Vladimir Marko | 1352f13 | 2017-04-28 15:28:29 +0100 | [diff] [blame] | 65 | } |
| 66 | |
| 67 | // Linking flavor. |
| 68 | enum Flavor { |
Vladimir Marko | 421087b | 2018-02-27 11:00:17 +0000 | [diff] [blame] | 69 | kDynamic, // oatdump(d), dex2oat(d) |
| 70 | kStatic, // oatdump(d)s, dex2oat(d)s |
Vladimir Marko | 1352f13 | 2017-04-28 15:28:29 +0100 | [diff] [blame] | 71 | }; |
| 72 | |
Mathieu Chartier | 567dc6f | 2018-04-05 16:37:14 -0700 | [diff] [blame] | 73 | // Returns path to the oatdump/dex2oat/dexdump binary. |
| 74 | std::string GetExecutableFilePath(const char* name, bool is_debug, bool is_static) { |
Vladimir Marko | 1352f13 | 2017-04-28 15:28:29 +0100 | [diff] [blame] | 75 | std::string root = GetTestAndroidRoot(); |
Vladimir Marko | 421087b | 2018-02-27 11:00:17 +0000 | [diff] [blame] | 76 | root += "/bin/"; |
| 77 | root += name; |
Mathieu Chartier | 567dc6f | 2018-04-05 16:37:14 -0700 | [diff] [blame] | 78 | if (is_debug) { |
Vladimir Marko | 1352f13 | 2017-04-28 15:28:29 +0100 | [diff] [blame] | 79 | root += "d"; |
| 80 | } |
Mathieu Chartier | 567dc6f | 2018-04-05 16:37:14 -0700 | [diff] [blame] | 81 | if (is_static) { |
Vladimir Marko | 1352f13 | 2017-04-28 15:28:29 +0100 | [diff] [blame] | 82 | root += "s"; |
| 83 | } |
| 84 | return root; |
| 85 | } |
| 86 | |
Mathieu Chartier | 567dc6f | 2018-04-05 16:37:14 -0700 | [diff] [blame] | 87 | std::string GetExecutableFilePath(Flavor flavor, const char* name) { |
| 88 | return GetExecutableFilePath(name, kIsDebugBuild, flavor == kStatic); |
| 89 | } |
| 90 | |
Vladimir Marko | 1352f13 | 2017-04-28 15:28:29 +0100 | [diff] [blame] | 91 | enum Mode { |
| 92 | kModeOat, |
Nicolas Geoffray | c75a696 | 2019-01-26 10:16:54 +0000 | [diff] [blame] | 93 | kModeCoreOat, |
Vladimir Marko | 421087b | 2018-02-27 11:00:17 +0000 | [diff] [blame] | 94 | kModeOatWithBootImage, |
Vladimir Marko | 1352f13 | 2017-04-28 15:28:29 +0100 | [diff] [blame] | 95 | kModeArt, |
| 96 | kModeSymbolize, |
| 97 | }; |
| 98 | |
| 99 | // Display style. |
| 100 | enum Display { |
| 101 | kListOnly, |
| 102 | kListAndCode |
| 103 | }; |
| 104 | |
Vladimir Marko | 421087b | 2018-02-27 11:00:17 +0000 | [diff] [blame] | 105 | std::string GetAppBaseName() { |
| 106 | // Use ProfileTestMultiDex as it contains references to boot image strings |
| 107 | // that shall use different code for PIC and non-PIC. |
| 108 | return "ProfileTestMultiDex"; |
| 109 | } |
| 110 | |
| 111 | std::string GetAppOdexName() { |
| 112 | return tmp_dir_ + "/" + GetAppBaseName() + ".odex"; |
| 113 | } |
| 114 | |
Andreas Gampe | 38aa0b5 | 2018-07-10 23:26:55 -0700 | [diff] [blame] | 115 | ::testing::AssertionResult GenerateAppOdexFile(Flavor flavor, |
| 116 | const std::vector<std::string>& args) { |
Vladimir Marko | 421087b | 2018-02-27 11:00:17 +0000 | [diff] [blame] | 117 | std::string dex2oat_path = GetExecutableFilePath(flavor, "dex2oat"); |
| 118 | std::vector<std::string> exec_argv = { |
| 119 | dex2oat_path, |
| 120 | "--runtime-arg", |
| 121 | "-Xms64m", |
| 122 | "--runtime-arg", |
| 123 | "-Xmx512m", |
| 124 | "--runtime-arg", |
| 125 | "-Xnorelocate", |
Vladimir Marko | 7a85e70 | 2018-12-03 18:47:23 +0000 | [diff] [blame] | 126 | "--runtime-arg", |
| 127 | GetClassPathOption("-Xbootclasspath:", GetLibCoreDexFileNames()), |
| 128 | "--runtime-arg", |
| 129 | GetClassPathOption("-Xbootclasspath-locations:", GetLibCoreDexLocations()), |
Vladimir Marko | 421087b | 2018-02-27 11:00:17 +0000 | [diff] [blame] | 130 | "--boot-image=" + GetCoreArtLocation(), |
| 131 | "--instruction-set=" + std::string(GetInstructionSetString(kRuntimeISA)), |
| 132 | "--dex-file=" + GetTestDexFileName(GetAppBaseName().c_str()), |
| 133 | "--oat-file=" + GetAppOdexName(), |
| 134 | "--compiler-filter=speed" |
| 135 | }; |
| 136 | exec_argv.insert(exec_argv.end(), args.begin(), args.end()); |
| 137 | |
Andreas Gampe | 38aa0b5 | 2018-07-10 23:26:55 -0700 | [diff] [blame] | 138 | auto post_fork_fn = []() { |
| 139 | setpgid(0, 0); // Change process groups, so we don't get reaped by ProcessManager. |
| 140 | // Ignore setpgid errors. |
| 141 | return setenv("ANDROID_LOG_TAGS", "*:e", 1) == 0; // We're only interested in errors and |
| 142 | // fatal logs. |
| 143 | }; |
| 144 | |
| 145 | std::string error_msg; |
| 146 | ForkAndExecResult res = ForkAndExec(exec_argv, post_fork_fn, &error_msg); |
| 147 | if (res.stage != ForkAndExecResult::kFinished) { |
| 148 | return ::testing::AssertionFailure() << strerror(errno); |
| 149 | } |
| 150 | return res.StandardSuccess() ? ::testing::AssertionSuccess() |
| 151 | : (::testing::AssertionFailure() << error_msg); |
Vladimir Marko | 421087b | 2018-02-27 11:00:17 +0000 | [diff] [blame] | 152 | } |
| 153 | |
Vladimir Marko | 1352f13 | 2017-04-28 15:28:29 +0100 | [diff] [blame] | 154 | // Run the test with custom arguments. |
Andreas Gampe | 38aa0b5 | 2018-07-10 23:26:55 -0700 | [diff] [blame] | 155 | ::testing::AssertionResult Exec(Flavor flavor, |
| 156 | Mode mode, |
| 157 | const std::vector<std::string>& args, |
| 158 | Display display) { |
Vladimir Marko | 421087b | 2018-02-27 11:00:17 +0000 | [diff] [blame] | 159 | std::string file_path = GetExecutableFilePath(flavor, "oatdump"); |
Vladimir Marko | 1352f13 | 2017-04-28 15:28:29 +0100 | [diff] [blame] | 160 | |
Andreas Gampe | 38aa0b5 | 2018-07-10 23:26:55 -0700 | [diff] [blame] | 161 | if (!OS::FileExists(file_path.c_str())) { |
| 162 | return ::testing::AssertionFailure() << file_path << " should be a valid file path"; |
| 163 | } |
Vladimir Marko | 1352f13 | 2017-04-28 15:28:29 +0100 | [diff] [blame] | 164 | |
| 165 | // ScratchFile scratch; |
| 166 | std::vector<std::string> exec_argv = { file_path }; |
| 167 | std::vector<std::string> expected_prefixes; |
| 168 | if (mode == kModeSymbolize) { |
| 169 | exec_argv.push_back("--symbolize=" + core_oat_location_); |
| 170 | exec_argv.push_back("--output=" + core_oat_location_ + ".symbolize"); |
| 171 | } else { |
Vladimir Marko | 1352f13 | 2017-04-28 15:28:29 +0100 | [diff] [blame] | 172 | expected_prefixes.push_back("LOCATION:"); |
| 173 | expected_prefixes.push_back("MAGIC:"); |
| 174 | expected_prefixes.push_back("DEX FILE COUNT:"); |
| 175 | if (display == kListAndCode) { |
| 176 | // Code and dex code do not show up if list only. |
| 177 | expected_prefixes.push_back("DEX CODE:"); |
| 178 | expected_prefixes.push_back("CODE:"); |
David Srbecky | 42deda8 | 2018-08-10 11:23:27 +0100 | [diff] [blame] | 179 | expected_prefixes.push_back("InlineInfo"); |
Vladimir Marko | 1352f13 | 2017-04-28 15:28:29 +0100 | [diff] [blame] | 180 | } |
| 181 | if (mode == kModeArt) { |
Vladimir Marko | 91f1032 | 2018-12-07 18:04:10 +0000 | [diff] [blame] | 182 | exec_argv.push_back("--runtime-arg"); |
| 183 | exec_argv.push_back(GetClassPathOption("-Xbootclasspath:", GetLibCoreDexFileNames())); |
| 184 | exec_argv.push_back("--runtime-arg"); |
| 185 | exec_argv.push_back( |
| 186 | GetClassPathOption("-Xbootclasspath-locations:", GetLibCoreDexLocations())); |
Vladimir Marko | 1352f13 | 2017-04-28 15:28:29 +0100 | [diff] [blame] | 187 | exec_argv.push_back("--image=" + core_art_location_); |
| 188 | exec_argv.push_back("--instruction-set=" + std::string( |
| 189 | GetInstructionSetString(kRuntimeISA))); |
| 190 | expected_prefixes.push_back("IMAGE LOCATION:"); |
| 191 | expected_prefixes.push_back("IMAGE BEGIN:"); |
| 192 | expected_prefixes.push_back("kDexCaches:"); |
Vladimir Marko | 421087b | 2018-02-27 11:00:17 +0000 | [diff] [blame] | 193 | } else if (mode == kModeOatWithBootImage) { |
Vladimir Marko | 7a85e70 | 2018-12-03 18:47:23 +0000 | [diff] [blame] | 194 | exec_argv.push_back("--runtime-arg"); |
| 195 | exec_argv.push_back(GetClassPathOption("-Xbootclasspath:", GetLibCoreDexFileNames())); |
| 196 | exec_argv.push_back("--runtime-arg"); |
| 197 | exec_argv.push_back( |
| 198 | GetClassPathOption("-Xbootclasspath-locations:", GetLibCoreDexLocations())); |
Vladimir Marko | 421087b | 2018-02-27 11:00:17 +0000 | [diff] [blame] | 199 | exec_argv.push_back("--boot-image=" + GetCoreArtLocation()); |
| 200 | exec_argv.push_back("--instruction-set=" + std::string( |
| 201 | GetInstructionSetString(kRuntimeISA))); |
| 202 | exec_argv.push_back("--oat-file=" + GetAppOdexName()); |
Nicolas Geoffray | c75a696 | 2019-01-26 10:16:54 +0000 | [diff] [blame] | 203 | } else if (mode == kModeCoreOat) { |
| 204 | exec_argv.push_back("--oat-file=" + core_oat_location_); |
Vladimir Marko | 1352f13 | 2017-04-28 15:28:29 +0100 | [diff] [blame] | 205 | } else { |
| 206 | CHECK_EQ(static_cast<size_t>(mode), static_cast<size_t>(kModeOat)); |
Nicolas Geoffray | 3ad2c2b | 2019-01-26 00:19:38 +0000 | [diff] [blame] | 207 | exec_argv.push_back("--oat-file=" + GetAppOdexName()); |
Vladimir Marko | 1352f13 | 2017-04-28 15:28:29 +0100 | [diff] [blame] | 208 | } |
| 209 | } |
| 210 | exec_argv.insert(exec_argv.end(), args.begin(), args.end()); |
| 211 | |
Andreas Gampe | 38aa0b5 | 2018-07-10 23:26:55 -0700 | [diff] [blame] | 212 | std::vector<bool> found(expected_prefixes.size(), false); |
| 213 | auto line_handle_fn = [&found, &expected_prefixes](const char* line, size_t line_len) { |
| 214 | if (line_len == 0) { |
| 215 | return; |
| 216 | } |
| 217 | // Check contents. |
| 218 | for (size_t i = 0; i < expected_prefixes.size(); ++i) { |
| 219 | const std::string& expected = expected_prefixes[i]; |
| 220 | if (!found[i] && |
| 221 | line_len >= expected.length() && |
| 222 | memcmp(line, expected.c_str(), expected.length()) == 0) { |
| 223 | found[i] = true; |
| 224 | } |
| 225 | } |
| 226 | }; |
| 227 | |
| 228 | static constexpr size_t kLineMax = 256; |
| 229 | char line[kLineMax] = {}; |
| 230 | size_t line_len = 0; |
| 231 | size_t total = 0; |
| 232 | bool ignore_next_line = false; |
Andreas Gampe | 3cfc2e7 | 2018-07-16 14:10:14 -0700 | [diff] [blame] | 233 | std::vector<char> error_buf; // Buffer for debug output on error. Limited to 1M. |
Andreas Gampe | 38aa0b5 | 2018-07-10 23:26:55 -0700 | [diff] [blame] | 234 | auto line_buf_fn = [&](char* buf, size_t len) { |
| 235 | total += len; |
| 236 | |
| 237 | if (len == 0 && line_len > 0 && !ignore_next_line) { |
| 238 | // Everything done, handle leftovers. |
| 239 | line_handle_fn(line, line_len); |
| 240 | } |
| 241 | |
Andreas Gampe | 3cfc2e7 | 2018-07-16 14:10:14 -0700 | [diff] [blame] | 242 | if (len > 0) { |
| 243 | size_t pos = error_buf.size(); |
| 244 | if (pos < MB) { |
Andreas Gampe | 764280a | 2018-07-17 10:17:22 -0700 | [diff] [blame] | 245 | error_buf.insert(error_buf.end(), buf, buf + len); |
Andreas Gampe | 3cfc2e7 | 2018-07-16 14:10:14 -0700 | [diff] [blame] | 246 | } |
| 247 | } |
| 248 | |
Andreas Gampe | 38aa0b5 | 2018-07-10 23:26:55 -0700 | [diff] [blame] | 249 | while (len > 0) { |
| 250 | // Copy buf into the free tail of the line buffer, and move input buffer along. |
| 251 | size_t copy = std::min(kLineMax - line_len, len); |
| 252 | memcpy(&line[line_len], buf, copy); |
| 253 | buf += copy; |
| 254 | len -= copy; |
| 255 | |
Andreas Gampe | 3cfc2e7 | 2018-07-16 14:10:14 -0700 | [diff] [blame] | 256 | // Skip spaces up to len, return count of removed spaces. Declare a lambda for reuse. |
| 257 | auto trim_space = [&line](size_t len) { |
Vladimir Marko | 1352f13 | 2017-04-28 15:28:29 +0100 | [diff] [blame] | 258 | size_t spaces = 0; |
Andreas Gampe | 3cfc2e7 | 2018-07-16 14:10:14 -0700 | [diff] [blame] | 259 | for (; spaces < len && isspace(line[spaces]); ++spaces) {} |
Vladimir Marko | 1352f13 | 2017-04-28 15:28:29 +0100 | [diff] [blame] | 260 | if (spaces > 0) { |
Andreas Gampe | 3cfc2e7 | 2018-07-16 14:10:14 -0700 | [diff] [blame] | 261 | memmove(&line[0], &line[spaces], len - spaces); |
Vladimir Marko | 1352f13 | 2017-04-28 15:28:29 +0100 | [diff] [blame] | 262 | } |
Andreas Gampe | 3cfc2e7 | 2018-07-16 14:10:14 -0700 | [diff] [blame] | 263 | return spaces; |
Andreas Gampe | 38aa0b5 | 2018-07-10 23:26:55 -0700 | [diff] [blame] | 264 | }; |
Andreas Gampe | 3cfc2e7 | 2018-07-16 14:10:14 -0700 | [diff] [blame] | 265 | // There can only be spaces if we freshly started a line. |
| 266 | if (line_len == 0) { |
| 267 | copy -= trim_space(copy); |
| 268 | } |
Andreas Gampe | 38aa0b5 | 2018-07-10 23:26:55 -0700 | [diff] [blame] | 269 | |
| 270 | // Scan for newline characters. |
| 271 | size_t index = line_len; |
| 272 | line_len += copy; |
| 273 | while (index < line_len) { |
| 274 | if (line[index] == '\n') { |
| 275 | // Handle line. |
| 276 | if (!ignore_next_line) { |
| 277 | line_handle_fn(line, index); |
| 278 | } |
| 279 | // Move the rest to the front, but trim leading spaces. |
| 280 | line_len -= index + 1; |
| 281 | memmove(&line[0], &line[index + 1], line_len); |
Andreas Gampe | 3cfc2e7 | 2018-07-16 14:10:14 -0700 | [diff] [blame] | 282 | line_len -= trim_space(line_len); |
Andreas Gampe | 38aa0b5 | 2018-07-10 23:26:55 -0700 | [diff] [blame] | 283 | index = 0; |
| 284 | ignore_next_line = false; |
| 285 | } else { |
| 286 | index++; |
Vladimir Marko | 1352f13 | 2017-04-28 15:28:29 +0100 | [diff] [blame] | 287 | } |
| 288 | } |
Vladimir Marko | 1352f13 | 2017-04-28 15:28:29 +0100 | [diff] [blame] | 289 | |
Andreas Gampe | 38aa0b5 | 2018-07-10 23:26:55 -0700 | [diff] [blame] | 290 | // Handle a full line without newline characters. Ignore the "next" line, as it is the |
| 291 | // tail end of this. |
| 292 | if (line_len == kLineMax) { |
| 293 | if (!ignore_next_line) { |
| 294 | line_handle_fn(line, kLineMax); |
| 295 | } |
| 296 | line_len = 0; |
| 297 | ignore_next_line = true; |
Vladimir Marko | 1352f13 | 2017-04-28 15:28:29 +0100 | [diff] [blame] | 298 | } |
| 299 | } |
Andreas Gampe | 38aa0b5 | 2018-07-10 23:26:55 -0700 | [diff] [blame] | 300 | }; |
| 301 | |
| 302 | auto post_fork_fn = []() { |
| 303 | setpgid(0, 0); // Change process groups, so we don't get reaped by ProcessManager. |
| 304 | return true; // Ignore setpgid failures. |
| 305 | }; |
| 306 | |
| 307 | ForkAndExecResult res = ForkAndExec(exec_argv, post_fork_fn, line_buf_fn); |
| 308 | if (res.stage != ForkAndExecResult::kFinished) { |
| 309 | return ::testing::AssertionFailure() << strerror(errno); |
| 310 | } |
| 311 | if (!res.StandardSuccess()) { |
| 312 | return ::testing::AssertionFailure() << "Did not terminate successfully: " << res.status_code; |
Vladimir Marko | 1352f13 | 2017-04-28 15:28:29 +0100 | [diff] [blame] | 313 | } |
| 314 | |
Andreas Gampe | 38aa0b5 | 2018-07-10 23:26:55 -0700 | [diff] [blame] | 315 | if (mode == kModeSymbolize) { |
| 316 | EXPECT_EQ(total, 0u); |
Vladimir Marko | 421087b | 2018-02-27 11:00:17 +0000 | [diff] [blame] | 317 | } else { |
Andreas Gampe | 38aa0b5 | 2018-07-10 23:26:55 -0700 | [diff] [blame] | 318 | EXPECT_GT(total, 0u); |
Vladimir Marko | 421087b | 2018-02-27 11:00:17 +0000 | [diff] [blame] | 319 | } |
Vladimir Marko | 421087b | 2018-02-27 11:00:17 +0000 | [diff] [blame] | 320 | |
Andreas Gampe | 38aa0b5 | 2018-07-10 23:26:55 -0700 | [diff] [blame] | 321 | bool result = true; |
| 322 | std::ostringstream oss; |
| 323 | for (size_t i = 0; i < expected_prefixes.size(); ++i) { |
| 324 | if (!found[i]) { |
| 325 | oss << "Did not find prefix " << expected_prefixes[i] << std::endl; |
| 326 | result = false; |
Mathieu Chartier | 567dc6f | 2018-04-05 16:37:14 -0700 | [diff] [blame] | 327 | } |
| 328 | } |
Andreas Gampe | 38aa0b5 | 2018-07-10 23:26:55 -0700 | [diff] [blame] | 329 | if (!result) { |
Andreas Gampe | 3cfc2e7 | 2018-07-16 14:10:14 -0700 | [diff] [blame] | 330 | oss << "Processed bytes " << total << ":" << std::endl; |
| 331 | error_buf.push_back(0); // Make data a C string. |
Andreas Gampe | 38aa0b5 | 2018-07-10 23:26:55 -0700 | [diff] [blame] | 332 | } |
| 333 | |
| 334 | return result ? ::testing::AssertionSuccess() |
Andreas Gampe | 3cfc2e7 | 2018-07-16 14:10:14 -0700 | [diff] [blame] | 335 | : (::testing::AssertionFailure() << oss.str() << error_buf.data()); |
Mathieu Chartier | 567dc6f | 2018-04-05 16:37:14 -0700 | [diff] [blame] | 336 | } |
| 337 | |
Anestis Bechtsoudis | a1f56a8 | 2017-10-08 23:37:10 +0300 | [diff] [blame] | 338 | std::string tmp_dir_; |
| 339 | |
Vladimir Marko | 1352f13 | 2017-04-28 15:28:29 +0100 | [diff] [blame] | 340 | private: |
| 341 | std::string core_art_location_; |
| 342 | std::string core_oat_location_; |
| 343 | }; |
| 344 | |
| 345 | } // namespace art |
| 346 | |
| 347 | #endif // ART_OATDUMP_OATDUMP_TEST_H_ |