summaryrefslogtreecommitdiffstats
path: root/runtime/utils_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/utils_test.cc')
-rw-r--r--runtime/utils_test.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/runtime/utils_test.cc b/runtime/utils_test.cc
index b43177b4f..ff65e47b1 100644
--- a/runtime/utils_test.cc
+++ b/runtime/utils_test.cc
@@ -349,4 +349,26 @@ TEST_F(UtilsTest, GetDalvikCacheFilenameOrDie) {
CheckGetDalvikCacheFilenameOrDie("/system/framework/boot.art", "system@framework@boot.art");
}
+TEST_F(UtilsTest, ExecSuccess) {
+ std::vector<std::string> command;
+ if (kIsTargetBuild) {
+ command.push_back("/system/bin/id");
+ } else {
+ command.push_back("/usr/bin/id");
+ }
+ std::string error_msg;
+ EXPECT_TRUE(Exec(command, &error_msg));
+ EXPECT_EQ(0U, error_msg.size()) << error_msg;
+}
+
+// TODO: Disabled due to hang tearing down CommonTest.
+// Renable after splitting into RuntimeTest and CompilerTest.
+TEST_F(UtilsTest, DISABLED_ExecError) {
+ std::vector<std::string> command;
+ command.push_back("bogus");
+ std::string error_msg;
+ EXPECT_FALSE(Exec(command, &error_msg));
+ EXPECT_NE(0U, error_msg.size());
+}
+
} // namespace art