[PATCH] D21485: [cl] Teach cl to support the notion of sub commands (e.g. "git checkout <foo>")

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 17 21:11:22 PDT 2016


zturner updated this revision to Diff 61158.
zturner added a comment.

Added some unit tests.  It wasn't easy to test this because the normal paradigm for using llvm::cl is using globals, which doesn't allow you to set up a clean test case each time through.  So I had to go through and add some hooks in llvm::cl for basically wiping the slate clean on each test.  This allows me to set up new subcommands and options on the stack for each test.

The good news is, adding these unit tests caught a couple of bugs in the implementation of `AllSubCommands`, which are now fixed.


http://reviews.llvm.org/D21485

Files:
  include/llvm/Support/CommandLine.h
  lib/Support/CommandLine.cpp
  test/DebugInfo/PDB/DIA/pdbdump-flags.test
  test/DebugInfo/PDB/DIA/pdbdump-linenumbers.test
  test/DebugInfo/PDB/DIA/pdbdump-symbol-format.test
  test/DebugInfo/PDB/pdbdump-headers.test
  test/DebugInfo/PDB/pdbdump-yaml.test
  test/tools/llvm-pdbdump/class-layout.test
  test/tools/llvm-pdbdump/enum-layout.test
  test/tools/llvm-pdbdump/load-address.test
  test/tools/llvm-pdbdump/regex-filter.test
  tools/llvm-pdbdump/ClassDefinitionDumper.cpp
  tools/llvm-pdbdump/EnumDumper.cpp
  tools/llvm-pdbdump/LLVMOutputStyle.cpp
  tools/llvm-pdbdump/LinePrinter.cpp
  tools/llvm-pdbdump/TypeDumper.cpp
  tools/llvm-pdbdump/VariableDumper.cpp
  tools/llvm-pdbdump/YAMLOutputStyle.cpp
  tools/llvm-pdbdump/llvm-pdbdump.cpp
  tools/llvm-pdbdump/llvm-pdbdump.h
  unittests/Support/CommandLineTest.cpp
  unittests/Support/ProgramTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21485.61158.patch
Type: text/x-patch
Size: 90555 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160618/fb428bdc/attachment.bin>


More information about the llvm-commits mailing list