QtTest conventions

Manuel Breugelmans mbr.nxi at gmail.com
Wed Apr 23 11:27:00 UTC 2008

Uniform structured code is almost always a positive thing. Unless I overlooked 
the guidelines for tests are currently not written out. This is what I 
deduced by looking at the existing QtTests in kdev{elop,platform}:

* tests should be located in a subdirectory 'tests' directly beneath the 
module under test
* files are named after the class under test, in all lower-case with 'test' 
* declaration & implementation go in seperate .cpp and .h
* testcases are named after the class under test in camel-case with 'Test' 
* KDEVTEST_MAIN or QTTEST_MAIN macro at the end of .cpp, right before .moc 
* test commands are prefixed with 'test'
* fixture methods {init,cleanup}TestCase declared first
* helper methods and fixture attributes declared private in the testcase
* CMakeLists.txt inside each test module with 

Ok to add this list of recommendations to the wiki?


More information about the KDevelop-devel mailing list