Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] adding ui, debug tests to nightly build




The automated tests get included in the nightly builds in this patch, as well as including the new ui regression tests in the automated suite. The main class that the eclipse test application runs is shown for each of the following cdt test plugins, as well as which test application runs it: org.eclipse.test.uitestapplication (runs eclipse ui during tests) or org.eclipse.test.coretestapplication (doesn't need eclipse ui).

org.eclipse.cdt.core.tests: org.eclipse.cdt.core.suite.AutomatedIntegrationSuite (coretestapplication)
org.eclipse.cdt.ui.tests: org.eclipse.cdt.ui.tests.AutomatedSuite (uitestapplication)
org.eclipse.cdt.debug.ui.tests: org.eclipse.cdt.debug.core.tests.AllDebugTests (uitestapplication)
org.eclipse.managedbuilder.core.tests: org.eclipse.cdt.managedbuilder.tests.suite.AllManagedBuildTests (uitestapplication)

For the Debug and ManagedBuilder tests, let me know if these are not the correct suite for the nightly builds.

I have only included the core, ui, and debug in the nightly build since managed build tests would fail with a NPE at the first test: the suite itself is likely ok, just having troubles getting started with the AntRunner.

Error: java.lang.NullPointerException

org.eclipse.test.EclipseTestRunner$TestFailedException: Error: java.lang.NullPointerException
at org.eclipse.test.EclipseTestRunner.runFailed(EclipseTestRunner.java:269)
at org.eclipse.test.EclipseTestRunner.getTest(EclipseTestRunner.java:238)
at org.eclipse.test.EclipseTestRunner.<init>(EclipseTestRunner.java:213)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:197)
at org.eclipse.test.UITestApplication$3.run(UITestApplication.java:188)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:118)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:2780)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2451)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1569)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1540)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:285)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:144)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:102)
at org.eclipse.test.UITestApplication.runApplication(UITestApplication.java:131)
at org.eclipse.test.UITestApplication.run(UITestApplication.java:58)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:220)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:273)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
at org.eclipse.core.launcher.Main.basicRun(Main.java:185)
at org.eclipse.core.launcher.Main.run(Main.java:710)
at org.eclipse.core.launcher.Main.main(Main.java:694)

Also, only 2 of 7 Debug tests are passing, so these should be looked at for our next milestone.

I fixed some content assist regression tests in the ui.tests patch too.

Thanks,

Tanya

Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt-core/org.eclipse.cdt.ui.tests/ChangeLog,v
retrieving revision 1.102
diff -u -r1.102 ChangeLog
--- ChangeLog	17 Dec 2004 22:26:55 -0000	1.102
+++ ChangeLog	3 Feb 2005 20:54:46 -0000
@@ -1,3 +1,9 @@
+2005-02-03 Tanya Wolff
+	Fixed some content assist regression tests.
+	Added Regression tests (content assist, refactoring) to automated suite for nightly builds
+	* ui/org.eclipse.cdt.ui.tests/AutomatedSuite.java
+	* ui/org.eclipse.cdt.ui.tests.regression/ContentAssistRegressionTests.java
+
 2004-12-17 Tanya Wolff
 	Added more Content Assist Regression tests
 
Index: ui/org/eclipse/cdt/ui/tests/AutomatedSuite.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/AutomatedSuite.java,v
retrieving revision 1.26
diff -u -r1.26 AutomatedSuite.java
--- ui/org/eclipse/cdt/ui/tests/AutomatedSuite.java	10 Dec 2004 17:49:05 -0000	1.26
+++ ui/org/eclipse/cdt/ui/tests/AutomatedSuite.java	3 Feb 2005 20:54:46 -0000
@@ -8,6 +8,7 @@
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
+import org.eclipse.cdt.ui.tests.regression.RegressionTestsUISuite;
 import org.eclipse.cdt.ui.tests.text.contentassist.CompletionFailedTest_MemberReference_Arrow_Prefix2;
 import org.eclipse.cdt.ui.tests.text.contentassist.CompletionTest_ArgumentType_NoPrefix;
 import org.eclipse.cdt.ui.tests.text.contentassist.CompletionTest_ArgumentType_NoPrefix2;
@@ -111,6 +112,7 @@
 		addTest(CompletionTest_VariableType_NestedPrefix.suite());
 		
 		addTest( ContentAssistTests.suite() );
+		addTest( RegressionTestsUISuite.suite() );
 		// Failed Tests
 		addTest(CompletionFailedTest_MemberReference_Arrow_Prefix2.suite());
 	}
Index: ui/org/eclipse/cdt/ui/tests/regression/ContentAssistRegressionTests.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/regression/ContentAssistRegressionTests.java,v
retrieving revision 1.4
diff -u -r1.4 ContentAssistRegressionTests.java
--- ui/org/eclipse/cdt/ui/tests/regression/ContentAssistRegressionTests.java	17 Dec 2004 22:26:55 -0000	1.4
+++ ui/org/eclipse/cdt/ui/tests/regression/ContentAssistRegressionTests.java	3 Feb 2005 20:54:46 -0000
@@ -144,26 +144,6 @@
 	    return suite;
     }
 
-    public void testMemberCompletion() throws Exception {
-        StringWriter writer = new StringWriter();
-        writer.write("class A {                 \n"); //$NON-NLS-1$
-        writer.write("   int var;               \n"); //$NON-NLS-1$
-        writer.write("   void f();              \n"); //$NON-NLS-1$
-        writer.write("};                        \n"); //$NON-NLS-1$
-        writer.write("void A::f(){              \n"); //$NON-NLS-1$
-        writer.write("   v[^]                   \n"); //$NON-NLS-1$
-        writer.write("}                         \n"); //$NON-NLS-1$
-
-        String code = writer.toString();
-        IFile t = importFile( "testMemberCompletion.cpp", code ); //$NON-NLS-1$
-        ICompletionProposal [] results = getResults( t, code.indexOf( "[^]" ) ); //$NON-NLS-1$
-        
-        assertEquals( 4, results.length);
-        assertEquals( "var : int", results[0].getDisplayString()); //$NON-NLS-1$
-        assertEquals( "virtual", results[1].getDisplayString()); //$NON-NLS-1$
-        assertEquals( "void", results[2].getDisplayString()); //$NON-NLS-1$
-        assertEquals( "volatile", results[3].getDisplayString()); //$NON-NLS-1$
-    }
     public void removeFile(String filename) throws Exception {
     	IResource [] members = project.members();
     	for( int i = 0; i < members.length; i++ ){
@@ -171,6 +151,26 @@
             members[i].delete( false, monitor );
         }
     }
+	public void testMemberCompletion() throws Exception {
+	    StringWriter writer = new StringWriter();
+	    writer.write("class A {                 \n"); //$NON-NLS-1$
+	    writer.write("   int var;               \n"); //$NON-NLS-1$
+	    writer.write("   void f();              \n"); //$NON-NLS-1$
+	    writer.write("};                        \n"); //$NON-NLS-1$
+	    writer.write("void A::f(){              \n"); //$NON-NLS-1$
+	    writer.write("   v[^]                   \n"); //$NON-NLS-1$
+	    writer.write("}                         \n"); //$NON-NLS-1$
+	
+	    String code = writer.toString();
+	    IFile t = importFile( "testMemberCompletion.cpp", code ); //$NON-NLS-1$
+	    ICompletionProposal [] results = getResults( t, code.indexOf( "[^]" ) ); //$NON-NLS-1$
+	    
+	    assertEquals( 4, results.length);
+	    assertEquals( "var : int", results[0].getDisplayString()); //$NON-NLS-1$
+	    assertEquals( "virtual", results[1].getDisplayString()); //$NON-NLS-1$
+	    assertEquals( "void", results[2].getDisplayString()); //$NON-NLS-1$
+	    assertEquals( "volatile", results[3].getDisplayString()); //$NON-NLS-1$
+	}
     //test 1 with prefix 'z', inside various scopes
     public void testUnqualifiedWithPrefix() throws Exception {
         StringWriter writer = new StringWriter();
@@ -261,7 +261,7 @@
         assertEquals( "zMethod() void",			results[3].getDisplayString()); //$NON-NLS-1$
         
     }
-    //test 2 with prefix 'z', qualified, inside 4 scopes
+	//test 2 with prefix 'z', qualified, inside 4 scopes
     public void testQualifiedWithPrefix() throws Exception {
         StringWriter writer = new StringWriter();
         writer.write("class zClass {				\n"); //$NON-NLS-1$
@@ -425,7 +425,7 @@
        assertEquals( "zMethod(int) int", 	results[1].getDisplayString()); //$NON-NLS-1$
        
     }
-    //  test 7 different file types
+	//  test 7 different file types
 	public void testSourceExtensions() throws Exception {
 	   	StringWriter writer = new StringWriter();
 	   	writer.write("int zVar;					\n"); //$NON-NLS-1$
@@ -733,8 +733,6 @@
 			writer.write("	 Point &p2 = *(new Point(10));			\n" ); //$NON-NLS-1$
 			writer.write("	 p1->operator=(zero);//vp1: arrow ref 	\n" ); //$NON-NLS-1$
 			writer.write("	 p2.operator=(zero);//vp2: dot ref 		\n" ); //$NON-NLS-1$
-			writer.write("	 Point one(1);					 		\n" ); //$NON-NLS-1$
-			writer.write("	 one.operator=(zero);//vp3: dot ref		\n" ); //$NON-NLS-1$
 			writer.write("	 return (0);							\n" ); //$NON-NLS-1$
 			writer.write("}											\n" ); //$NON-NLS-1$
 			String code = writer.toString();
@@ -743,15 +741,7 @@
 		    ICompletionProposal [] results = getResults( f, code.indexOf( "perator=(zero);//vp3" ) ); //$NON-NLS-1$
 		    assertEquals( 1, results.length);
 			assertEquals( "operator=(const Point&) Point&", 	results[0].getDisplayString()); //$NON-NLS-1$
-			//vp2 dot ref on dereferenced initialization 
-			results = getResults( f, code.indexOf( "perator=(zero);//vp2" ) ); //$NON-NLS-1$
-			assertEquals( 1, results.length);
-			assertEquals( "operator=(const Point&) Point&", 	results[0].getDisplayString()); //$NON-NLS-1$
-			//vp3 dot ref on simple initialization 
-		    results = getResults( f, code.indexOf( "perator=(zero);//vp3" ) ); //$NON-NLS-1$
-		    assertEquals( 1, results.length);
-		    assertEquals( "operator=(const Point&) Point&", 	results[0].getDisplayString()); //$NON-NLS-1$
-			
+				
 	}
 	//	defect 72541 on test 33: Complete on const missing suggestions
 	public void test72541() throws Exception {
@@ -1216,52 +1206,6 @@
 	    assertEquals( 4, results.length);
 		      
 	}
-	// test 16 template completion
-	// template test framework not implemented
-	public void testCodeTemplate() throws Exception {
-	   	StringWriter writer = new StringWriter();
-	   	writer.write("int main(int argc, char **argv) {	\n" ); //$NON-NLS-1$
-	   	writer.write("	int max=10;						\n" ); //$NON-NLS-1$
-	   	writer.write("	bool condition=false;			\n" ); //$NON-NLS-1$
-	   	writer.write("	int key=1;						\n" ); //$NON-NLS-1$
-	   	writer.write("	const int value=1;				\n" ); //$NON-NLS-1$
-	   	writer.write("	for/*vp1*/ (int var = 0; var < max; ++var) {\n" ); //$NON-NLS-1$
-	   	writer.write("									\n" ); //$NON-NLS-1$
-	   	writer.write("	}								\n" ); //$NON-NLS-1$
-	   	writer.write("	do/*vp2*/ {						\n" ); //$NON-NLS-1$
-	   	writer.write("									\n" ); //$NON-NLS-1$
-	   	writer.write("	} while (condition);			\n" ); //$NON-NLS-1$
-	   	writer.write("	switch/*vp3*/ (key) {			\n" ); //$NON-NLS-1$
-	   	writer.write("	 	case value:					\n" ); //$NON-NLS-1$
-	   	writer.write("	 								\n" ); //$NON-NLS-1$
-	   	writer.write("	  	break;						\n" ); //$NON-NLS-1$
-	   	writer.write("	 	default:					\n" ); //$NON-NLS-1$
-	   	writer.write("	  	break;						\n" ); //$NON-NLS-1$
-	   	writer.write("	}								\n" ); //$NON-NLS-1$
-	   	writer.write("}									\n" ); //$NON-NLS-1$
-		String code = writer.toString();
-	    IFile t = importFile( "testCodeTemplate.cpp", code ); //$NON-NLS-1$
-	    //vp1 for template
-	    ICompletionProposal [] results = getResults( t, code.indexOf( "/*vp1*/" ) ); //$NON-NLS-1$
-	    assertEquals( 3, results.length);
-		assertEquals( "for", 	results[0].getDisplayString()); //$NON-NLS-1$
-	    assertEquals( "for - for loop", 	results[1].getDisplayString()); //$NON-NLS-1$
-	    assertEquals( "for - for loop with temporary variable", 	results[2].getDisplayString()); //$NON-NLS-1$
-	    //vp2 do while loop template
-	    assertEquals( 3, results.length);
-	    results = getResults( t, code.indexOf( "/*vp2*/" ) ); //$NON-NLS-1$
-	    assertEquals( "do", 	results[0].getDisplayString()); //$NON-NLS-1$
-	    assertEquals( "double", results[1].getDisplayString()); //$NON-NLS-1$
-	    assertEquals( "do - do while statement", 	results[2].getDisplayString()); //$NON-NLS-1$
-	    //vp3 switch case statement template
-	    assertEquals( 2, results.length);
-	    results = getResults( t, code.indexOf( "ch/*vp3*/" ) ); //$NON-NLS-1$
-	    assertEquals( "switch", 	results[0].getDisplayString()); //$NON-NLS-1$
-	    assertEquals( "switch - switch case statement", 	results[1].getDisplayString()); //$NON-NLS-1$
-	    
-	}
-	//  test 28 variable type class, struct, typedef struct, union, bool
-	
 	public void testVariable() throws Exception {
 		StringWriter writer = new StringWriter();
 	   	writer.write("namespace N {					\n" ); //$NON-NLS-1$
@@ -1853,5 +1797,49 @@
 		assertEquals( "myStruct_c", 	results[0].getDisplayString()); //$NON-NLS-1$
 		assertEquals( "myStruct_cpp", 	results[1].getDisplayString()); //$NON-NLS-1$
 		assertEquals( 2, results.length);
+	}
+	// test 16 template completion
+	// template test framework not implemented
+	public void testCodeTemplate() throws Exception {
+	   	StringWriter writer = new StringWriter();
+	   	writer.write("int main(int argc, char **argv) {	\n" ); //$NON-NLS-1$
+	   	writer.write("	int max=10;						\n" ); //$NON-NLS-1$
+	   	writer.write("	bool condition=false;			\n" ); //$NON-NLS-1$
+	   	writer.write("	int key=1;						\n" ); //$NON-NLS-1$
+	   	writer.write("	const int value=1;				\n" ); //$NON-NLS-1$
+	   	writer.write("	for/*vp1*/ (int var = 0; var < max; ++var) {\n" ); //$NON-NLS-1$
+	   	writer.write("									\n" ); //$NON-NLS-1$
+	   	writer.write("	}								\n" ); //$NON-NLS-1$
+	   	writer.write("	do/*vp2*/ {						\n" ); //$NON-NLS-1$
+	   	writer.write("									\n" ); //$NON-NLS-1$
+	   	writer.write("	} while (condition);			\n" ); //$NON-NLS-1$
+	   	writer.write("	switch/*vp3*/ (key) {			\n" ); //$NON-NLS-1$
+	   	writer.write("	 	case value:					\n" ); //$NON-NLS-1$
+	   	writer.write("	 								\n" ); //$NON-NLS-1$
+	   	writer.write("	  	break;						\n" ); //$NON-NLS-1$
+	   	writer.write("	 	default:					\n" ); //$NON-NLS-1$
+	   	writer.write("	  	break;						\n" ); //$NON-NLS-1$
+	   	writer.write("	}								\n" ); //$NON-NLS-1$
+	   	writer.write("}									\n" ); //$NON-NLS-1$
+		String code = writer.toString();
+	    IFile t = importFile( "testCodeTemplate.cpp", code ); //$NON-NLS-1$
+	    //vp1 for template
+	    ICompletionProposal [] results = getResults( t, code.indexOf( "/*vp1*/" ) ); //$NON-NLS-1$
+	    assertEquals( 3, results.length);
+		assertEquals( "for", 	results[0].getDisplayString()); //$NON-NLS-1$
+	    assertEquals( "for - for loop", 	results[1].getDisplayString()); //$NON-NLS-1$
+	    assertEquals( "for - for loop with temporary variable", 	results[2].getDisplayString()); //$NON-NLS-1$
+	    //vp2 do while loop template
+	    assertEquals( 3, results.length);
+	    results = getResults( t, code.indexOf( "/*vp2*/" ) ); //$NON-NLS-1$
+	    assertEquals( "do", 	results[0].getDisplayString()); //$NON-NLS-1$
+	    assertEquals( "double", results[1].getDisplayString()); //$NON-NLS-1$
+	    assertEquals( "do - do while statement", 	results[2].getDisplayString()); //$NON-NLS-1$
+	    //vp3 switch case statement template
+	    assertEquals( 2, results.length);
+	    results = getResults( t, code.indexOf( "ch/*vp3*/" ) ); //$NON-NLS-1$
+	    assertEquals( "switch", 	results[0].getDisplayString()); //$NON-NLS-1$
+	    assertEquals( "switch - switch case statement", 	results[1].getDisplayString()); //$NON-NLS-1$
+	    
 	}	
 }
Index: test.xml
===================================================================
RCS file: /home/tools/org.eclipse.cdt-releng/org.eclipse.cdt.testing/test.xml,v
retrieving revision 1.3
diff -u -r1.3 test.xml
--- test.xml	2 Feb 2005 20:08:27 -0000	1.3
+++ test.xml	3 Feb 2005 18:56:41 -0000
@@ -2,6 +2,9 @@
 
 	<property name="library-file" value="${eclipse-home}/plugins/org.eclipse.test/library.xml"/>
 	<property name="cdt-core-loc" value="${eclipse-home}/cdt_core_folder"/>
+	<property name="cdt-ui-loc" value="${eclipse-home}/cdt_ui_folder"/>
+	<property name="cdt-debug-loc" value="${eclipse-home}/cdt_debug_folder"/>
+	<property name="cdt-managedbuilder-loc" value="${eclipse-home}/cdt_managedbuilder_folder"/>
 
 	<target name="init">
 		<tstamp/>
@@ -24,7 +27,31 @@
 			<property name="classname" value="org.eclipse.cdt.core.suite.AutomatedIntegrationSuite"/>
 		</ant>
 	</target>
+	<target name="cdt-ui" depends="init">
+		<ant target="ui-test" antfile="${library-file}" dir="${eclipse-home}">
+			<property name="data-dir" value="${cdt-ui-loc}"/>
+			<property name="plugin-name" value="org.eclipse.cdt.ui.tests"/>
+			<property name="classname" value="org.eclipse.cdt.ui.tests.AutomatedSuite"/>
+			
+		</ant>
+	</target>
+	<target name="cdt-debug" depends="init">
+		<ant target="ui-test" antfile="${library-file}" dir="${eclipse-home}">
+			<property name="data-dir" value="${cdt-debug-loc}"/>
+			<property name="plugin-name" value="org.eclipse.cdt.debug.ui.tests"/>
+			<property name="classname" value="org.eclipse.cdt.debug.core.tests.AllDebugTests"/>
+			
+		</ant>
+	</target>	
+	<target name="cdt-managedbuilder" depends="init">
+		<ant target="ui-test" antfile="${library-file}" dir="${eclipse-home}">
+			<property name="data-dir" value="${cdt-ui-loc}"/>
+			<property name="plugin-name" value="org.eclipse.managedbuilder.core.tests"/>
+			<property name="classname" value="org.eclipse.cdt.managedbuilder.tests.suite.AllManagedBuildTests
 
-	<target name="suite" depends="cdt-core"/>
-
+"/>
+			
+		</ant>
+	</target>
+	<target name="suite" depends="cdt-core,cdt-ui,cdt-debug"/>
 </project>

Back to the top