rpms/eclipse-cdt/devel eclipse-cdt-cppunit-default-location.patch, NONE, 1.1 eclipse-cdt-cppunit-feature.patch, NONE, 1.1 eclipse-cdt-cppunit-ui.patch, NONE, 1.1 .cvsignore, 1.21, 1.22 eclipse-cdt.spec, 1.68, 1.69 sources, 1.24, 1.25

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Thu Nov 16 20:03:29 UTC 2006


Author: jjohnstn

Update of /cvs/dist/rpms/eclipse-cdt/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv14038

Modified Files:
	.cvsignore eclipse-cdt.spec sources 
Added Files:
	eclipse-cdt-cppunit-default-location.patch 
	eclipse-cdt-cppunit-feature.patch eclipse-cdt-cppunit-ui.patch 
Log Message:

* Wed Nov 15 2006 Jeff Johnstont <jjohnstn at redhat.com> 3.1.1-5
- Add cppunit support.




eclipse-cdt-cppunit-default-location.patch:
 CppUnitLocationGroup.java |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

--- NEW FILE eclipse-cdt-cppunit-default-location.patch ---
--- org.eclipse.cdt.cppunit/src/org/eclipse/cdt/internal/cppunit/wizards/CppUnitLocationGroup.java.fix	2006-11-16 14:09:58.000000000 -0500
+++ org.eclipse.cdt.cppunit/src/org/eclipse/cdt/internal/cppunit/wizards/CppUnitLocationGroup.java	2006-11-16 14:10:18.000000000 -0500
@@ -74,8 +74,8 @@ public class CppUnitLocationGroup
 		if(!(Platform.getOS().equals(Platform.OS_WIN32))
 			&&!(Platform.getOS().equals(Platform.OS_UNKNOWN)))
 		{
-			defaultInc="/usr/local/include/cppunit/TestCase.h";
-			defaultLib="/usr/local/lib/libcppunit.a";
+			defaultInc="/usr/include/cppunit/TestCase.h";
+			defaultLib="/usr/lib/libcppunit.a";
 		}
 		if(initIncString==null)
 		{

eclipse-cdt-cppunit-feature.patch:
 feature.xml |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

--- NEW FILE eclipse-cdt-cppunit-feature.patch ---
--- org.eclipse.cdt.cppunit-feature/feature.xml.fix	2006-11-15 14:31:53.000000000 -0500
+++ org.eclipse.cdt.cppunit-feature/feature.xml	2006-11-15 14:36:04.000000000 -0500
@@ -2,7 +2,7 @@
 <feature
       id="org.eclipse.cdt.cppunit"
       label="%featureName"
-      version="1.1.0"
+      version="2.0.0"
       provider-name="%providerName"
       image="eclipse_update_120.jpg">
 
@@ -34,6 +34,6 @@
          id="org.eclipse.cdt.cppunit"
          download-size="0"
          install-size="0"
-         version="1.1"/>
+         version="0.0.0"/>
 
 </feature>

eclipse-cdt-cppunit-ui.patch:
 plugin.xml                                                      |    2 
 src/org/eclipse/cdt/internal/cppunit/ui/FailureRunView.java     |    4 
 src/org/eclipse/cdt/internal/cppunit/ui/FailureTraceView.java   |    7 +
 src/org/eclipse/cdt/internal/cppunit/ui/HierarchyRunView.java   |   55 +++++++++-
 src/org/eclipse/cdt/internal/cppunit/ui/TestRunnerViewPart.java |   11 ++
 5 files changed, 69 insertions(+), 10 deletions(-)

--- NEW FILE eclipse-cdt-cppunit-ui.patch ---
--- ./org.eclipse.cdt.cppunit/src/org/eclipse/cdt/internal/cppunit/ui/HierarchyRunView.java.fix	2006-11-07 15:40:16.000000000 -0500
+++ ./org.eclipse.cdt.cppunit/src/org/eclipse/cdt/internal/cppunit/ui/HierarchyRunView.java	2006-11-07 15:41:49.000000000 -0500
@@ -140,7 +140,7 @@ class HierarchyRunView implements ITestR
 		TreeItem treeItem= fTree.getSelection()[0];
 		if(treeItem == null) 
 			return ""; //$NON-NLS-1$
-		return treeItem.getText();
+		return extractMethodName(treeItem.getText());
 	}
 
 	private TestRunInfo getTestInfo() {
@@ -186,16 +186,61 @@ class HierarchyRunView implements ITestR
 		return res;
 	}
 
+	static public String extractMethodName(String testNameString) {
+		if (testNameString == null)
+			return null;
+		
+		// Parse past namespace identifiers and find the "::" method specifier
+		// if one is present
+		
+		int start = 0;
+		int index = testNameString.lastIndexOf("::");
+
+		if (index > 0)
+			start = index + 2;
+
+		// Alternatively, look for "." method specifier if one exists.
+		index = testNameString.indexOf('.', start);
+		if (index > 0)
+			start = index + 1;
+			
+		return testNameString.substring(start);
+	}
+	
 	static public String extractClassName(String testNameString) {
 		if (testNameString == null) 
 			return null;
+		
 		// Filter the first integer as a header ??
 		testNameString=filterFirstNumbers(testNameString);
 		
-		int index= testNameString.indexOf('.');
-		if (index < 0) 
-			return testNameString;
-		return testNameString.substring(0,index);
+		// Parse past namespace identifiers and find the "::" method specifier
+		// if one is present.
+		int start = 0;
+		int index = 0;
+		int end = testNameString.indexOf("::");
+
+		index = end + 2;
+		while (index > 1) {
+			int tmp = testNameString.indexOf("::", index);
+			if (tmp > 0)
+				start = index;
+			else
+				end = index - 2;
+			index = tmp + 2;
+		}
+			
+		// Alternatively, look for "." method specifier if one exists.
+		index = testNameString.indexOf('.', start);
+		if (index > 0) {
+			if (end > 0 && index > end + 2)
+				start = end + 2;
+			end = index;
+		}
+		
+		if (end < 0) 
+			return testNameString.substring(start);
+		return testNameString.substring(start, end);
 	}		
 
 	public String getName() {
--- ./org.eclipse.cdt.cppunit/src/org/eclipse/cdt/internal/cppunit/ui/FailureRunView.java.fix	2006-11-07 15:40:26.000000000 -0500
+++ ./org.eclipse.cdt.cppunit/src/org/eclipse/cdt/internal/cppunit/ui/FailureRunView.java	2006-11-07 15:41:49.000000000 -0500
@@ -112,9 +112,7 @@ class FailureRunView implements ITestRun
 	
 	private String getMethodName() {
 		String methodName= getSelectedText();
-		int index=methodName.indexOf('.');
-		if(index<0) return null;
-		methodName=methodName.substring(index+1,methodName.length());
+		methodName=HierarchyRunView.extractMethodName(methodName);
 		return methodName;
 	}
 
--- ./org.eclipse.cdt.cppunit/src/org/eclipse/cdt/internal/cppunit/ui/TestRunnerViewPart.java.fix	2006-11-07 15:40:50.000000000 -0500
+++ ./org.eclipse.cdt.cppunit/src/org/eclipse/cdt/internal/cppunit/ui/TestRunnerViewPart.java	2006-11-07 15:41:49.000000000 -0500
@@ -26,6 +26,7 @@ import org.eclipse.cdt.core.model.ICElem
 import org.eclipse.cdt.core.model.ICProject;
 import org.eclipse.cdt.core.model.IElementChangedListener;
 import org.eclipse.cdt.internal.cppunit.runner.ITestRunListener;
+import org.eclipse.core.runtime.IPath;
 import org.eclipse.debug.core.ILaunch;
 import org.eclipse.jface.action.IStatusLineManager;
 import org.eclipse.jface.action.IToolBarManager;
@@ -119,6 +120,10 @@ public class TestRunnerViewPart extends 
 	 */
 	private ICProject fTestProject;
 	/**
+	 * The path for the test.
+	 */
+	private IPath fTestPath;
+	/**
 	 * The launcher that has started the test
 	 */
 	private String fLaunchMode;
@@ -451,6 +456,8 @@ public class TestRunnerViewPart extends 
 	public void startTestRunListening(ICElement program, int port, ILaunch launch) {
 		fTestProject= program.getCProject();
 		fLaunchMode= launch.getLaunchMode();
+		fTestPath= program.getPath();
+		
 		aboutToLaunch();
 		
 		if (fTestRunnerClient != null) {
@@ -815,6 +822,10 @@ public class TestRunnerViewPart extends 
 		return fTestProject;
 	}
 
+	public IPath getTestPath() {
+		return fTestPath;
+	}
+	
 	protected static Image createImage(String path) {
 		try {
 			ImageDescriptor id= ImageDescriptor.createFromURL(CppUnitPlugin.makeIconFileURL(path));
--- ./org.eclipse.cdt.cppunit/src/org/eclipse/cdt/internal/cppunit/ui/FailureTraceView.java.fix	2006-11-07 15:45:29.000000000 -0500
+++ ./org.eclipse.cdt.cppunit/src/org/eclipse/cdt/internal/cppunit/ui/FailureTraceView.java	2006-11-07 15:41:49.000000000 -0500
@@ -16,6 +16,7 @@ import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.StringReader;
 
+import org.eclipse.core.runtime.IPath;
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.IMenuListener;
 import org.eclipse.jface.action.IMenuManager;
@@ -103,6 +104,12 @@ class FailureTraceView implements IMenuL
 			String lineNumber=traceLine.substring(traceLine.indexOf(':')+1,traceLine.length());
 			int line=Integer.valueOf(lineNumber).intValue();
 			if(fileName.equals("Unknown")) return null;
+			// We have a relative file name from the test directory.  We want
+			// a filename relative to the project directory.
+			if (fileName.startsWith(".")) {
+				IPath testDirPath = fTestRunner.getTestPath().removeFirstSegments(1).removeLastSegments(1);
+				fileName = testDirPath.append(fileName).toString();
+			};
 			return new OpenEditorAtLineAction(fTestRunner, fileName, line);
 		}
 		return null;
--- ./org.eclipse.cdt.cppunit/plugin.xml.fix	2006-11-07 15:39:13.000000000 -0500
+++ ./org.eclipse.cdt.cppunit/plugin.xml	2006-11-07 15:41:49.000000000 -0500
@@ -15,7 +15,6 @@
    <requires>
       <import plugin="org.eclipse.ui.ide"/>
       <import plugin="org.eclipse.ui"/>
-      <import plugin="org.eclipse.ui.workbench"/>
       <import plugin="org.eclipse.core.resources"/>
       <import plugin="org.eclipse.debug.core"/>
       <import plugin="org.eclipse.debug.ui"/>
@@ -28,7 +27,6 @@
       <import plugin="org.eclipse.ui.workbench.texteditor"/>
       <import plugin="org.eclipse.jface.text"/>
       <import plugin="org.eclipse.cdt.managedbuilder.core"/>
-      <import plugin="org.eclipse.cdt.make.ui"/>
    </requires>
 
 


Index: .cvsignore
===================================================================
RCS file: /cvs/dist/rpms/eclipse-cdt/devel/.cvsignore,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- .cvsignore	20 Oct 2006 02:37:41 -0000	1.21
+++ .cvsignore	16 Nov 2006 20:03:27 -0000	1.22
@@ -1,2 +1,3 @@
 eclipse-cdt-autotools-0.0.5.tar.gz
 eclipse-cdt-fetched-src-3.1.1.tar.bz2
+eclipse-cdt-cppunit-20061102.tar.gz


Index: eclipse-cdt.spec
===================================================================
RCS file: /cvs/dist/rpms/eclipse-cdt/devel/eclipse-cdt.spec,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -r1.68 -r1.69
--- eclipse-cdt.spec	6 Nov 2006 20:23:52 -0000	1.68
+++ eclipse-cdt.spec	16 Nov 2006 20:03:27 -0000	1.69
@@ -21,7 +21,7 @@
 Summary: 	%{pkg_summary}
 Name: 		%{eclipse_name}-cdt
 Version: 	%{majmin}.%{micro}
-Release:	4%{dist}
+Release:	5%{dist}
 License:	Eclipse Public License - v 1.0 (EPL) <http://www.eclipse.org/legal/epl-v10.html>
 Group: 		Text Editors/Integrated Development Environments (IDE)
 URL:		http://www.eclipse.org/cdt
@@ -44,12 +44,16 @@
 # cd .. && tar jcf eclipse-cdt-fetched-src-3.1.1.tar.bz2 org.eclipse.cdt.releng
 Source0: %{name}-fetched-src-%{version}.tar.bz2
 Source1: %{name}-autotools-0.0.5.tar.gz
+Source2: %{name}-cppunit-20061102.tar.gz
 
 Patch1: %{name}-no-cvs2-patch
 Patch4: %{name}-no-tests.patch
 Patch5: %{name}-subconsole.patch
 Patch6: %{name}-scannerinfoplus.patch
 Patch7: %{name}-definedsymbolhover.patch
+Patch8: %{name}-cppunit-ui.patch
+Patch9: %{name}-cppunit-feature.patch
+Patch10: %{name}-cppunit-default-location.patch
 
 BuildRequires: eclipse-pde
 %if %{gcj_support}
@@ -112,6 +116,16 @@
 tar -xzf %{SOURCE1}
 popd
 
+# Cppunit stuff
+
+mkdir cppunit
+pushd cppunit
+tar -xzf %{SOURCE2}
+%patch8 -p0
+%patch9 -p0
+%patch10 -p0
+popd
+
 # Upstream CVS includes random .so files.  Let's remove them now.
 # We actually remove the entire "os" directory since otherwise
 # we wind up with some empty directories that we don't want.
@@ -122,7 +136,7 @@
 export PATH=%{java_bin}:/usr/bin:$PATH
 
 # See comments in the script to understand this.
-/bin/sh -x %{eclipse_lib_base}/buildscripts/copy-platform SDK %{eclipse_base}
+/bin/sh -x %{eclipse_base}/buildscripts/copy-platform SDK %{eclipse_base}
 SDK=$(cd SDK >/dev/null && pwd)
 
 # Eclipse may try to write to the home directory.
@@ -163,10 +177,25 @@
      -DsourceDirectory=$(pwd)                          \
      -DbaseLocation=$SDK                               \
      -Dbuilder=%{eclipse_base}/plugins/org.eclipse.pde.build/templates/package-build  \
-     -f %{eclipse_base}/plugins/org.eclipse.pde.build/scripts/build.xml
+     -f %{eclipse_base}/plugins/org.eclipse.pde.build/scripts/build.xml 
 
 popd
 
+# Cppunit build
+pushd cppunit
+java -cp $SDK/startup.jar \
+     -Dosgi.sharedConfiguration.area=%{_libdir}/eclipse/configuration                        \
+     -Duser.home=$homedir                        \
+     org.eclipse.core.launcher.Main             \
+     -application org.eclipse.ant.core.antRunner       \
+     -Dtype=feature                                    \
+     -Did=org.eclipse.cdt.cppunit	               \
+     -DsourceDirectory=$(pwd)                          \
+     -DbaseLocation=$SDK                               \
+     -Dbuilder=%{eclipse_base}/plugins/org.eclipse.pde.build/templates/package-build  \
+     -f %{eclipse_base}/plugins/org.eclipse.pde.build/scripts/build.xml
+
+popd
 %install
 rm -rf ${RPM_BUILD_ROOT}
 
@@ -196,6 +225,11 @@
 unzip -qq -d $RPM_BUILD_ROOT%{eclipse_base}/.. build/rpmBuild/com.redhat.eclipse.cdt.autotools.feature.zip
 popd
 
+# Cppunit install
+pushd cppunit
+unzip -qq -d $RPM_BUILD_ROOT%{eclipse_base}/.. build/rpmBuild/org.eclipse.cdt.cppunit.zip
+popd
+
 %if %{gcj_support}
 aot-compile-rpm
 %endif
@@ -215,8 +249,10 @@
 %defattr(-,root,root)
 %{eclipse_base}/features/org.eclipse.cdt_*
 %{eclipse_base}/features/com.redhat.eclipse.cdt*
+%{eclipse_base}/features/org.eclipse.cdt.cppunit_*
 %{eclipse_base}/plugins/org.eclipse.cdt_*
 %{eclipse_base}/plugins/org.eclipse.cdt.core*
+%{eclipse_base}/plugins/org.eclipse.cdt.cppunit*
 %{eclipse_base}/plugins/org.eclipse.cdt.debug*
 %{eclipse_base}/plugins/org.eclipse.cdt.doc*
 %{eclipse_base}/plugins/org.eclipse.cdt.launch*
@@ -241,6 +277,9 @@
 %endif
 
 %changelog
+* Wed Nov 15 2006 Jeff Johnstont <jjohnstn at redhat.com> 3.1.1-5
+- Add cppunit support.
+
 * Mon Nov 06 2006 Andrew Overholt <overholt at redhat.com> 3.1.1-4
 - Use the new location of copy-platform.
 


Index: sources
===================================================================
RCS file: /cvs/dist/rpms/eclipse-cdt/devel/sources,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- sources	16 Oct 2006 21:53:19 -0000	1.24
+++ sources	16 Nov 2006 20:03:27 -0000	1.25
@@ -1,2 +1,3 @@
 0c32e0a130f102727ba1c2a0645c483d  eclipse-cdt-fetched-src-3.1.1.tar.bz2
 4d863b71fda6ba9a477369ae36f93339  eclipse-cdt-autotools-0.0.5.tar.gz
+d66010506732482f48bd89775ebf1884  eclipse-cdt-cppunit-20061102.tar.gz




More information about the fedora-cvs-commits mailing list