[PATCH] D57030: [CommandLine] Don't print empty sentinel values from EnumValN lists in help text

Thomas Preud'homme via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 24 07:01:26 PST 2019


thopre added a comment.

In D57030#1369239 <https://reviews.llvm.org/D57030#1369239>, @jhenderson wrote:

> In D57030#1367916 <https://reviews.llvm.org/D57030#1367916>, @ruiu wrote:
>
> > I found this file: `llvm/unittests/Support/CommandLineTest.cpp`
> >
> > Maybe you can add a test for the new functionality to that file.
>
>
> That's where I would test this, yes, but the function is all about printing to `outs()`, and I don't know of a way using LLVM's tools to test that. Can you (or anybody else) suggest anything?
>
> I guess I could just put a test in "test/Other" which runs a tools with --help that prints the various forms available (although I don't think the "=<empty>" path is used anywhere currently).


Can't you use something like dup2 (but more portable across platforms) to redirect the output to a file, read that file and check its content?


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57030/new/

https://reviews.llvm.org/D57030





More information about the llvm-commits mailing list