summaryrefslogtreecommitdiffstats
path: root/tests/debugger/Main.java
diff options
context:
space:
mode:
authorwisberg <wisberg>2002-12-16 18:51:06 +0000
committerwisberg <wisberg>2002-12-16 18:51:06 +0000
commit144143c2970a1e874d74cdbd0f8c622d4282a3c3 (patch)
treeb12383d3d9e76c7e1f25f7fbec83051ef17f81fb /tests/debugger/Main.java
parentfafae443719b26159ab2d7dac1c9b46b5e00b671 (diff)
downloadaspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.tar.gz
aspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.zip
initial version
Diffstat (limited to 'tests/debugger/Main.java')
-rw-r--r--tests/debugger/Main.java74
1 files changed, 74 insertions, 0 deletions
diff --git a/tests/debugger/Main.java b/tests/debugger/Main.java
new file mode 100644
index 000000000..fd3dadb37
--- /dev/null
+++ b/tests/debugger/Main.java
@@ -0,0 +1,74 @@
+
+//package debugger;
+
+/**
+ * Main.java
+ *
+ *
+ * Created: Wed Sep 06 15:54:41 2000
+ *
+ * @author <a href="mailto:palm@parc.xerox.com"Jeffrey Palm</a>
+ */
+
+public class Main {
+
+ public Main(Tester tester, String[] args) {
+ String classPath = getArg(args, "-classpath");
+ String root = getArg(args, "-root");
+ String verbose = getSwitch(args, "-verbose");
+ String dbg = getSwitch(args, "-debug");
+ boolean debug = !dbg.equals("");
+ Tester.setClassPath(classPath);
+ Tester.setRoot(root);
+ if (verbose.equals("true")) {
+ Tester.setVerbose(true);
+ }
+ if (dbg.equals("true")) {
+ Tester.setDebug(true);
+ }
+ if (!root.equals("")) {
+ Tester.setRoot(root);
+ }
+ tester.go(args);
+// new BreakpointTester(debug).go(args);
+// new ThreadTester(debug).go(args);
+// new ArgumentTester(debug).go(args);
+ }
+
+ static void fail(Object o) {
+ System.err.println("ERROR: " + o);
+ System.exit(1);
+ }
+
+ public static String getSwitch(String[] args, String arg) {
+ return getArg(args, arg, false);
+ }
+
+ public static String getArg(String[] args, String arg) {
+ return getArg(args, arg, true);
+ }
+
+ public static String getArg(String[] args, String arg, boolean needArg) {
+ String s = "";
+ for (int i = 0; i < args.length; i++) {
+ if (args[i].equals(arg)) {
+ try {
+ s = args[i+1];
+ break;
+ } catch (Exception e) {
+ if (needArg) {
+ e.printStackTrace();
+ fail("Need to set a value for switch " + arg);
+ }
+ }
+ if (needArg) {
+ return s;
+ } else {
+ return "true";
+ }
+ }
+ }
+ return "";
+
+ }
+}