OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/test/launcher/test_results_tracker.h" | 5 #include "base/test/launcher/test_results_tracker.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 "had unknown result"); | 289 "had unknown result"); |
290 | 290 |
291 fprintf(stdout, "End of the summary.\n"); | 291 fprintf(stdout, "End of the summary.\n"); |
292 fflush(stdout); | 292 fflush(stdout); |
293 } | 293 } |
294 | 294 |
295 void TestResultsTracker::AddGlobalTag(const std::string& tag) { | 295 void TestResultsTracker::AddGlobalTag(const std::string& tag) { |
296 global_tags_.insert(tag); | 296 global_tags_.insert(tag); |
297 } | 297 } |
298 | 298 |
299 bool TestResultsTracker::SaveSummaryAsJSON(const FilePath& path) const { | 299 bool TestResultsTracker::SaveSummaryAsJSON( |
| 300 const FilePath& path, |
| 301 const std::vector<std::string>& additional_tags) const { |
300 std::unique_ptr<DictionaryValue> summary_root(new DictionaryValue); | 302 std::unique_ptr<DictionaryValue> summary_root(new DictionaryValue); |
301 | 303 |
302 std::unique_ptr<ListValue> global_tags(new ListValue); | 304 std::unique_ptr<ListValue> global_tags(new ListValue); |
303 for (const auto& global_tag : global_tags_) { | 305 for (const auto& global_tag : global_tags_) { |
304 global_tags->AppendString(global_tag); | 306 global_tags->AppendString(global_tag); |
305 } | 307 } |
| 308 for (const auto& tag : additional_tags) { |
| 309 global_tags->AppendString(tag); |
| 310 } |
306 summary_root->Set("global_tags", std::move(global_tags)); | 311 summary_root->Set("global_tags", std::move(global_tags)); |
307 | 312 |
308 std::unique_ptr<ListValue> all_tests(new ListValue); | 313 std::unique_ptr<ListValue> all_tests(new ListValue); |
309 for (const auto& test : all_tests_) { | 314 for (const auto& test : all_tests_) { |
310 all_tests->AppendString(test); | 315 all_tests->AppendString(test); |
311 } | 316 } |
312 summary_root->Set("all_tests", std::move(all_tests)); | 317 summary_root->Set("all_tests", std::move(all_tests)); |
313 | 318 |
314 std::unique_ptr<ListValue> disabled_tests(new ListValue); | 319 std::unique_ptr<ListValue> disabled_tests(new ListValue); |
315 for (const auto& disabled_test : disabled_tests_) { | 320 for (const auto& disabled_test : disabled_tests_) { |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 TestResultsTracker::PerIterationData::PerIterationData() { | 446 TestResultsTracker::PerIterationData::PerIterationData() { |
442 } | 447 } |
443 | 448 |
444 TestResultsTracker::PerIterationData::PerIterationData( | 449 TestResultsTracker::PerIterationData::PerIterationData( |
445 const PerIterationData& other) = default; | 450 const PerIterationData& other) = default; |
446 | 451 |
447 TestResultsTracker::PerIterationData::~PerIterationData() { | 452 TestResultsTracker::PerIterationData::~PerIterationData() { |
448 } | 453 } |
449 | 454 |
450 } // namespace base | 455 } // namespace base |
OLD | NEW |