This is the mail archive of the
mauve-discuss@sourceware.org
mailing list for the Mauve project.
RFC: make Harness more Eclipse friendly
- From: "Raif S. Naffah" <raif at swiftdsl dot com dot au>
- To: mauve-discuss at sources dot redhat dot com
- Date: Thu, 27 Jul 2006 12:14:57 +1000
- Subject: RFC: make Harness more Eclipse friendly
- Reply-to: raif at swiftdsl dot com dot au
hello all,
the attached patch adds a new Eclipse Launcher, and some minor amendments to
the Harness class to make it easy to select a test, or a folder, and run the
test harness.
OK to commit?
cheers;
rsn
Index: Mauve Harness.launch
===================================================================
RCS file: Mauve Harness.launch
diff -N Mauve Harness.launch
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ Mauve Harness.launch 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="Harness"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_INSTALL_TYPE_ID" value="org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-showpasses -verbose -debug -timeout 300000 ${resource_path}"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="4"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="mauve"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_INSTALL_NAME" value="classpath"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Djava.util.logging.config.file=${project_loc:mauve}/logging.properties"/>
+<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
+<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
+<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/classpath"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/mauve"/>
+</listAttribute>
+<mapAttribute key="org.eclipse.debug.core.environmentVariables">
+<mapEntry key="MAUVE_PROJECT_NAME" value="${project_name}"/>
+</mapAttribute>
+<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
+</launchConfiguration>
Index: Harness.java
===================================================================
RCS file: /cvs/mauve/mauve/Harness.java,v
retrieving revision 1.22
diff -u -r1.22 Harness.java
--- Harness.java 26 Jul 2006 20:22:18 -0000 1.22
+++ Harness.java 27 Jul 2006 02:09:59 -0000
@@ -151,7 +151,16 @@
// A convenience String for ensuring tests all have the same name format
private static final String gnuTestletHeader2 = gnuTestletHeader1
+ File.separatorChar;
-
+
+ // The usual name of the CVS project containing this resource surrounded
+ // with file-separator strings
+ private static final String MAUVE = File.separator
+ + System.getenv("MAUVE_PROJECT_NAME")
+ + File.separator;
+ // When a folder is selected from Eclipse this is what usually gets
+ // prepended to the folder name
+ private static final String MAUVE_GNU_TESTLET = MAUVE + gnuTestletHeader2;
+
/**
* The main method for the Harness. Parses through the compile line
* options and sets up the internals, sets up the compiler options,
@@ -526,12 +535,14 @@
val = val.replace('.', File.separatorChar);
if (val.endsWith("" + File.separatorChar))
val = val.substring(0, val.length() - 1);
- if (! val.startsWith(gnuTestletHeader1))
+ if (val.startsWith(MAUVE_GNU_TESTLET))
+ val = val.substring(MAUVE.length());
+ else if (! val.startsWith(gnuTestletHeader1))
val = gnuTestletHeader2 + val;
}
return val;
}
-
+
/**
* This method prints a help screen to the console and then exits.
*/