Chromium Code Reviews| Index: base/test/launcher/test_results_tracker.cc |
| diff --git a/base/test/launcher/test_results_tracker.cc b/base/test/launcher/test_results_tracker.cc |
| index 3e680939b79541bb147a7db31e03d420414a328f..591c3853d7127b7a94042ac2eea481566bc2f80c 100644 |
| --- a/base/test/launcher/test_results_tracker.cc |
| +++ b/base/test/launcher/test_results_tracker.cc |
| @@ -12,6 +12,7 @@ |
| #include "base/json/json_file_value_serializer.h" |
| #include "base/json/string_escape.h" |
| #include "base/logging.h" |
| +#include "base/strings/string_util.h" |
| #include "base/strings/stringprintf.h" |
| #include "base/test/launcher/test_launcher.h" |
| #include "base/values.h" |
| @@ -155,6 +156,22 @@ void TestResultsTracker::OnTestIterationStarting() { |
| per_iteration_data_.push_back(PerIterationData()); |
| } |
| +void TestResultsTracker::AddTest(const std::string& test_name) { |
| + // Record disabled test names without DISABLED_ prefix so that they are easy |
| + // to compare with regular test names, e.g. before or after disabling. |
| + std::string test_name_no_disabled(test_name); |
| + ReplaceSubstringsAfterOffset(&test_name_no_disabled, 0, "DISABLED_", ""); |
| + all_tests_.insert(test_name_no_disabled); |
| +} |
| + |
| +void TestResultsTracker::AddDisabledTest(const std::string& test_name) { |
| + // Record disabled test names without DISABLED_ prefix so that they are easy |
| + // to compare with regular test names, e.g. before or after disabling. |
| + std::string test_name_no_disabled(test_name); |
| + ReplaceSubstringsAfterOffset(&test_name_no_disabled, 0, "DISABLED_", ""); |
| + disabled_tests_.insert(test_name_no_disabled); |
|
sky
2014/01/06 19:24:15
nit: refactor 170-171 into function above. I'm thi
Paweł Hajdan Jr.
2014/01/07 09:12:27
Done.
|
| +} |
| + |
| void TestResultsTracker::AddTestResult(const TestResult& result) { |
| DCHECK(thread_checker_.CalledOnValidThread()); |
| @@ -252,6 +269,24 @@ bool TestResultsTracker::SaveSummaryAsJSON(const FilePath& path) const { |
| global_tags->AppendString(*i); |
| } |
| + ListValue* all_tests = new ListValue; |
| + summary_root->Set("all_tests", all_tests); |
| + |
| + for (std::set<std::string>::const_iterator i = all_tests_.begin(); |
| + i != all_tests_.end(); |
| + ++i) { |
| + all_tests->AppendString(*i); |
| + } |
| + |
| + ListValue* disabled_tests = new ListValue; |
| + summary_root->Set("disabled_tests", disabled_tests); |
| + |
| + for (std::set<std::string>::const_iterator i = disabled_tests_.begin(); |
| + i != disabled_tests_.end(); |
| + ++i) { |
| + disabled_tests->AppendString(*i); |
| + } |
| + |
| ListValue* per_iteration_data = new ListValue; |
| summary_root->Set("per_iteration_data", per_iteration_data); |