10

I have several launch configurations for the code I work on.

One configuration (#1) means "run the unit tests for the file in the frontmost editor (i.e. selected resource)". I would really like to be able to always make this be bound to a key.

Another configuration (#2) means "run the server that I am working on (in the frontmost project) so I can test it interactively".

Yet another (#3) means "run some automated acceptance tests against the server".

I always want to have #1 close at hand, easy to run from a single keystroke. Plus, I want to be able to run #2, watch it start up in a console, and when it's ready (since it's not entirely trivial to automate this) hit the key for #3.

This is possibly similar to the question for binding a key to a specific build configuration, but the answers there look very specific to builds, and as I'm using PyDev, I don't have a "build" step at all.

Also, given that I'm using PyDev, an answer in the form of a pyedit_* script would be appreciated just as much as a "native" answer for eclipse.

Community
  • 1
  • 1
Glyph
  • 31,152
  • 11
  • 87
  • 129
  • You don't need run configuration for #1 as there is standard one for this `CTRL+F9`. See [Keybindings quick-reference](http://pydev.org/manual_adv_keybindings.html) – Piotr Dobrogost Jan 14 '12 at 14:55

3 Answers3

5

Maybe Eclipse Runner plugin could make it easier for someone to handle launch configurations. It doesn't allow to assign key binding to launch configurations currently but I opened a feature request Key bindings for launch configurations

Piotr Dobrogost
  • 41,292
  • 40
  • 236
  • 366
  • 2
    Sadly, this project doesn't seem to be actively maintained, so shortcuts may not be available in the foreseeable future. It still is a useful plugin though. – Björn Pollex Nov 28 '12 at 14:34
1

Not to a specific launch Configuration , but you can bind a key to run Last run Configuration ,

Windows->preferences->General->Keys->Run last launched external Tool
Raaghu
  • 1,956
  • 1
  • 19
  • 17
0

You can do the following (for #2 and #3), after having those run configurations created:

Go to Run > Run Configuration > Select the run configuration you want > Common > Display in Favorites Menu > Check Run/Debug. This will make it always appear as the first on the menu.

This will make it appear in the menu in Run > History and Run > Debug History, then, you can access it through Alt+R, T, 1 (and 2 and 3) to run your configurations or Alt+R, H, 1 (and 2 and 3) to debug.

And for #1, as Piotr Dobrogost said, you can just use Ctrl+F9 in the current editor and choose which test-cases you want to run (if you select a unit-test -- usually with Ctrl+Shift+Up or Ctrl+Shift+Down -- it'll be pre-selected for you) -- then, if you configured to always relaunch the last launch, as explained in http://www.pydev.org/manual_101_run.html, you can use Ctrl+F11 to relaunch the last launch.

Fabio Zadrozny
  • 24,814
  • 4
  • 66
  • 78