Tests in kdev4

Andreas Pakulat apaku at gmx.de
Sun Dec 31 01:52:08 UTC 2006


On 31.12.06 00:31:13, 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
> 
> VAR = VALUE
> VAR2 += VALUE
> 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). 

And once again I can correct myself: Multiple QVERIFY calls work
perfectly and thus I can put all tests for assignments into 1 test and
still have proper reports when any of the sub-checks fails.

Andreas

-- 
Try to value useful qualities in one who loves you.




More information about the KDevelop-devel mailing list