This is the mail archive of the mauve-patches@sourceware.org mailing list for the Mauve project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

new -vmarg option to Harness


As suggested by Mark on #classpath, I added an easy way to pass
arguments to the VM running the RunnerProcess.

2006-06-21  Anthony Balkissoon  <abalkiss@redhat.com>

	* README: Added info about new -vmarg option for the Harness.
	* Harness.java: 
	(vmArgs): New field.
	(main): Handle new -vmarg option.
	(initProcess): Concatenate the vmArgs to the vmCommand before running
	exec.

--Tony
Index: README
===================================================================
RCS file: /cvs/mauve/mauve/README,v
retrieving revision 1.25
diff -u -r1.25 README
--- README	14 Jun 2006 19:28:27 -0000	1.25
+++ README	21 Jun 2006 20:15:54 -0000
@@ -96,7 +96,7 @@
 section provides instructions on how to perform the following tasks:
 
   0.  Running all the tests.
-  1.  Specify the VM on which to run the tests
+  1.  Specify the VM on which to run the tests and any VM arguments
   2.  Select a subset of the tests to run
   3.  Use an input file to specify the tests to run
   4.  Change the timeout interval
@@ -113,7 +113,7 @@
   You can also run all the tests by typing 'HARNESSVM Harness gnu.testlet'.
   
 
-1.  Specifying the VM on which to run the tests
+1.  Specifying the VM on which to run the tests and any VM arguments
 
   The VM on which to run the tests can be specified by configure as described
   in the first section, CONFIGURING AND BUILDING THE TESTSUITE.  It can also be
@@ -136,6 +136,15 @@
   again that HARNESSVM is just the VM used to run the harness, and not the tests.
   This is done for performance considerations to allow the Harness to be natively
   compiled and ran while testing a variety of VMs.
+  
+  To specify arguments for the VM, use:
+  
+  -vmarg ARGUMENT
+  
+  For example, the following command will run the JTable tests on JamVM with
+  the -Xnocompact argument:
+  
+  HARNESSVM Harness javax.swing.JTable -vm jamvm -vmarg -Xnocompact
 
 
 2.  Selecting a subset of the tests to run
Index: Harness.java
===================================================================
RCS file: /cvs/mauve/mauve/Harness.java,v
retrieving revision 1.11
diff -u -r1.11 Harness.java
--- Harness.java	19 Jun 2006 18:25:32 -0000	1.11
+++ Harness.java	21 Jun 2006 20:15:54 -0000
@@ -88,6 +88,9 @@
   // The command to invoke for the VM on which we will run the tests.
   private static String vmCommand = null;
   
+  // Arguments to be passed to the VM
+  private static String vmArgs = "";
+  
   // Whether or not we should recurse into directories when a folder is
   // specified to be tested
   private static boolean recursion = true;
@@ -269,6 +272,16 @@
                     "after '-bootclasspath'.  Exit");
             classpathInstallDir = args[i];
           }
+        else if (args[i].equalsIgnoreCase("-vmarg"))
+          {
+            // User is specifying arguments to be passed to the VM of the
+            // RunnerProcess.
+            if (++i >= args.length)
+              throw new RuntimeException("No argument after -vmarg.  Exit");
+            {
+              vmArgs += " " + args[i];
+            }            
+          }
         else if (args[i].equalsIgnoreCase("-ecj-jar"))
           {
             // User is specifying the location of the eclipse-ecj.jar file
@@ -630,7 +643,7 @@
     StringBuffer sb = new StringBuffer(" RunnerProcess");
     for (int i = 0; i < args.length; i++)      
       sb.append(" " + args[i]);      
-    sb.insert(0, vmCommand);
+    sb.insert(0, vmCommand + vmArgs);
     
     try
       {

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]