[CMake] Coverage tests with gcov under Linux

Bill Hoffman bill.hoffman at kitware.com
Fri May 9 13:40:38 EDT 2008


Judicaël Bedouet wrote:
> I have just tested with an other machine (a Fedora core 6). It's
> better but it's a tricky thing : gcc version is 4.1 (g++ (GCC) 4.1.2
> 20070626 (Red Hat 4.1.2-13)). First machine is an XUbuntu.
> 
> The file main.cxx is yet marked as UNTESTED under CDash. So, I tried
> with CMake 2.4-6, which is provided by Fedora, and with this version,
> I can see the line which is not covered.
> 
> As soon as I can, I will download the lastest CVS version to see if
> the UNTESTED problem is resolved but I can't understand why under
> XUbuntu I can't have coverage results.
> 
>

The problem is here:

Unknown line: [Lignes exécutées: 57.14% de 21]
Unknown line: [File « /usr/include/c++/4.2/iostream »]
Unknown line: [Lignes exécutées: 100.00% de 1]
Unknown line: [File « /home/xxxxxxxx/cvs/xxxxxxx/Key.h »]
Unknown line: [Lignes exécutées: 100.00% de 4]


Looks like it is the French that is messing things up...

CTest has some regex stuff to parse the output of gcov:

   std::string st2gcovOutputRex1 = "^File *[`'](.*)'$";
   std::string st2gcovOutputRex2
     = "Lines executed: *[0-9]+\\.[0-9]+% of [0-9]+$";
...
If none of those regex expressions are matched it does this:

     cmCTestLog(this->CTest, ERROR_MESSAGE,
           "Unknown line: [" << line->c_str() << "]" << std::endl);
         cont->Error ++;


Your gcov has be internationalized and is not talking French, CTest does 
not speak French.  Is there an environment variable that can turn that off?

-Bill


More information about the CMake mailing list