Thanks for the patch. https://codereview.appspot.com/226420043/diff/1/src/gtest.cc File src/gtest.cc (right): https://codereview.appspot.com/226420043/diff/1/src/gtest.cc#newcode5191 src/gtest.cc:5191: std::vector<std::string> lines(SplitEscapedString(contents)); Is this the ...
10 years, 8 months ago
(2015-04-21 19:50:29 UTC)
#2
Thanks for the patch.
https://codereview.appspot.com/226420043/diff/1/src/gtest.cc
File src/gtest.cc (right):
https://codereview.appspot.com/226420043/diff/1/src/gtest.cc#newcode5191
src/gtest.cc:5191: std::vector<std::string> lines(SplitEscapedString(contents));
Is this the right split routine to use?
What are the contents of the file? Are the contents somehow escaped?
The format of the file has to be specified somewhere. I think the flag
description could mention it.
I think the simplest would be to keep commandline syntax (using --flag_name).
Treat space and newline as flag separators.
If you want to get fancy, you could allow comments, like in a shell.
https://codereview.appspot.com/226420043/diff/1/src/gtest.cc#newcode5193
src/gtest.cc:5193: if (!ParseGoogleTestFlag(lines[i].c_str()))
I don't know if it is a good idea to have this function be recursive.
A config file pointing to itself could cause a stack overflow.
Maybe something like:
bool ParseGoogleTestFlag() only does the other names, and then in
ParseGoogleTestFlagsOnlyImpl() you could do:
if (ParseStringFlag(arg, kFlagfileFlag, >EST_FLAG(flagfile))) {
return LoadFlagsFromFile();
} else {
return ParseGoogleTestFlag(...);
}
And LoadFlagsFromFile() can also call ParseGoogleTestFlag(...)
https://codereview.appspot.com/226420043/diff/1/src/gtest.cc File src/gtest.cc (right): https://codereview.appspot.com/226420043/diff/1/src/gtest.cc#newcode5191 src/gtest.cc:5191: std::vector<std::string> lines(SplitEscapedString(contents)); On 2015/04/21 19:50:29, sbenza wrote: > Is ...
10 years, 8 months ago
(2015-04-30 15:49:03 UTC)
#3
https://codereview.appspot.com/226420043/diff/1/src/gtest.cc
File src/gtest.cc (right):
https://codereview.appspot.com/226420043/diff/1/src/gtest.cc#newcode5191
src/gtest.cc:5191: std::vector<std::string> lines(SplitEscapedString(contents));
On 2015/04/21 19:50:29, sbenza wrote:
> Is this the right split routine to use?
> What are the contents of the file? Are the contents somehow escaped?
> The format of the file has to be specified somewhere. I think the flag
> description could mention it.
>
> I think the simplest would be to keep commandline syntax (using --flag_name).
> Treat space and newline as flag separators.
> If you want to get fancy, you could allow comments, like in a shell.
Done.
https://codereview.appspot.com/226420043/diff/1/src/gtest.cc#newcode5193
src/gtest.cc:5193: if (!ParseGoogleTestFlag(lines[i].c_str()))
On 2015/04/21 19:50:29, sbenza wrote:
> I don't know if it is a good idea to have this function be recursive.
> A config file pointing to itself could cause a stack overflow.
>
> Maybe something like:
>
> bool ParseGoogleTestFlag() only does the other names, and then in
> ParseGoogleTestFlagsOnlyImpl() you could do:
>
> if (ParseStringFlag(arg, kFlagfileFlag, >EST_FLAG(flagfile))) {
> return LoadFlagsFromFile();
> } else {
> return ParseGoogleTestFlag(...);
> }
>
> And LoadFlagsFromFile() can also call ParseGoogleTestFlag(...)
Done.
Issue 226420043: Add support for --gtest_flagfile
Created 10 years, 9 months ago by phajdan.jr
Modified 10 years, 8 months ago
Reviewers: sbenza
Base URL: http://googletest.googlecode.com/svn/trunk/
Comments: 4