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

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: Created 4 years, 2 months 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
« base/test/launcher/test_launcher.cc ('K') | « 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..16431e572545856ad9cdf6a9e8f686c9f8a37d4a 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) {
Paweł Hajdan Jr. 2016/10/25 18:16:59 Why not use TestNameWithoutDisabledPrefix as a nam
stgao 2016/10/25 19:16:49 Was to follow the existing function "FormatFullTes
- 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
@@ -221,7 +216,7 @@ void TestResultsTracker::AddTest(
const std::string& test_name, const std::string& file, int line) {
// Record disabled test names without DISABLED_ prefix so that they are easy
// to compare with regular test names, e.g. before or after disabling.
- all_tests_.insert(TestNameWithoutDisabledPrefix(test_name));
+ all_tests_.insert(NormalizeTestName(test_name));
test_locations_.insert(std::make_pair(test_name, CodeLocation(file, line)));
}
@@ -229,14 +224,17 @@ void TestResultsTracker::AddTest(
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.
- disabled_tests_.insert(TestNameWithoutDisabledPrefix(test_name));
+ disabled_tests_.insert(NormalizeTestName(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);
+ NormalizeTestName(result.full_name)].test_results.push_back(
+ result);
}
void TestResultsTracker::PrintSummaryOfCurrentIteration() const {
« base/test/launcher/test_launcher.cc ('K') | « base/test/launcher/test_launcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698