Tests in kdev4

Matt Rogers mattr at kde.org
Sun Dec 31 03:26:00 UTC 2006

On Dec 30, 2006, at 5:31 PM, Andreas Pakulat wrote:

> Hi,
> I need some input on how to handle test-writing for the qmake parser.
> Currently I have 1 test that just feeds some input to the parser and
> checks wether he can parse it or not (with 2 success and 2 fail- 
> expected
> cases).
> I also just added a test that checks a simple assignment is parsed
> correctly. The problem here is that the test function tests multiple
> things at once, which it shouldn't. As one cannot know what fails  
> (i.e.
> parsing, ast-generation...).
> Currently I only see 1 option to go about this: Create a new test  
> class
> for each "thing" I want to test, i.e. if I want to test
> VAR3 -= VALUE VALUE #comment
> This would mean 3 test classes and with about 10 things to test for
> variable assignments only, I think the tests folder will get cluttered
> (apart from the naming-problem).
> Anybody has a better idea how to go about this?
> Andreas

Actually, it should mean just one test class. If you have seperate  
tests for testing other things that getting an AST depend on, IMHO,  
you can skip checking for those conditions and just make sure that  
the thing you want to test is correct. If one of the preceding tests  
fail (ctest runs them in the order they're declared in the  
CMakeLists.txt file currently) then you can expect those to fail.

Hope this helps

More information about the KDevelop-devel mailing list