[Cdash] Adding support for "Krazy" code checker to cdash ?

Alexander Neundorf neundorf at kde.org
Sun Mar 28 16:57:29 UTC 2010


in KDE we have a tool called "krazy" which does some checks on our code 
(http://techbase.kde.org/Development/Tutorials/Code_Checking). The results 
can currently be seen at 

It would be nice if krazy could be used also together with cdash, i.e. so that 
the problems reported by krazy appear the same way as e.g. compiler warnings.

So, I've got two questions:

1) how would I integrate krazy-checks into a nightly build ?
My nightly-script basically does:


Where would krazy come into play ?
krazy can be executed like this: $ krazy2all <dir>
and then it will check all files it finds in the directory <dir> and below.
Where/how would I add this call into the nightly-script ?

2) What is necessary so that cdash can recognize the reported errors in krazy 
output ?
The output currently supports multiple formats:


==>For File Type c++<==
1. Check for TRUE and FALSE macros [captruefalse]... 1 issue found
        ./src/board.cpp: using TRUE line#707 (1)
        The TRUE and FALSE macros are obsolete and should be replaced with
        true and false (all lower case) respectively.

2. Check for methods that return 'const' refs in public classes [constref]... 

3. Check for an acceptable copyright [copyright]... Ok!

4. Check for cpp macros and usage [cpp]... Ok!

5. Check for code that should be considered crashy. [crashy]... Ok!

6. Check single-char QString operations for efficiency [doublequote_chars]... 

7. Check for unwanted doxygen tags in major versions [doxytags]... Ok!

8. Check public classes with private members or d-pointer issues [dpointer]... 

9. Check for QString compares to "" [emptystrcompare]... Ok!

10. Check that file ends with a newline [endswithnewline]... 1 issue found
        ./src/board.cpp: line# 714 (1)
        Files that do not end with a newline character can cause problems.
        Please add a newline character to the end of the file.

11. Check for C++ ctors that should be declared 'explicit' [explicit]... Ok!


Or, alternatively, the following:  

src/board.cpp:707:using TRUE, TRUE and FALSE macros
src/board.cpp: 714:that file ends with a newline


or, XML (shortened):

  <check desc="Check that file ends with a newline [endswithnewline]...">
     <file name="src/board.cpp">
      <explanation>Files that do not end with a newline character can cause 
problems. Please add a newline character to the end of the file.

Maybe the second format might be already usable for cdash ?


More information about the CDash mailing list