Merge "Bit: use exec-out instead of shell" am: 78e7ddbf43
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2079620 Change-Id: Iccae5f4d27a989572692ed12aee12d2a2c01f218 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -73,7 +73,7 @@ string
|
|||||||
get_system_property(const string& name, int* err)
|
get_system_property(const string& name, int* err)
|
||||||
{
|
{
|
||||||
Command cmd("adb");
|
Command cmd("adb");
|
||||||
cmd.AddArg("shell");
|
cmd.AddArg("exec-out");
|
||||||
cmd.AddArg("getprop");
|
cmd.AddArg("getprop");
|
||||||
cmd.AddArg(name);
|
cmd.AddArg(name);
|
||||||
|
|
||||||
@@ -278,7 +278,7 @@ run_instrumentation_test(const string& packageName, const string& runner, const
|
|||||||
InstrumentationCallbacks* callbacks)
|
InstrumentationCallbacks* callbacks)
|
||||||
{
|
{
|
||||||
Command cmd("adb");
|
Command cmd("adb");
|
||||||
cmd.AddArg("shell");
|
cmd.AddArg("exec-out");
|
||||||
cmd.AddArg("am");
|
cmd.AddArg("am");
|
||||||
cmd.AddArg("instrument");
|
cmd.AddArg("instrument");
|
||||||
cmd.AddArg("-w");
|
cmd.AddArg("-w");
|
||||||
|
|||||||
@@ -278,7 +278,7 @@ TestResults::OnTestStatus(TestStatus& status)
|
|||||||
line << " of " << testCount;
|
line << " of " << testCount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
line << ": " << m_currentAction->target->name << ':' << className << "\\#" << testName;
|
line << ": " << m_currentAction->target->name << ':' << className << "#" << testName;
|
||||||
print_one_line("%s", line.str().c_str());
|
print_one_line("%s", line.str().c_str());
|
||||||
} else if ((resultCode == -1) || (resultCode == -2)) {
|
} else if ((resultCode == -1) || (resultCode == -2)) {
|
||||||
// test failed
|
// test failed
|
||||||
@@ -286,9 +286,9 @@ TestResults::OnTestStatus(TestStatus& status)
|
|||||||
// all as "failures".
|
// all as "failures".
|
||||||
m_currentAction->failCount++;
|
m_currentAction->failCount++;
|
||||||
m_currentAction->target->testFailCount++;
|
m_currentAction->target->testFailCount++;
|
||||||
printf("%s\n%sFailed: %s:%s\\#%s%s\n", g_escapeClearLine, g_escapeRedBold,
|
printf("%s\n%sFailed: %s:%s#%s%s\n", g_escapeClearLine, g_escapeRedBold,
|
||||||
m_currentAction->target->name.c_str(), className.c_str(),
|
m_currentAction->target->name.c_str(), className.c_str(), testName.c_str(),
|
||||||
testName.c_str(), g_escapeEndColor);
|
g_escapeEndColor);
|
||||||
|
|
||||||
bool stackFound;
|
bool stackFound;
|
||||||
string stack = get_bundle_string(results, &stackFound, "stack", NULL);
|
string stack = get_bundle_string(results, &stackFound, "stack", NULL);
|
||||||
@@ -403,11 +403,14 @@ print_usage(FILE* out) {
|
|||||||
fprintf(out, " Builds and installs CtsProtoTestCases.apk, and runs all the\n");
|
fprintf(out, " Builds and installs CtsProtoTestCases.apk, and runs all the\n");
|
||||||
fprintf(out, " tests in the ProtoOutputStreamBoolTest class.\n");
|
fprintf(out, " tests in the ProtoOutputStreamBoolTest class.\n");
|
||||||
fprintf(out, "\n");
|
fprintf(out, "\n");
|
||||||
fprintf(out, " bit CtsProtoTestCases:.ProtoOutputStreamBoolTest\\#testWrite\n");
|
fprintf(out, " bit CtsProtoTestCases:.ProtoOutputStreamBoolTest#testWrite\n");
|
||||||
fprintf(out, " Builds and installs CtsProtoTestCases.apk, and runs the testWrite\n");
|
fprintf(out, " Builds and installs CtsProtoTestCases.apk, and runs the testWrite\n");
|
||||||
fprintf(out, " test method on that class.\n");
|
fprintf(out, " test method on that class.\n");
|
||||||
fprintf(out, "\n");
|
fprintf(out, "\n");
|
||||||
fprintf(out, " bit CtsProtoTestCases:.ProtoOutputStreamBoolTest\\#testWrite,.ProtoOutputStreamBoolTest\\#testRepeated\n");
|
fprintf(out,
|
||||||
|
" bit "
|
||||||
|
"CtsProtoTestCases:.ProtoOutputStreamBoolTest#testWrite,.ProtoOutputStreamBoolTest#"
|
||||||
|
"testRepeated\n");
|
||||||
fprintf(out, " Builds and installs CtsProtoTestCases.apk, and runs the testWrite\n");
|
fprintf(out, " Builds and installs CtsProtoTestCases.apk, and runs the testWrite\n");
|
||||||
fprintf(out, " and testRepeated test methods on that class.\n");
|
fprintf(out, " and testRepeated test methods on that class.\n");
|
||||||
fprintf(out, "\n");
|
fprintf(out, "\n");
|
||||||
@@ -812,7 +815,7 @@ run_phases(vector<Target*> targets, const Options& options)
|
|||||||
|
|
||||||
// Stop & Sync
|
// Stop & Sync
|
||||||
if (!options.noRestart) {
|
if (!options.noRestart) {
|
||||||
err = run_adb("shell", "stop", NULL);
|
err = run_adb("exec-out", "stop", NULL);
|
||||||
check_error(err);
|
check_error(err);
|
||||||
}
|
}
|
||||||
err = run_adb("remount", NULL);
|
err = run_adb("remount", NULL);
|
||||||
@@ -831,9 +834,9 @@ run_phases(vector<Target*> targets, const Options& options)
|
|||||||
} else {
|
} else {
|
||||||
print_status("Restarting the runtime");
|
print_status("Restarting the runtime");
|
||||||
|
|
||||||
err = run_adb("shell", "setprop", "sys.boot_completed", "0", NULL);
|
err = run_adb("exec-out", "setprop", "sys.boot_completed", "0", NULL);
|
||||||
check_error(err);
|
check_error(err);
|
||||||
err = run_adb("shell", "start", NULL);
|
err = run_adb("exec-out", "start", NULL);
|
||||||
check_error(err);
|
check_error(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -846,7 +849,7 @@ run_phases(vector<Target*> targets, const Options& options)
|
|||||||
sleep(2);
|
sleep(2);
|
||||||
}
|
}
|
||||||
sleep(1);
|
sleep(1);
|
||||||
err = run_adb("shell", "wm", "dismiss-keyguard", NULL);
|
err = run_adb("exec-out", "wm", "dismiss-keyguard", NULL);
|
||||||
check_error(err);
|
check_error(err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -863,7 +866,7 @@ run_phases(vector<Target*> targets, const Options& options)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// TODO: if (!apk.file.fileInfo.exists || apk.file.HasChanged())
|
// TODO: if (!apk.file.fileInfo.exists || apk.file.HasChanged())
|
||||||
err = run_adb("shell", "mkdir", "-p", dir.c_str(), NULL);
|
err = run_adb("exec-out", "mkdir", "-p", dir.c_str(), NULL);
|
||||||
check_error(err);
|
check_error(err);
|
||||||
err = run_adb("push", pushed.file.filename.c_str(), pushed.dest.c_str(), NULL);
|
err = run_adb("push", pushed.file.filename.c_str(), pushed.dest.c_str(), NULL);
|
||||||
check_error(err);
|
check_error(err);
|
||||||
@@ -945,9 +948,9 @@ run_phases(vector<Target*> targets, const Options& options)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (runAll) {
|
if (runAll) {
|
||||||
err = run_adb("shell", installedPath.c_str(), NULL);
|
err = run_adb("exec-out", installedPath.c_str(), NULL);
|
||||||
} else {
|
} else {
|
||||||
err = run_adb("shell", installedPath.c_str(), filterArg.c_str(), NULL);
|
err = run_adb("exec-out", installedPath.c_str(), filterArg.c_str(), NULL);
|
||||||
}
|
}
|
||||||
if (err == 0) {
|
if (err == 0) {
|
||||||
target->testPassCount++;
|
target->testPassCount++;
|
||||||
@@ -1073,7 +1076,7 @@ run_phases(vector<Target*> targets, const Options& options)
|
|||||||
|
|
||||||
const ActivityAction& action = activityActions[0];
|
const ActivityAction& action = activityActions[0];
|
||||||
string componentName = action.packageName + "/" + action.className;
|
string componentName = action.packageName + "/" + action.className;
|
||||||
err = run_adb("shell", "am", "start", componentName.c_str(), NULL);
|
err = run_adb("exec-out", "am", "start", componentName.c_str(), NULL);
|
||||||
check_error(err);
|
check_error(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user