More on C++ tests
zwabel at googlemail.com
Sat Jun 19 10:54:19 UTC 2010
2010/6/19 Milian Wolff <mail at milianw.de>:
> On Saturday 19 June 2010 00:00:24 Nicolás Alvarez wrote:
>> cppcodecompletiontest (test_cppcodecompletion.cpp) seems to have have
>> lots of tests that aren't really about code completion.
>> Many seem to be general duchain tests. For example, testImportTypedef
>> doesn't use the completion context or CompletionItemTester. It would
>> fit perfectly in duchaintest.
>> There are even one or two test functions that test exclusively the
>> preprocessor (eg. testHeaderSections), I think should be in a new
>> separate test class that links only to rpp.
>> Or is there a rationale for these tests being in cppcodecompletion?
> no rationale, except that code completion requires some preprocessor while the
> other duchain tests don't need it.
> you can clean it up if you want to.
They are there, because test_cppcodecompletion has a more complex
duchain testing architecture, which includes support for preprocessor,
#included files, etc., which the one in test_duchain doesn't support.
The problem with both test_duchain and test_cppcodecompletion is that
they have an own replacement for the background parser and the whole
parsing architecture in kdevplatform/kdevelop, because that one didn't
support testing at that point.
However that problem has been fixed, and now we can use the _whole_
kdevplatform/kdevelop architecture for the tests, which is done in
test_cppcodegen, using the InsertIntoDUChain helper class, and in
long-term it might make sense to port the other tests to the same
More information about the KDevelop-devel