[Solved] Can we have a Hotkey "Run Project as Unit Test"?

Discussion about CodeLite development process and patches
Modem Man
CodeLite Enthusiast
Posts: 25
Joined: Tue Sep 11, 2012 11:50 am
Genuine User: Yes
IDE Question: C++
Contact:

[Solved] Can we have a Hotkey "Run Project as Unit Test"?

Post by Modem Man » Sat Oct 24, 2015 12:54 am

Hi Eran,

I would like to have the UnitTest++ Plugin available in "Keyboard Shortcuts", so I can assign a key to it. Do you think, this is easily done? Can I do it by myself? Or, please, can you do it, if code changes are required?

@all:
The UnitTest++ integration is a very, very useful thing inside CodeLite, especially together with Jeff Langr's book about test driven development. The only things I'm missing are hotkeys for "just run tests" and "make Test Project, then run tests". This may be a special topic from my likings - I don't use a mouse while writing code...

Eran, I just donated 25 bucks via paypal to help you finding a positive decision :twisted:
No, I'm joking! I donated because you deserve it.

Keep up the good work!
Maik, aka "Modem Man"
Last edited by Modem Man on Tue Oct 27, 2015 10:58 pm, edited 1 time in total.

User avatar
eranif
CodeLite Plugin
Posts: 6110
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Can we have a Hotkey for "Run Project as Unit Test"?

Post by eranif » Mon Oct 26, 2015 8:51 pm

This is now committed to git master
Eran
Make sure you have read the HOW TO POST thread

Modem Man
CodeLite Enthusiast
Posts: 25
Joined: Tue Sep 11, 2012 11:50 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Can we have a Hotkey for "Run Project as Unit Test"?

Post by Modem Man » Mon Oct 26, 2015 10:43 pm

eranif wrote:This is now committed to git master
Eran

You made my day!!
:D
Hmm (talking to myself) ... shall I think about to translate my own nightly build of CodeLite? ... could be a nice training to get familiar with Git again ...

User avatar
eranif
CodeLite Plugin
Posts: 6110
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Can we have a Hotkey for "Run Project as Unit Test"?

Post by eranif » Tue Oct 27, 2015 11:46 am

To apply the fix on your local CodeLite installation:

1. Close CodeLite

2. Open the file:

Code: Select all

/usr/share/codelite/config/accelerators.conf.default
or:

Code: Select all

C:\Program Files\CodeLite\config\accelerators.conf.default
and append the following 4 lines to the bottom:

Code: Select all

unittestpp_new_simple_test|Plugins::UnitTest++|Create new test...|
unittestpp_new_class_test|Plugins::UnitTest++|Create tests for class...|
mark_project_as_ut|Plugins::UnitTest++|Mark this project as UnitTest++ project|
run_unit_tests|Plugins::UnitTest++|Run Project as UnitTest++ and report|
3. Start CodeLite
4. Go to: Settings->Keyboard Shortcuts and click on the "Defaults" button (this will tell CodeLite to reload the defaults keyboard shortcuts from the file you just edited)

You should now have 4 new entries under: keyboard shortcuts->plugins->UnitTest++

Eran
Make sure you have read the HOW TO POST thread

Modem Man
CodeLite Enthusiast
Posts: 25
Joined: Tue Sep 11, 2012 11:50 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Can we have a Hotkey for "Run Project as Unit Test"?

Post by Modem Man » Tue Oct 27, 2015 10:45 pm

Hi Eran,
eranif wrote: 4. Go to: Settings->Keyboard Shortcuts and click on the "Defaults" button
Eran
I was first a bit angry to loose my beloved keyboard settings, but then I found out, the default keyboard settings already are my favourite ones ;)
In my setup, I assigned Ctrl+Alt F7, so I can quickly queue make (F7) and test. Nice!

Yes it works! Yippee!! :D

Thank you very, very much!

Post Reply