Loading tools/bit/main.cpp +36 −26 Original line number Diff line number Diff line Loading @@ -79,6 +79,7 @@ struct Options { string tabPattern; // For build/install/test bool noRestart; bool reboot; vector<Target*> targets; Loading @@ -89,6 +90,7 @@ struct Options { Options::Options() :runHelp(false), runTab(false), noRestart(false), reboot(false), targets() { Loading Loading @@ -285,6 +287,7 @@ print_usage(FILE* out) { fprintf(out, " -i Install the targets\n"); fprintf(out, " -t Run the tests\n"); fprintf(out, "\n"); fprintf(out, " -n Don't reboot or restart\n"); fprintf(out, " -r If the runtime needs to be restarted, do a full reboot\n"); fprintf(out, " instead\n"); fprintf(out, "\n"); Loading Loading @@ -431,6 +434,9 @@ parse_args(Options* options, int argc, const char** argv) flagTest = true; anyPhases = true; break; case 'n': options->noRestart = true; break; case 'r': options->reboot = true; break; Loading Loading @@ -558,7 +564,7 @@ check_device_property(const string& property, const string& expected) * Run the build, install, and test actions. */ void run_phases(vector<Target*> targets, bool reboot) run_phases(vector<Target*> targets, const Options& options) { int err = 0; Loading Loading @@ -676,14 +682,17 @@ run_phases(vector<Target*> targets, bool reboot) check_device_property("ro.build.id", buildId); // Stop & Sync if (!options.noRestart) { err = run_adb("shell", "stop", NULL); check_error(err); } err = run_adb("remount", NULL); check_error(err); err = run_adb("sync", "system", NULL); check_error(err); if (reboot) { if (!options.noRestart) { if (options.reboot) { print_status("Rebooting"); err = run_adb("reboot", NULL); Loading Loading @@ -712,6 +721,7 @@ run_phases(vector<Target*> targets, bool reboot) check_error(err); } } } // Install APKs if (installApks.size() > 0) { Loading Loading @@ -976,7 +986,7 @@ main(int argc, const char** argv) exit(0); } else { // Normal run run_phases(options.targets, options.reboot); run_phases(options.targets, options); } return 0; Loading Loading
tools/bit/main.cpp +36 −26 Original line number Diff line number Diff line Loading @@ -79,6 +79,7 @@ struct Options { string tabPattern; // For build/install/test bool noRestart; bool reboot; vector<Target*> targets; Loading @@ -89,6 +90,7 @@ struct Options { Options::Options() :runHelp(false), runTab(false), noRestart(false), reboot(false), targets() { Loading Loading @@ -285,6 +287,7 @@ print_usage(FILE* out) { fprintf(out, " -i Install the targets\n"); fprintf(out, " -t Run the tests\n"); fprintf(out, "\n"); fprintf(out, " -n Don't reboot or restart\n"); fprintf(out, " -r If the runtime needs to be restarted, do a full reboot\n"); fprintf(out, " instead\n"); fprintf(out, "\n"); Loading Loading @@ -431,6 +434,9 @@ parse_args(Options* options, int argc, const char** argv) flagTest = true; anyPhases = true; break; case 'n': options->noRestart = true; break; case 'r': options->reboot = true; break; Loading Loading @@ -558,7 +564,7 @@ check_device_property(const string& property, const string& expected) * Run the build, install, and test actions. */ void run_phases(vector<Target*> targets, bool reboot) run_phases(vector<Target*> targets, const Options& options) { int err = 0; Loading Loading @@ -676,14 +682,17 @@ run_phases(vector<Target*> targets, bool reboot) check_device_property("ro.build.id", buildId); // Stop & Sync if (!options.noRestart) { err = run_adb("shell", "stop", NULL); check_error(err); } err = run_adb("remount", NULL); check_error(err); err = run_adb("sync", "system", NULL); check_error(err); if (reboot) { if (!options.noRestart) { if (options.reboot) { print_status("Rebooting"); err = run_adb("reboot", NULL); Loading Loading @@ -712,6 +721,7 @@ run_phases(vector<Target*> targets, bool reboot) check_error(err); } } } // Install APKs if (installApks.size() > 0) { Loading Loading @@ -976,7 +986,7 @@ main(int argc, const char** argv) exit(0); } else { // Normal run run_phases(options.targets, options.reboot); run_phases(options.targets, options); } return 0; Loading