Support command line option categories.
[oota-llvm.git] / unittests / Support / CommandLineTest.cpp
index 43c8cbd123b4bb2cc22cc899da42510625f795cd..815212ff39451f97c61d051fd6fc7a621b648396 100644 (file)
@@ -66,4 +66,12 @@ TEST(CommandLineTest, ParseEnvironmentToLocalVar) {
 
 #endif  // SKIP_ENVIRONMENT_TESTS
 
+TEST(CommandLineTest, UseOptionCategory) {
+  cl::OptionCategory TestCategory("Test Options", "Description");
+  cl::opt<int> TestOption("test-option", cl::cat(TestCategory));
+
+  ASSERT_EQ(&TestCategory,TestOption.Category) << "Failed to assign Option "
+                                                  "Category.";
+}
+
 }  // anonymous namespace