[cmake-developers] Perforce patch for CTest

Pedro Navarro pnavarro at netflix.com
Wed Oct 2 16:10:20 EDT 2013


>
>
> >    - It requires an English version of Perforce (use the P4_OPTIONS
> >    variable, documented below to pass the -L switch to change the message
> >    language if you installation has a different one). It shouldn't be too
> > hard to change the regular expressions used for parsing to not key on a
> > specific word but on character ranges. I'll look into that if this
> becomes
> > an issue.
>
> Maybe set P4_OPTIONS automatically to -Lenglish (or whatever) in case it is
> not set?
>

I tried that originally but had no effect. Also, on the perforce
documentation it says that "Specifies the language to use for error
messages from the Perforce service. In order for this flag to work, your
administrator must have loaded support for non-English messages in the
database", so I didn't feel comfortable adding a flag globably without
knowing it might even trigger an error (like invalid language or something
like that).

Perforce offers the P4LANGUAGE environment variable which can be used to
configure the client for updates, and we also have the P4_OPTIONS variable,
so I think for now it's a good solution/workaround until we have more
information.


> This will go wrong if the filename contains e.g. "#42". From what your
> examples
> look like this could be changed to " ([a-z]+)$" or if that doesn't file
> maybe "
> ([^ ]+)$".
>

Good point. I'm changing it to ([^ ]+)$ so it will match 


> +  void DoBodyLine()
> +    {
> +    if(this->Line[0] == '\t')
>
> Is it guaranteed that Line is never empty? Otherwise you should test !this-
> >Line.empty() before accessing it.
>

Yes, it's guaranteed to be not empty because an empty line would trigger a
section change.

>
> +  unsigned int i;
> +  for(i=0; i<Options.size(); i++)
>
> This could cause truncation warnings, use size_t better Options::size_type
> instead. Or use an iterator.
>

Sounds good, will do that.

Thanks for your comments.

Pedro
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20131002/b5c53b29/attachment.html>


More information about the cmake-developers mailing list