summaryrefslogtreecommitdiff
path: root/oatdump/oatdump_app_test.cc
diff options
context:
space:
mode:
author Andreas Gampe <agampe@google.com> 2018-07-10 23:26:55 -0700
committer Andreas Gampe <agampe@google.com> 2018-07-13 15:51:36 -0700
commit38aa0b53545a647581411b7e84cd229c5023a3c1 (patch)
tree56da09c99085e6767b9a84038e9661f057092075 /oatdump/oatdump_app_test.cc
parentcdfc942e60032622b5a4379d0dd5ca914ba6393a (diff)
ART: Clean up test exec code
Add a helper for fork+exec of another program and collection of that process' output. Use the helper in other code. Clean up some tests. Move away from global #ifdef ARCH and disable tests with the usual-style macros so that it's easier to see refactoring issues immediately. Test: mmma Test: m test-art-host Change-Id: Ic450e8a3bb24fc6fe423c0e1e007eb0bb34e22b4
Diffstat (limited to 'oatdump/oatdump_app_test.cc')
-rw-r--r--oatdump/oatdump_app_test.cc24
1 files changed, 8 insertions, 16 deletions
diff --git a/oatdump/oatdump_app_test.cc b/oatdump/oatdump_app_test.cc
index 34b07d2ddf..a344286259 100644
--- a/oatdump/oatdump_app_test.cc
+++ b/oatdump/oatdump_app_test.cc
@@ -19,31 +19,23 @@
namespace art {
TEST_F(OatDumpTest, TestAppWithBootImage) {
- std::string error_msg;
- ASSERT_TRUE(GenerateAppOdexFile(kDynamic, {"--runtime-arg", "-Xmx64M"}, &error_msg)) << error_msg;
- ASSERT_TRUE(Exec(kDynamic, kModeOatWithBootImage, {}, kListAndCode, &error_msg)) << error_msg;
+ ASSERT_TRUE(GenerateAppOdexFile(kDynamic, {"--runtime-arg", "-Xmx64M"}));
+ ASSERT_TRUE(Exec(kDynamic, kModeOatWithBootImage, {}, kListAndCode));
}
TEST_F(OatDumpTest, TestAppWithBootImageStatic) {
TEST_DISABLED_FOR_NON_STATIC_HOST_BUILDS();
- std::string error_msg;
- ASSERT_TRUE(GenerateAppOdexFile(kStatic, {"--runtime-arg", "-Xmx64M"}, &error_msg)) << error_msg;
- ASSERT_TRUE(Exec(kStatic, kModeOatWithBootImage, {}, kListAndCode, &error_msg)) << error_msg;
+ ASSERT_TRUE(GenerateAppOdexFile(kStatic, {"--runtime-arg", "-Xmx64M"}));
+ ASSERT_TRUE(Exec(kStatic, kModeOatWithBootImage, {}, kListAndCode));
}
TEST_F(OatDumpTest, TestPicAppWithBootImage) {
- std::string error_msg;
- ASSERT_TRUE(
- GenerateAppOdexFile(kDynamic, {"--runtime-arg", "-Xmx64M", "--compile-pic"}, &error_msg))
- << error_msg;
- ASSERT_TRUE(Exec(kDynamic, kModeOatWithBootImage, {}, kListAndCode, &error_msg)) << error_msg;
+ ASSERT_TRUE(GenerateAppOdexFile(kDynamic, {"--runtime-arg", "-Xmx64M", "--compile-pic"}));
+ ASSERT_TRUE(Exec(kDynamic, kModeOatWithBootImage, {}, kListAndCode));
}
TEST_F(OatDumpTest, TestPicAppWithBootImageStatic) {
TEST_DISABLED_FOR_NON_STATIC_HOST_BUILDS();
- std::string error_msg;
- ASSERT_TRUE(
- GenerateAppOdexFile(kStatic, {"--runtime-arg", "-Xmx64M", "--compile-pic"}, &error_msg))
- << error_msg;
- ASSERT_TRUE(Exec(kStatic, kModeOatWithBootImage, {}, kListAndCode, &error_msg)) << error_msg;
+ ASSERT_TRUE(GenerateAppOdexFile(kStatic, {"--runtime-arg", "-Xmx64M", "--compile-pic"}));
+ ASSERT_TRUE(Exec(kStatic, kModeOatWithBootImage, {}, kListAndCode));
}
} // namespace art