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 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 test_results->Append(std::move(test_result_value)); | 375 test_results->Append(std::move(test_result_value)); |
376 } | 376 } |
377 | 377 |
378 current_iteration_data->SetWithoutPathExpansion(j->first, | 378 current_iteration_data->SetWithoutPathExpansion(j->first, |
379 std::move(test_results)); | 379 std::move(test_results)); |
380 } | 380 } |
381 per_iteration_data->Append(std::move(current_iteration_data)); | 381 per_iteration_data->Append(std::move(current_iteration_data)); |
382 } | 382 } |
383 summary_root->Set("per_iteration_data", std::move(per_iteration_data)); | 383 summary_root->Set("per_iteration_data", std::move(per_iteration_data)); |
384 | 384 |
| 385 std::unique_ptr<DictionaryValue> test_locations(new DictionaryValue); |
| 386 for (const auto& item : test_locations_) { |
| 387 std::string test_name = item.first; |
| 388 CodeLocation location = item.second; |
| 389 std::unique_ptr<DictionaryValue> location_value(new DictionaryValue); |
| 390 location_value->SetString("file", location.file); |
| 391 location_value->SetInteger("line", location.line); |
| 392 test_locations->SetWithoutPathExpansion(test_name, |
| 393 std::move(location_value)); |
| 394 } |
| 395 summary_root->Set("test_locations", std::move(test_locations)); |
| 396 |
385 JSONFileValueSerializer serializer(path); | 397 JSONFileValueSerializer serializer(path); |
386 return serializer.Serialize(*summary_root); | 398 return serializer.Serialize(*summary_root); |
387 } | 399 } |
388 | 400 |
389 TestResultsTracker::TestStatusMap | 401 TestResultsTracker::TestStatusMap |
390 TestResultsTracker::GetTestStatusMapForCurrentIteration() const { | 402 TestResultsTracker::GetTestStatusMapForCurrentIteration() const { |
391 TestStatusMap tests_by_status; | 403 TestStatusMap tests_by_status; |
392 GetTestStatusForIteration(iteration_, &tests_by_status); | 404 GetTestStatusForIteration(iteration_, &tests_by_status); |
393 return tests_by_status; | 405 return tests_by_status; |
394 } | 406 } |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 TestResultsTracker::PerIterationData::PerIterationData() { | 463 TestResultsTracker::PerIterationData::PerIterationData() { |
452 } | 464 } |
453 | 465 |
454 TestResultsTracker::PerIterationData::PerIterationData( | 466 TestResultsTracker::PerIterationData::PerIterationData( |
455 const PerIterationData& other) = default; | 467 const PerIterationData& other) = default; |
456 | 468 |
457 TestResultsTracker::PerIterationData::~PerIterationData() { | 469 TestResultsTracker::PerIterationData::~PerIterationData() { |
458 } | 470 } |
459 | 471 |
460 } // namespace base | 472 } // namespace base |
OLD | NEW |