1 11 package org.eclipse.test; 12 13 import java.io.IOException ; 14 import org.eclipse.core.runtime.IPlatformRunnable; 15 import org.eclipse.core.runtime.Platform; 16 17 20 public class CoreTestApplication implements IPlatformRunnable { 21 22 private static boolean deltas= false; 23 24 29 public Object run(Object arguments) throws Exception { 30 String [] args= Platform.getCommandLineArgs(); return new Integer (runTests(args)); 32 } 33 34 protected int runTests(String [] args) throws IOException { 35 return EclipseTestRunner.run(args); 36 } 37 38 public static boolean deltasEnabled() { 39 return deltas; 40 } 41 42 protected String [] processCommandLine(String [] args) { 43 int[] configArgs = new int[100]; 44 configArgs[0] = -1; int configArgIndex = 0; 46 for (int i = 0; i < args.length; i++) { 47 boolean found = false; 48 if (args[i].equalsIgnoreCase("-deltas")) { 51 found = true; 52 deltas = true; 53 } 54 if (found) { 55 configArgs[configArgIndex++] = i; 56 continue; 57 } 58 59 if (i == args.length - 1 || args[i + 1].startsWith("-")) { 61 continue; 62 } 63 String arg = args[++i]; 64 65 if (found) { 67 configArgs[configArgIndex++] = i - 1; 68 configArgs[configArgIndex++] = i; 69 } 70 } 71 72 if (configArgIndex == 0) 74 return args; 75 String [] passThruArgs = new String [args.length - configArgIndex]; 76 configArgIndex = 0; 77 int j = 0; 78 for (int i = 0; i < args.length; i++) { 79 if (i == configArgs[configArgIndex]) 80 configArgIndex++; 81 else 82 passThruArgs[j++] = args[i]; 83 } 84 return passThruArgs; 85 } 86 } 87 | Popular Tags |