Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2187)

Unified Diff: base/test/launcher/test_results_tracker.cc

Issue 2439423003: test launcher: make --gtest_filter=A.B + --gtest_also_run_disabled_tests also run A.DISABLED_B or D… (Closed)
Patch Set: Just rebase. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/test/launcher/test_launcher.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6b56761f78d7eaada50a774b395ddafb2d586532..f36907eefc521b63e1749aa975c6d85efe3375af 100644
--- a/base/test/launcher/test_results_tracker.cc
+++ b/base/test/launcher/test_results_tracker.cc
@@ -18,6 +18,7 @@
#include "base/logging.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
+#include "base/test/gtest_util.h"
#include "base/test/launcher/test_launcher.h"
#include "base/values.h"
@@ -29,12 +30,6 @@ namespace {
const FilePath::CharType kDefaultOutputFile[] = FILE_PATH_LITERAL(
"test_detail.xml");
-std::string TestNameWithoutDisabledPrefix(const std::string& test_name) {
- std::string test_name_no_disabled(test_name);
- ReplaceSubstringsAfterOffset(&test_name_no_disabled, 0, "DISABLED_", "");
- return test_name_no_disabled;
-}
-
// Converts the given epoch time in milliseconds to a date string in the ISO
// 8601 format, without the timezone information.
// TODO(xyzzyz): Find a good place in Chromium to put it and refactor all uses
@@ -235,8 +230,11 @@ void TestResultsTracker::AddDisabledTest(const std::string& test_name) {
void TestResultsTracker::AddTestResult(const TestResult& result) {
DCHECK(thread_checker_.CalledOnValidThread());
+ // Record disabled test names without DISABLED_ prefix so that they are easy
+ // to compare with regular test names, e.g. before or after disabling.
per_iteration_data_[iteration_].results[
- result.full_name].test_results.push_back(result);
+ TestNameWithoutDisabledPrefix(result.full_name)].test_results.push_back(
+ result);
}
void TestResultsTracker::PrintSummaryOfCurrentIteration() const {
« no previous file with comments | « base/test/launcher/test_launcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698