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

Side by Side 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: rewrite logic and add tests Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « javatests/org/chromium/distiller/JsTestSuiteBase.java ('k') | run_jstests.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.distiller; 5 package org.chromium.distiller;
6 6
7 import java.util.Map; 7 import java.util.Map;
8 import java.util.Set; 8 import java.util.Set;
9 9
10 public class JsTestSuiteBaseTest extends JsTestCase { 10 public class JsTestSuiteBaseTest extends JsTestCase {
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 JsTestSuiteBase.stackFrameString(new StackTraceElement(null, 66 JsTestSuiteBase.stackFrameString(new StackTraceElement(null,
67 "org_chromium_distiller_ClassName_functionName__Ljava_la ng_String_2V", 67 "org_chromium_distiller_ClassName_functionName__Ljava_la ng_String_2V",
68 "FileName.java", 123)))); 68 "FileName.java", 123))));
69 } 69 }
70 70
71 public void testJsTestSuiteFilter() { 71 public void testJsTestSuiteFilter() {
72 JsTestSuiteBase suite = new JsTestSuiteBase(); 72 JsTestSuiteBase suite = new JsTestSuiteBase();
73 suite.addTestCase(null, "TestClass") 73 suite.addTestCase(null, "TestClass")
74 .addTest(null, "test1") 74 .addTest(null, "test1")
75 .addTest(null, "test2"); 75 .addTest(null, "test2");
76 suite.addTestCase(null, "Test2Class")
77 .addTest(null, "test1");
78
76 Map<String, JsTestSuiteBase.TestCaseResults> results = suite.run( 79 Map<String, JsTestSuiteBase.TestCaseResults> results = suite.run(
77 new TestLogger.NullLogger(), ".*TestClass.*"); 80 new TestLogger.NullLogger(), "TestClass.*");
78 assertFalse(results.get("TestClass").getResults().get("test1").skipped() ); 81 assertFalse(results.get("TestClass").getResults().get("test1").skipped() );
79 assertFalse(results.get("TestClass").getResults().get("test2").skipped() ); 82 assertFalse(results.get("TestClass").getResults().get("test2").skipped() );
83 assertTrue(results.get("Test2Class").getResults().get("test1").skipped() );
80 84
81 results = suite.run(new TestLogger.NullLogger(), ".*NotTestClass.*"); 85 results = suite.run(new TestLogger.NullLogger(), "*NotTestClass*");
82 assertTrue(results.get("TestClass").getResults().get("test1").skipped()) ; 86 assertTrue(results.get("TestClass").getResults().get("test1").skipped()) ;
83 assertTrue(results.get("TestClass").getResults().get("test2").skipped()) ; 87 assertTrue(results.get("TestClass").getResults().get("test2").skipped()) ;
88 assertTrue(results.get("Test2Class").getResults().get("test1").skipped() );
84 89
85 results = suite.run(new TestLogger.NullLogger(), ".*TestClass.test1"); 90 results = suite.run(new TestLogger.NullLogger(), "TestClass.test1");
86 assertFalse(results.get("TestClass").getResults().get("test1").skipped() ); 91 assertFalse(results.get("TestClass").getResults().get("test1").skipped() );
87 assertTrue(results.get("TestClass").getResults().get("test2").skipped()) ; 92 assertTrue(results.get("TestClass").getResults().get("test2").skipped()) ;
93 assertTrue(results.get("Test2Class").getResults().get("test1").skipped() );
94
95 results = suite.run(new TestLogger.NullLogger(), "TestClass.*-*.test1");
96 assertTrue(results.get("TestClass").getResults().get("test1").skipped()) ;
97 assertFalse(results.get("TestClass").getResults().get("test2").skipped() );
98 assertTrue(results.get("Test2Class").getResults().get("test1").skipped() );
99
100 results = suite.run(new TestLogger.NullLogger(), ":*.test1::*.test2:");
101 assertFalse(results.get("TestClass").getResults().get("test1").skipped() );
102 assertFalse(results.get("TestClass").getResults().get("test2").skipped() );
103 assertFalse(results.get("Test2Class").getResults().get("test1").skipped( ));
104
105 results = suite.run(new TestLogger.NullLogger(), "T*C*-*tes?2");
106 assertFalse(results.get("TestClass").getResults().get("test1").skipped() );
107 assertTrue(results.get("TestClass").getResults().get("test2").skipped()) ;
108 assertFalse(results.get("Test2Class").getResults().get("test1").skipped( ));
109
110 results = suite.run(new TestLogger.NullLogger(), "TestClass*:*test1-*tes t2");
111 assertFalse(results.get("TestClass").getResults().get("test1").skipped() );
112 assertTrue(results.get("TestClass").getResults().get("test2").skipped()) ;
113 assertFalse(results.get("Test2Class").getResults().get("test1").skipped( ));
114
115 results = suite.run(new TestLogger.NullLogger(), "-*1");
116 assertTrue(results.get("TestClass").getResults().get("test1").skipped()) ;
117 assertFalse(results.get("TestClass").getResults().get("test2").skipped() );
118 assertTrue(results.get("Test2Class").getResults().get("test1").skipped() );
119
120 results = suite.run(new TestLogger.NullLogger(), "-*.e*");
121 assertFalse(results.get("TestClass").getResults().get("test1").skipped() );
122 assertFalse(results.get("TestClass").getResults().get("test2").skipped() );
123 assertFalse(results.get("Test2Class").getResults().get("test1").skipped( ));
124
125 results = suite.run(new TestLogger.NullLogger(), "-TestClass.test1-TestC lass.test2");
cjhopman 2015/03/31 20:27:54 Ah, here's a bit of the confusion. From my reading
nyquist 2015/03/31 23:03:05 Yeah, that's how I understand it as well.
wychen 2015/04/01 15:44:07 Oh! I misread it. Fixed. I thought it was somethin
126 assertTrue(results.get("TestClass").getResults().get("test1").skipped()) ;
127 assertTrue(results.get("TestClass").getResults().get("test2").skipped()) ;
128 assertFalse(results.get("Test2Class").getResults().get("test1").skipped( ));
88 } 129 }
89 } 130 }
OLDNEW
« no previous file with comments | « javatests/org/chromium/distiller/JsTestSuiteBase.java ('k') | run_jstests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698