| Index: base/test/launcher/test_launcher.cc
|
| diff --git a/base/test/launcher/test_launcher.cc b/base/test/launcher/test_launcher.cc
|
| index 4b86c5621a938f7b57b7c2300ffa5437e1a9e6c8..e6880fa54f5f462acb4c3050e78b2f3f143a8885 100644
|
| --- a/base/test/launcher/test_launcher.cc
|
| +++ b/base/test/launcher/test_launcher.cc
|
| @@ -536,7 +536,7 @@ bool TestLauncher::Run() {
|
| if (requested_cycles != 1)
|
| results_tracker_.PrintSummaryOfAllIterations();
|
|
|
| - MaybeSaveSummaryAsJSON();
|
| + MaybeSaveSummaryAsJSON(std::vector<std::string>());
|
|
|
| return run_result_;
|
| }
|
| @@ -656,9 +656,7 @@ void TestLauncher::OnTestFinished(const TestResult& result) {
|
| KillSpawnedTestProcesses();
|
| #endif // defined(OS_POSIX)
|
|
|
| - results_tracker_.AddGlobalTag("BROKEN_TEST_EARLY_EXIT");
|
| - results_tracker_.AddGlobalTag(kUnreliableResultsTag);
|
| - MaybeSaveSummaryAsJSON();
|
| + MaybeSaveSummaryAsJSON({"BROKEN_TEST_EARLY_EXIT", kUnreliableResultsTag});
|
|
|
| exit(1);
|
| }
|
| @@ -989,6 +987,9 @@ void TestLauncher::RunTests() {
|
| test_names.push_back(test_name);
|
| }
|
|
|
| + // Save an early test summary in case the launcher crashes or gets killed.
|
| + MaybeSaveSummaryAsJSON({"EARLY_SUMMARY", kUnreliableResultsTag});
|
| +
|
| test_started_count_ = launcher_delegate_->RunTests(this, test_names);
|
|
|
| if (test_started_count_ == 0) {
|
| @@ -1026,12 +1027,13 @@ void TestLauncher::RunTestIteration() {
|
| FROM_HERE, Bind(&TestLauncher::RunTests, Unretained(this)));
|
| }
|
|
|
| -void TestLauncher::MaybeSaveSummaryAsJSON() {
|
| +void TestLauncher::MaybeSaveSummaryAsJSON(
|
| + const std::vector<std::string>& additional_tags) {
|
| const CommandLine* command_line = CommandLine::ForCurrentProcess();
|
| if (command_line->HasSwitch(switches::kTestLauncherSummaryOutput)) {
|
| FilePath summary_path(command_line->GetSwitchValuePath(
|
| switches::kTestLauncherSummaryOutput));
|
| - if (!results_tracker_.SaveSummaryAsJSON(summary_path)) {
|
| + if (!results_tracker_.SaveSummaryAsJSON(summary_path, additional_tags)) {
|
| LOG(ERROR) << "Failed to save test launcher output summary.";
|
| }
|
| }
|
|
|