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

Unified Diff: base/test/test_suite.cc

Issue 26883002: Introduce base::TestSuite::DisableTests(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: now works on Android Created 7 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
« no previous file with comments | « base/test/test_suite.h ('k') | media/base/android/media_codec_bridge_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/test_suite.cc
diff --git a/base/test/test_suite.cc b/base/test/test_suite.cc
index 9d7c158f029bc9c53f8f12f230e7475f92880470..acc57e4e7f57c558c9d4e7e0b79bf1575c9a3db4 100644
--- a/base/test/test_suite.cc
+++ b/base/test/test_suite.cc
@@ -140,6 +140,18 @@ void TestSuite::CatchMaybeTests() {
listeners.Append(new MaybeTestDisabler);
}
+void TestSuite::DisableTests(const std::string& filter) {
+ std::string gtest_filter = ::testing::FLAGS_gtest_filter;
+
+ size_t dash_pos = gtest_filter.find('-');
+ if (dash_pos == std::string::npos) // Not found.
+ gtest_filter += "-";
+
+ gtest_filter += ":";
+ gtest_filter += filter;
+ ::testing::FLAGS_gtest_filter = gtest_filter;
+}
+
void TestSuite::ResetCommandLine() {
testing::TestEventListeners& listeners =
testing::UnitTest::GetInstance()->listeners();
« no previous file with comments | « base/test/test_suite.h ('k') | media/base/android/media_codec_bridge_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698