Commits

sk  committed 1660ace

Made it possible to run tests with ccl.

  • Participants
  • Parent commits 9c14b9f

Comments (0)

Files changed (1)

File src/org/lispdev/swank/SwankInterfaceTest.java

     super(null,null,null);
   }
 
-  private static SwankInterface startSwank()
+  private static SwankInterface startSBCLSwank()
   {
     SwankInterface res = null;
     try
     return res;
   }
 
+  private static SwankInterface startCCLSwank()
+  {
+    SwankInterface res = null;
+    try
+    {
+      ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
+      ILaunchConfigurationType cfgType =
+        manager.getLaunchConfigurationType(BaseLocalLispLaunchDelegate.ID);
+      ILaunchConfiguration cfg = cfgType.newInstance(null, "swank");
+      ILaunchConfigurationWorkingCopy wc = cfg.getWorkingCopy();
+      wc.setAttribute(BaseLocalLispLaunchDelegate.ATTR_EXE,
+          "D:\\projects\\lisp\\ccl\\wx86cl.exe");
+      wc.setAttribute(BaseLocalLispLaunchDelegate.ATTR_SWANK,
+          "D:\\projects\\lisp\\slime-2010-07-16\\");
+      wc.setAttribute(BaseLocalLispLaunchDelegate.ATTR_EXT,
+          "D:\\projects\\lispdev\\ws\\org.lispdev.swank\\");
+      wc.setAttribute(BaseLocalLispLaunchDelegate.ATTR_PORT, 4005);
+      wc.setAttribute(BaseLocalLispLaunchDelegate.ATTR_START_REPL_THREAD, true);
+      cfg = wc.doSave();
+      ILaunch launch = cfg.launch(ILaunchManager.PROFILE_MODE, null, false);
+      cfg.delete();
+      if( launch.getProcesses() != null && launch.getProcesses().length > 0
+          && launch.getProcesses()[0] instanceof LispProcess )
+      {
+        LispProcess lp = (LispProcess)launch.getProcesses()[0];
+        res = (SwankInterface)lp.getSwank();
+      }
+    }
+    catch ( CoreException e )
+    {
+      e.printStackTrace();
+    }
+    return res;
+  }
+
   // class for synchronization
   private class myBoolean
   {
   @Before
   public void init()
   {
-    si = startSwank();
+    si = startSBCLSwank();
     si.connect();
   }