Home » U++ TheIDE » U++ TheIDE: Other Features Wishlist and/or Bugs » Can U++ TheIDE be used with cxxtest ? (Looking for a way to use cxxtest unit test framework for TDD.)
Can U++ TheIDE be used with cxxtest ? [message #54593] |
Wed, 19 August 2020 07:15  |
jlfranks
Messages: 57 Registered: May 2007 Location: Houston, TX, USA
|
Member |
|
|
We are looking at how to use TDD with U++ TheIDE.
We have several projects that are either console or GUI based.
We would like to use cxxtest framework for this effort.
Is there a way to use U++ TheIDE and cxxtest framework for unit testing?
-- Jeff Franks
|
|
|
Re: Can U++ TheIDE be used with cxxtest ? [message #54597 is a reply to message #54593] |
Wed, 19 August 2020 09:50   |
mr_ped
Messages: 826 Registered: November 2005 Location: Czech Republic - Praha
|
Experienced Contributor |
|
|
Can't answer your question directly, but for my CLI/U++ projects I'm using for years the "UnitTest++", there's even some original old version in the Bazaar here on web.
But I don't see any obvious reason why U++ should pose any problem to regular C++ UT framework, at least in the trivial land of CLI. I never got the grasp of GUI unit testing, in my projects I always just test the "model" classes without any GUI widgets, and keep the presenter/view part outside of the UT scope - something I wish I would learn to manage better, but so far never had enough "time" for that.
edit: about TheIDE vs UnitTest++: my app can be compiled with UT flag (one of the configurations), at that moment it will in the main launch the test runner instead of going into the app itself, and output the results, so I have them visible in TheIDE console, or I can redirected them to log files when running it from command line. No neat green/red semaphore, but I don't miss that, for me "OK/FAIL" text in console is enough.
[Updated on: Wed, 19 August 2020 09:52] Report message to a moderator
|
|
|
Re: Can U++ TheIDE be used with cxxtest ? [message #54598 is a reply to message #54593] |
Wed, 19 August 2020 09:54   |
 |
mirek
Messages: 14257 Registered: November 2005
|
Ultimate Member |
|
|
jlfranks wrote on Wed, 19 August 2020 07:15We are looking at how to use TDD with U++ TheIDE.
We have several projects that are either console or GUI based.
We would like to use cxxtest framework for this effort.
Is there a way to use U++ TheIDE and cxxtest framework for unit testing?
-- Jeff Franks
Well, it is still C++, so it should work, right?
Alternatively, you could setup something similar to U++ testing infrastructure. Instead of putting tests into some headers as classes, you can put individual tests / test groups into packages (we have now about 157 of these, see https://github.com/ultimatepp/ultimatepp/tree/master/autotes t). Testing then compiles and runs one after another. I like to a bit more as each test is individual process, so if it crashes or freezes, other tests are not affected....
Mirek
|
|
|
Re: Can U++ TheIDE be used with cxxtest ? [message #54610 is a reply to message #54593] |
Wed, 19 August 2020 20:40   |
 |
Klugier
Messages: 1099 Registered: September 2012 Location: Poland, Kraków
|
Senior Contributor |
|
|
Hello Jeff,
Personally I would suggest using Google Test + Google Mocks. Sometime ago I created port for upp and it is available through bazzar. It is still active and supported by Google. On 3rd of October they release version 1.10.x. It posses around 16.5K stars on GitHub.
If you want to use full TDD with good code coverage and stable environment mocks are needed. For example you will be able to simulate network payload or hardware behavior easily.
To use that technology in Upp world I highly suggest backend/frontend separation and test back-end in separate package.
Mirek, you could consider using GTest in auto-test. I think your tests will benefit from that technology especially when using concepts such as test suites and you could still use small GTest app per package instead everything in one bag.
Examples below:
- Testing
- Mocking
Wikipedia:
- Mock_object
- Test-Driven Development (TDD) Shines with Mocking
Sincerely,
Klugier
U++ - one framework to rule them all.
[Updated on: Wed, 19 August 2020 20:43] Report message to a moderator
|
|
|
Resolved with Google Test -- Re: Can U++ TheIDE be used with cxxtest ? [message #54615 is a reply to message #54610] |
Thu, 20 August 2020 21:44  |
jlfranks
Messages: 57 Registered: May 2007 Location: Houston, TX, USA
|
Member |
|
|
That was an excellent suggestion!!
It was so easy to do because the gtest plugin was already available.
I'm now well along with a number of unit tests.
This is working out very well.
The tests involve "back-end" code as you suggested.
I'll probably follow-on with Google mock when I need it.
Thanks again.
-- Jeff Franks
|
|
|
Goto Forum:
Current Time: Sat May 10 09:13:37 CEST 2025
Total time taken to generate the page: 0.01940 seconds
|