Commit 8233556d authored by Craig Silverstein's avatar Craig Silverstein

Add a new unittest case, that tests the --help output for a
really long helpstring.  Opensource gflags had a bug where we
were cutting off the output too soon; this test should protect
against such a thing.

R=nilton
DELTA=16  (16 added, 0 deleted, 0 changed)


Revision created by MOE tool push_codebase.
MOE_MIGRATION=2885


git-svn-id: https://gflags.googlecode.com/svn/trunk@58 6586e3c6-dcc4-952a-343f-ff74eb82781d
parent 404970d6
......@@ -127,6 +127,19 @@ DEFINE_string(unused_string, "unused", "");
// These flags are used by gflags_unittest.sh
DEFINE_bool(changed_bool1, false, "changed");
DEFINE_bool(changed_bool2, false, "changed");
DEFINE_bool(long_helpstring, false,
"This helpstring goes on forever and ever and ever and ever and "
"ever and ever and ever and ever and ever and ever and ever and "
"ever and ever and ever and ever and ever and ever and ever and "
"ever and ever and ever and ever and ever and ever and ever and "
"ever and ever and ever and ever and ever and ever and ever and "
"ever and ever and ever and ever and ever and ever and ever and "
"ever and ever and ever and ever and ever and ever and ever and "
"ever and ever and ever and ever and ever and ever and ever and "
"ever and ever and ever and ever and ever and ever and ever and "
"ever and ever and ever and ever and ever and ever and ever and "
"ever. This is the end of a long helpstring");
static bool AlwaysFail(const char* flag, bool value) { return value == false; }
DEFINE_bool(always_fail, false, "will fail to validate when you set it");
......
......@@ -111,6 +111,9 @@ Expect $LINENO 0 "PASS" ""
# --help should show all flags, including flags from gflags_reporting
Expect $LINENO 1 "/gflags_reporting.cc" "" --help
# Make sure that --help prints even very long helpstrings.
Expect $LINENO 1 "end of a long helpstring" "" --help
# Make sure --help reflects flag changes made before flag-parsing
Expect $LINENO 1 \
"-changed_bool1 (changed) type: bool default: true" "" --help
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment