[CMake] Coverage tests with gcov under Linux

Judicaël Bedouet j.bedouet at infonie.fr
Sat May 10 05:55:56 EDT 2008


It works if I set LC_ALL to POSIX before running `make Experimental`.
"Unknown line" messages disappear.

I think it would be a good idea for CMake to set locales to POSIX
before executing gcov.

Thank you all,

J. Bedouet


On Sat, May 10, 2008 at 5:38 AM, John Doe <ufnoise at gmail.com> wrote:
> I don't know how your program works or how it is exec'ing other
> software.  However, it should ensure that the proper environment is
> set before these other programs are executed.
>
> Using "setlocale" may result in whatever system functions and whatever
> "regex" functions you are using to at least read the input in a manner
> that you are expecting.
>
> Perhaps "setlocale" is not the appropriate function, but cmake needs
> to ensure whatever program's output being parsed is in the right
> language.
>
> Good luck,
>
> Juan
>
> On Fri, May 9, 2008 at 8:54 PM, Bill Hoffman <bill.hoffman at kitware.com> wrote:
>> John Doe wrote:
>>>
>>> Since this is the fault of cmake, you should perhaps have it set the
>>> proper locale when the program first begins.  I have never done this,
>>> but a google search reveals stuff like:
>>>
>>>  std::setlocale(LC_ALL, "En_US");
>>>  std::fscanf(priceFile,"%lf",&price);
>>>  // convert $ to DM according to the current exchange rate
>>>  std::setlocale(LC_ALL,"De_DE");
>>>  std::strfmon(buf,SZ,"%n",price);
>>>  std::fprintf(invoiceFile,"%s",buf);
>>>
>>
>> I don't see how that would help me at all?   CMake is parsing the output of
>> another program.  If the LC_ALL works, the thing to do would be to set
>> LC_ALL to POSIX before ctest runs gcov.
>>
>> -Bill
>>
>


More information about the CMake mailing list