Merge "Don't use StringPrintf() in gtest runner."

This commit is contained in:
Yabin Cui 2015-12-04 00:29:47 +00:00 committed by Gerrit Code Review
commit 514f46b74c
2 changed files with 4 additions and 10 deletions

View File

@ -236,8 +236,6 @@ libBionicGtestMain_cflags := $(test_cflags)
libBionicGtestMain_cppflags := $(test_cppflags)
libBionicGtestMain_static_libraries := libbase
module := libBionicGtestMain
module_tag := optional
build_type := target
@ -262,8 +260,6 @@ libBionicCtsGtestMain_cflags := $(test_cflags)
libBionicCtsGtestMain_cppflags := $(test_cppflags) -DUSING_GTEST_OUTPUT_FORMAT \
libBionicCtsGtestMain_static_libraries := libbase
module := libBionicCtsGtestMain
module_tag := optional
build_type := target

View File

@ -34,8 +34,6 @@
#include <utility>
#include <vector>
#include <base/stringprintf.h>
#ifndef TEMP_FAILURE_RETRY
/* Used to retry syscalls that can return EINTR. */
@ -778,10 +776,10 @@ static void CollectChildTestResult(const ChildProcInfo& child_proc, TestCase& te
int exitcode = WEXITSTATUS(child_proc.exit_status);
testcase.SetTestResult(test_id, exitcode == 0 ? TEST_SUCCESS : TEST_FAILED);
if (exitcode != 0) {
std::string s = android::base::StringPrintf("%s exited with exitcode %d.\n",
testcase.GetTestName(test_id).c_str(),
exitcode);
testcase.GetTest(test_id).AppendTestOutput(s);
char buf[1024];
snprintf(buf, sizeof(buf), "%s exited with exitcode %d.\n",
testcase.GetTestName(test_id).c_str(), exitcode);
testcase.GetTest(test_id).AppendTestOutput(buf);
}
}
}