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

Unified Diff: javatests/org/chromium/distiller/JsTestSuiteBaseTest.java

Issue 1047853004: Use gtest_filter syntax in jstest filter (Closed) Base URL: git@github.com:chromium/dom-distiller.git@master
Patch Set: match full name Created 5 years, 9 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
Index: javatests/org/chromium/distiller/JsTestSuiteBaseTest.java
diff --git a/javatests/org/chromium/distiller/JsTestSuiteBaseTest.java b/javatests/org/chromium/distiller/JsTestSuiteBaseTest.java
index 1cac261befdd3671e75555777da2c0d3feef666a..718edaf5f61e2e36436df2dbbe12142e7c0392b8 100644
--- a/javatests/org/chromium/distiller/JsTestSuiteBaseTest.java
+++ b/javatests/org/chromium/distiller/JsTestSuiteBaseTest.java
@@ -73,17 +73,53 @@ public class JsTestSuiteBaseTest extends JsTestCase {
suite.addTestCase(null, "TestClass")
.addTest(null, "test1")
.addTest(null, "test2");
+ suite.addTestCase(null, "Test2Class")
+ .addTest(null, "test1");
+
Map<String, JsTestSuiteBase.TestCaseResults> results = suite.run(
- new TestLogger.NullLogger(), ".*TestClass.*");
+ new TestLogger.NullLogger(), "TestClass.*");
assertFalse(results.get("TestClass").getResults().get("test1").skipped());
assertFalse(results.get("TestClass").getResults().get("test2").skipped());
+ assertTrue(results.get("Test2Class").getResults().get("test1").skipped());
- results = suite.run(new TestLogger.NullLogger(), ".*NotTestClass.*");
+ results = suite.run(new TestLogger.NullLogger(), "*NotTestClass*");
assertTrue(results.get("TestClass").getResults().get("test1").skipped());
assertTrue(results.get("TestClass").getResults().get("test2").skipped());
+ assertTrue(results.get("Test2Class").getResults().get("test1").skipped());
+
+ results = suite.run(new TestLogger.NullLogger(), "TestClass.test1");
+ assertFalse(results.get("TestClass").getResults().get("test1").skipped());
+ assertTrue(results.get("TestClass").getResults().get("test2").skipped());
+ assertTrue(results.get("Test2Class").getResults().get("test1").skipped());
+
+ results = suite.run(new TestLogger.NullLogger(), "TestClass.*-*.test1");
+ assertTrue(results.get("TestClass").getResults().get("test1").skipped());
+ assertFalse(results.get("TestClass").getResults().get("test2").skipped());
+ assertTrue(results.get("Test2Class").getResults().get("test1").skipped());
+
+ results = suite.run(new TestLogger.NullLogger(), ":*.test1::*.test2:");
+ assertFalse(results.get("TestClass").getResults().get("test1").skipped());
+ assertFalse(results.get("TestClass").getResults().get("test2").skipped());
+ assertFalse(results.get("Test2Class").getResults().get("test1").skipped());
- results = suite.run(new TestLogger.NullLogger(), ".*TestClass.test1");
+ results = suite.run(new TestLogger.NullLogger(), "T*C*-*tes?2");
assertFalse(results.get("TestClass").getResults().get("test1").skipped());
assertTrue(results.get("TestClass").getResults().get("test2").skipped());
+ assertFalse(results.get("Test2Class").getResults().get("test1").skipped());
+
+ results = suite.run(new TestLogger.NullLogger(), "TestClass*:*test1-*test2");
cjhopman 2015/03/31 17:55:41 Should add a test with multiple negative patterns.
wychen 2015/03/31 18:26:49 Done.
+ assertFalse(results.get("TestClass").getResults().get("test1").skipped());
+ assertTrue(results.get("TestClass").getResults().get("test2").skipped());
+ assertFalse(results.get("Test2Class").getResults().get("test1").skipped());
+
+ results = suite.run(new TestLogger.NullLogger(), "-*1");
+ assertTrue(results.get("TestClass").getResults().get("test1").skipped());
+ assertFalse(results.get("TestClass").getResults().get("test2").skipped());
+ assertTrue(results.get("Test2Class").getResults().get("test1").skipped());
+
+ results = suite.run(new TestLogger.NullLogger(), "-*.e*");
+ assertFalse(results.get("TestClass").getResults().get("test1").skipped());
+ assertFalse(results.get("TestClass").getResults().get("test2").skipped());
+ assertFalse(results.get("Test2Class").getResults().get("test1").skipped());
}
}

Powered by Google App Engine
This is Rietveld 408576698