Reviewing and merging file-templates and unittest branches

Miha Čančula miha at noughmad.eu
Mon Sep 17 10:27:56 UTC 2012


Hello!

I worked on templates for code generation this summer as part of GSoC
(branch "file-templates"), as well as a framework for finding,
running**and reporting unit tests (branch "unittest"). Both branches
are in kdevelop
and kdevplatform repositories, and 'unittest' also has a component in
kdev-php. Also, they are not related in any way, so I would prefer merging
them separately.

I was busy with schoolwork since the end of GSoC, but now I finally
finished my school obligations for this year, so I have the rest of
September free to focus on KDevelop. I'm sure that some work will be needed
for merging both branches, so I'd like to do it soon while I still have
enough time.

I am asking for a review of both code and functionality for both projects.
Because they are rather large changes, I didn't create a review request on
ReviewBoard, but I will do so if needed. I'm providing a short summary of
changes so you know where to look:

1. Templates
 * kdevplatform:
   - in language/codegen, I have added utility classes for rendering
templates with Grantlee. These are mainly SourceFileTemplate,
TemplateRenderer, and CodeDescription. They are all documented. There are
also TemplatesModel and MultiLevelListView which are useful for navigating
through installed templates.
   - the class assistant in createclass.{h,cpp}, along with UI files and
licenses was moved to a plugin in plugins/filetemplates. I have
refactored/replaced much of the code there.
   - added an interface in language/interfaces for a CreateClassHelper,
with implements language-specific parts of code generation.
   - in templates, I created some Grantlee filters, as well as convenience
inclusion templates.
 * kdevelop:
   - remove C++ specific class generator in languages/cpp/cppcreateclass.h.
Replaced it with a CreateClassHelper implementation.
   - in file_templates, there is now a large number of templates for
classes, unit tests, and other things (like cmake modules). These will be
put on kde-files instead of the code repository, except perhaps the basic
ones for each language. I would still like some comments on this.

2. Unit tests
 * kdevplatform:
   - in interfaces, added new interfaces: ITestSuite (for a single test
suite) and ITestController
   - in shell, a TestController implementation
   - in plugins/testview, a plugin that shows all found tests and allows
the user to run them and see results
   - in plugins/patchreview, the option of running tests before submitting
a patch
 * kdevelop:
   - in cmakemanager, an implementation of ITestSuite for tests declared in
CMake files with add_test. It works with KDE's wrapper, as well as with a
custom wrapper macro. CMakeManager now also looks through source files to
find declaration for test cases, which only works with QTestLib.
 * php:
   - again, an implementation of ITestSuite for running with phpUnit. Test
suites are found as classes which inherit from PHPUnit_Framework_TestCase.

That's it in short, quite possibly I missed some minor change in another
folder. All new API I introduced is documented in the source files, and
working with templates is already on Techbase (
http://techbase.kde.org/Development/Tutorials#KDevelop) and Userbase. There
also unit tests wherever I could add them.

So, please try to look at the source and the new functionality. I have just
merged changes from master to both 'file-templates' branches, so you can
compile it right away. And let me know if I can make reviewing any easier,
either with a review request or in any other way.

Thank you,
Miha Čančula
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20120917/1e39df49/attachment.html>


More information about the KDevelop-devel mailing list