1 // Copyright Leo Goodstadt 2012
2 // Distributed under the Boost Software License, Version 1.0.
3 // (See accompanying file LICENSE_1_0.txt
4 // or copy at http://www.boost.org/LICENSE_1_0.txt)
7 #include <boost/program_options/parsers.hpp>
8 #include <boost/program_options/options_description.hpp>
9 #include <boost/program_options/variables_map.hpp>
10 #include <boost/program_options/cmdline.hpp>
11 using namespace boost::program_options
;
19 #include "minitest.hpp"
24 // like BOOST_CHECK_EQUAL but with more descriptive error message
26 #define CHECK_EQUAL(description, a, b) if (a != b) {std::cerr << "\n\nError:\n<<" << \
27 description << ">>\n Expected text=\"" << b << "\"\n Actual text =\"" << a << "\"\n\n"; assert(a == b);}
30 // Uncomment for Debugging, removes asserts so we can see more failures!
31 //#define BOOST_ERROR(description) std::cerr << description; std::cerr << "\n";
34 //8888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
36 // Uncomment to print out the complete set of diagnostic messages for the different test cases
38 #define CHECK_EQUAL(description, a, b) if (a != b) {std::cerr << "\n\nError: " << \
39 description << "\n Expecting\n" << b << "\n Found\n" << a << "\n\n"; } \
40 else {std::cout << description<< "\t" << b << "\n";}
43 //8888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
47 // test exception for each specified command line style, e.g. short dash or config file
49 template<typename EXCEPTION
>
50 void test_each_exception_message(const string
& test_description
, const vector
<const char*>& argv
, options_description
& desc
, int style
, string exception_msg
, istream
& is
= cin
)
52 if (exception_msg
.length() == 0)
55 unsigned argc
= argv
.size();
60 store(parse_config_file(is
, desc
), vm
);
62 store(parse_command_line(argv
.size(), &argv
[0], desc
, style
), vm
);
67 //cerr << "Correct:\n\t" << e.what() << "\n";
68 CHECK_EQUAL(test_description
, e
.what(), exception_msg
);
71 catch (std::exception
& e
)
73 // concatenate argv without boost::algorithm::join
75 for (unsigned ii
= 0; ii
< argc
- 1; ++ii
)
76 argv_txt
+= argv
[ii
] + string(" ");
78 argv_txt
+= argv
[argc
- 1];
80 BOOST_ERROR("\n<<" + test_description
+
81 string(">>\n Unexpected exception type!\n Actual text =\"") + e
.what() +
82 "\"\n argv =\"" + argv_txt
+
83 "\"\n Expected text=\"" + exception_msg
+ "\"\n");
86 BOOST_ERROR(test_description
+ ": No exception thrown. ");
93 // test exception messages for all command line styles (unix/long/short/slash/config file)
95 // try each command line style in turn
96 const int unix_style
= command_line_style::unix_style
;
97 const int short_dash
= command_line_style::allow_dash_for_short
| command_line_style::allow_short
| command_line_style::short_allow_adjacent
| command_line_style::allow_sticky
;
98 const int short_slash
= command_line_style::allow_slash_for_short
| command_line_style::allow_short
| command_line_style::short_allow_adjacent
;
99 const int long_dash
= command_line_style::allow_long
| command_line_style::long_allow_adjacent
| command_line_style::allow_guessing
;
103 template<typename EXCEPTION
>
104 void test_exception_message(const vector
<vector
<const char*> >& argv
,
105 options_description
& desc
,
106 const string
& error_description
,
107 const char* expected_message_template
[5])
109 string expected_message
;
112 expected_message
= expected_message_template
[0];
113 test_each_exception_message
<EXCEPTION
>(error_description
+ " -- unix",
114 argv
[0], desc
, unix_style
, expected_message
);
117 expected_message
= expected_message_template
[1];
118 test_each_exception_message
<EXCEPTION
>(error_description
+ " -- long_dash",
119 argv
[1], desc
, long_dash
, expected_message
);
123 expected_message
= expected_message_template
[2];
124 test_each_exception_message
<EXCEPTION
>(error_description
+ " -- short_dash",
125 argv
[2], desc
, short_dash
, expected_message
);
128 expected_message
= expected_message_template
[3];
129 test_each_exception_message
<EXCEPTION
>(error_description
+ " -- short_slash",
130 argv
[3], desc
, short_slash
, expected_message
);
133 expected_message
= expected_message_template
[4];
134 if (expected_message
.length())
136 istringstream
istrm(argv
[4][0]);
137 test_each_exception_message
<EXCEPTION
>(error_description
+ " -- config_file",
138 argv
[4], desc
, -1, expected_message
, istrm
);
143 #define VEC_STR_PUSH_BACK(vec, c_array) \
144 vec.push_back(vector<const char*>(c_array, c_array + sizeof(c_array) / sizeof(char*)));
146 //________________________________________________________________________________________
148 // invalid_option_value
150 //________________________________________________________________________________________
151 void test_invalid_option_value_exception_msg()
153 options_description desc
;
155 ("int-option,d", value
< int >(), "An option taking an integer")
158 vector
<vector
<const char*> > argv
;
159 const char* argv0
[] = { "program", "-d", "A_STRING"} ; VEC_STR_PUSH_BACK(argv
, argv0
);
160 const char* argv1
[] = { "program", "--int", "A_STRING"}; VEC_STR_PUSH_BACK(argv
, argv1
);
161 const char* argv2
[] = { "program", "-d", "A_STRING"} ; VEC_STR_PUSH_BACK(argv
, argv2
);
162 const char* argv3
[] = { "program", "/d", "A_STRING"} ; VEC_STR_PUSH_BACK(argv
, argv3
);
163 const char* argv4
[] = { "int-option=A_STRING"} ; VEC_STR_PUSH_BACK(argv
, argv4
);
165 const char* expected_msg
[5] = {
166 "the argument ('A_STRING') for option '--int-option' is invalid",
167 "the argument ('A_STRING') for option '--int-option' is invalid",
168 "the argument ('A_STRING') for option '-d' is invalid",
169 "the argument ('A_STRING') for option '/d' is invalid",
170 "the argument ('A_STRING') for option 'int-option' is invalid",
174 test_exception_message
<invalid_option_value
>(argv
, desc
, "invalid_option_value",
180 //________________________________________________________________________________________
184 //________________________________________________________________________________________
185 void test_missing_value_exception_msg()
187 options_description desc
;
189 ("cfgfile,e", value
<string
>(), "the config file")
190 ("output,o", value
<string
>(), "the output file")
192 vector
<vector
<const char*> > argv
;
193 const char* argv0
[] = { "program", "-e", "-e", "output.txt"} ; VEC_STR_PUSH_BACK(argv
, argv0
);
194 const char* argv1
[] = { "program", "--cfgfile"} ; VEC_STR_PUSH_BACK(argv
, argv1
);
195 const char* argv2
[] = { "program", "-e", "-e", "output.txt"} ; VEC_STR_PUSH_BACK(argv
, argv2
);
196 const char* argv3
[] = { "program", "/e", "/e", "output.txt"} ; VEC_STR_PUSH_BACK(argv
, argv3
);
197 const char* argv4
[] = { ""} ; VEC_STR_PUSH_BACK(argv
, argv4
);
199 const char* expected_msg
[5] = {
200 "the required argument for option '--cfgfile' is missing",
201 "the required argument for option '--cfgfile' is missing",
202 "the required argument for option '-e' is missing",
203 "", // Ignore probable bug in cmdline::finish_option
204 //"the required argument for option '/e' is missing",
207 test_exception_message
<invalid_command_line_syntax
>(argv
, desc
,
208 "invalid_syntax::missing_parameter",
212 //________________________________________________________________________________________
216 //________________________________________________________________________________________
217 void test_ambiguous_option_exception_msg()
219 options_description desc
;
221 ("cfgfile1,c", value
<string
>(), "the config file")
222 ("cfgfile2,o", value
<string
>(), "the config file")
223 ("good,g", "good option")
224 ("output,c", value
<string
>(), "the output file")
225 ("output", value
<string
>(), "the output file")
228 vector
<vector
<const char*> > argv
;
229 const char* argv0
[] = {"program", "-ggc", "file", "-o", "anotherfile"} ; VEC_STR_PUSH_BACK(argv
, argv0
);
230 const char* argv1
[] = {"program", "--cfgfile", "file", "--cfgfile", "anotherfile"} ; VEC_STR_PUSH_BACK(argv
, argv1
);
231 const char* argv2
[] = {"program", "-ggc", "file", "-o", "anotherfile"} ; VEC_STR_PUSH_BACK(argv
, argv2
);
232 const char* argv3
[] = {"program", "/c", "file", "/o", "anotherfile"} ; VEC_STR_PUSH_BACK(argv
, argv3
);
233 const char* argv4
[] = { "output=output.txt\n"} ; VEC_STR_PUSH_BACK(argv
, argv4
);
234 const char* expected_msg
[5] = {
235 "option '-c' is ambiguous and matches '--cfgfile1', and '--output'",
236 "option '--cfgfile' is ambiguous and matches '--cfgfile1', and '--cfgfile2'",
237 "option '-c' is ambiguous",
238 "option '/c' is ambiguous",
239 "option 'output' is ambiguous and matches different versions of 'output'",
241 test_exception_message
<ambiguous_option
>(argv
, desc
, "ambiguous_option",
245 //________________________________________________________________________________________
247 // multiple_occurrences
249 //________________________________________________________________________________________
250 void test_multiple_occurrences_exception_msg()
252 options_description desc
;
254 ("cfgfile,c", value
<string
>(), "the configfile")
257 vector
<vector
<const char*> > argv
;
258 const char* argv0
[] = {"program", "-c", "file", "-c", "anotherfile"} ; VEC_STR_PUSH_BACK(argv
, argv0
);
259 const char* argv1
[] = {"program", "--cfgfi", "file", "--cfgfi", "anotherfile"} ; VEC_STR_PUSH_BACK(argv
, argv1
);
260 const char* argv2
[] = {"program", "-c", "file", "-c", "anotherfile"} ; VEC_STR_PUSH_BACK(argv
, argv2
);
261 const char* argv3
[] = {"program", "/c", "file", "/c", "anotherfile"} ; VEC_STR_PUSH_BACK(argv
, argv3
);
262 const char* argv4
[] = { "cfgfile=output.txt\ncfgfile=output.txt\n"} ; VEC_STR_PUSH_BACK(argv
, argv4
);
263 const char* expected_msg
[5] = {
264 "option '--cfgfile' cannot be specified more than once",
265 "option '--cfgfile' cannot be specified more than once",
266 "option '-c' cannot be specified more than once",
267 "option '/c' cannot be specified more than once",
268 "option 'cfgfile' cannot be specified more than once",
270 test_exception_message
<multiple_occurrences
>(argv
, desc
, "multiple_occurrences",
274 //________________________________________________________________________________________
278 //________________________________________________________________________________________
279 void test_unknown_option_exception_msg()
281 options_description desc
;
283 ("good,g", "good option")
286 vector
<vector
<const char*> > argv
;
287 const char* argv0
[] = {"program", "-ggc", "file"} ; VEC_STR_PUSH_BACK(argv
, argv0
);
288 const char* argv1
[] = {"program", "--cfgfile", "file"} ; VEC_STR_PUSH_BACK(argv
, argv1
);
289 const char* argv2
[] = {"program", "-ggc", "file"} ; VEC_STR_PUSH_BACK(argv
, argv2
);
290 const char* argv3
[] = {"program", "/c", "file"} ; VEC_STR_PUSH_BACK(argv
, argv3
);
291 const char* argv4
[] = { "cfgfile=output.txt\n"} ; VEC_STR_PUSH_BACK(argv
, argv4
);
292 const char* expected_msg
[5] = {
293 "unrecognised option '-ggc'",
294 "unrecognised option '--cfgfile'",
295 "unrecognised option '-ggc'",
296 "unrecognised option '/c'",
297 "unrecognised option 'cfgfile'",
299 test_exception_message
<unknown_option
>(argv
, desc
, "unknown_option", expected_msg
);
302 //________________________________________________________________________________________
304 // validation_error::invalid_bool_value
306 //________________________________________________________________________________________
307 void test_invalid_bool_value_exception_msg()
309 options_description desc
;
311 ("bool_option,b", value
< bool>(), "bool_option")
315 vector
<vector
<const char*> > argv
;
316 const char* argv0
[] = {"program", "-b", "file"} ; VEC_STR_PUSH_BACK(argv
, argv0
);
317 const char* argv1
[] = {"program", "--bool_optio", "file"} ; VEC_STR_PUSH_BACK(argv
, argv1
);
318 const char* argv2
[] = {"program", "-b", "file"} ; VEC_STR_PUSH_BACK(argv
, argv2
);
319 const char* argv3
[] = {"program", "/b", "file"} ; VEC_STR_PUSH_BACK(argv
, argv3
);
320 const char* argv4
[] = { "bool_option=output.txt\n"} ; VEC_STR_PUSH_BACK(argv
, argv4
);
321 const char* expected_msg
[5] = {
322 "the argument ('file') for option '--bool_option' is invalid. Valid choices are 'on|off', 'yes|no', '1|0' and 'true|false'",
323 "the argument ('file') for option '--bool_option' is invalid. Valid choices are 'on|off', 'yes|no', '1|0' and 'true|false'",
324 "the argument ('file') for option '-b' is invalid. Valid choices are 'on|off', 'yes|no', '1|0' and 'true|false'",
325 "the argument ('file') for option '/b' is invalid. Valid choices are 'on|off', 'yes|no', '1|0' and 'true|false'",
326 "the argument ('output.txt') for option 'bool_option' is invalid. Valid choices are 'on|off', 'yes|no', '1|0' and 'true|false'",
328 test_exception_message
<validation_error
>(argv
,
330 "validation_error::invalid_bool_value",
337 //________________________________________________________________________________________
339 // validation_error::multiple_values_not_allowed
341 //________________________________________________________________________________________
343 // Strange exception: sole purpose seems to be catching multitoken() associated with a scalar
344 // validation_error::multiple_values_not_allowed seems thus to be a programmer error
347 void test_multiple_values_not_allowed_exception_msg()
349 options_description desc
;
351 ("cfgfile,c", value
<string
>()->multitoken(), "the config file")
352 ("good,g", "good option")
353 ("output,o", value
<string
>(), "the output file")
356 vector
<vector
<const char*> > argv
;
357 const char* argv0
[] = { "program", "-c", "file", "c", "-o", "fritz", "hugo" } ; VEC_STR_PUSH_BACK(argv
, argv0
);
358 const char* argv1
[] = { "program", "--cfgfil", "file", "c", "--outpu", "fritz", "hugo" } ; VEC_STR_PUSH_BACK(argv
, argv1
);
359 const char* argv2
[] = { "program", "-c", "file", "c", "-o", "fritz", "hugo"} ; VEC_STR_PUSH_BACK(argv
, argv2
);
360 const char* argv3
[] = { "program", "/c", "file", "c", "/o", "fritz", "hugo"} ; VEC_STR_PUSH_BACK(argv
, argv3
);
361 const char* argv4
[] = { "" } ; VEC_STR_PUSH_BACK(argv
, argv4
);
362 const char* expected_msg
[5] = {
363 "option '--cfgfile' only takes a single argument",
364 "option '--cfgfile' only takes a single argument",
365 "option '-c' only takes a single argument",
366 "option '/c' only takes a single argument",
369 test_exception_message
<validation_error
>(argv
,
371 "validation_error::multiple_values_not_allowed",
375 //________________________________________________________________________________________
377 // validation_error::at_least_one_value_required
379 //________________________________________________________________________________________
381 // Strange exception: sole purpose seems to be catching zero_tokens() associated with a scalar
382 // validation_error::multiple_values_not_allowed seems thus to be a programmer error
385 void test_at_least_one_value_required_exception_msg()
389 options_description desc
;
391 ("cfgfile,c", value
<int>()->zero_tokens(), "the config file")
392 ("other,o", value
<string
>(), "other")
395 vector
<vector
<const char*> > argv
;
396 const char* argv0
[] = { "program", "-c" } ; VEC_STR_PUSH_BACK(argv
, argv0
);
397 const char* argv1
[] = { "program", "--cfg", "--o", "name" } ; VEC_STR_PUSH_BACK(argv
, argv1
);
398 const char* argv2
[] = { "program", "-c" , "-o" , "name" } ; VEC_STR_PUSH_BACK(argv
, argv2
);
399 const char* argv3
[] = { "program", "/c" } ; VEC_STR_PUSH_BACK(argv
, argv3
);
400 const char* argv4
[] = { "" } ; VEC_STR_PUSH_BACK(argv
, argv4
);
401 const char* expected_msg
[5] = {
402 "option '--cfgfile' requires at least one argument",
403 "option '--cfgfile' requires at least one argument",
404 "option '-c' requires at least one argument",
405 "option '/c' requires at least one argument",
408 test_exception_message
<validation_error
>(argv
,
410 "validation_error::at_least_one_value_required",
415 //________________________________________________________________________________________
419 //________________________________________________________________________________________
420 void test_required_option_exception_msg()
422 options_description desc
;
424 ("cfgfile,c", value
<string
>()->required(), "the config file")
425 ("good,g", "good option")
426 ("output,o", value
<string
>()->required(), "the output file")
429 vector
<vector
<const char*> > argv
;
430 const char* argv0
[] = { "program", "-g" } ; VEC_STR_PUSH_BACK(argv
, argv0
);
431 const char* argv1
[] = { "program", "--g" } ; VEC_STR_PUSH_BACK(argv
, argv1
);
432 const char* argv2
[] = { "program", "-g"} ; VEC_STR_PUSH_BACK(argv
, argv2
);
433 const char* argv3
[] = { "program", "/g"} ; VEC_STR_PUSH_BACK(argv
, argv3
);
434 const char* argv4
[] = { "" } ; VEC_STR_PUSH_BACK(argv
, argv4
);
435 const char* expected_msg
[5] = {
436 "the option '--cfgfile' is required but missing",
437 "the option '--cfgfile' is required but missing",
438 "the option '-c' is required but missing",
439 "the option '/c' is required but missing",
440 "the option 'cfgfile' is required but missing",
442 test_exception_message
<required_option
>(argv
,
464 * Check if this is the expected exception with the right message is being thrown inside
467 template <typename EXCEPTION
, typename FUNC
>
468 void test_exception(const string
& test_name
, const string
& exception_txt
, FUNC func
)
472 options_description desc
;
478 CHECK_EQUAL(test_name
, e
.what(), exception_txt
);
481 catch (std::exception
& e
)
483 BOOST_ERROR(string(test_name
+ ":\nUnexpected exception. ") + e
.what() +
484 "\nExpected text:\n" + exception_txt
+ "\n\n");
487 BOOST_ERROR(test_name
+ ": No exception thrown. ");
492 //________________________________________________________________________________________
494 // check_reading_file
496 //________________________________________________________________________________________
497 void check_reading_file(options_description
& desc
, variables_map
& vm
)
500 ("output,o", value
<string
>(), "the output file");
502 const char* file_name
= "no_such_file";
503 store(parse_config_file
<char>(file_name
, desc
, true), vm
);
508 //________________________________________________________________________________________
510 // config_file_wildcard
512 //________________________________________________________________________________________
513 void config_file_wildcard(options_description
& desc
, variables_map
& vm
)
516 ("outpu*", value
<string
>(), "the output file1")
517 ("outp*", value
<string
>(), "the output file2")
519 istringstream
is("output1=whichone\noutput2=whichone\n");
520 store(parse_config_file(is
, desc
), vm
);
523 //________________________________________________________________________________________
525 // invalid_syntax::unrecognized_line
527 //________________________________________________________________________________________
528 void unrecognized_line(options_description
& desc
, variables_map
& vm
)
530 istringstream
is("funny wierd line\n");
531 store(parse_config_file(is
, desc
), vm
);
534 //________________________________________________________________________________________
536 // abbreviated_options_in_config_file
538 //________________________________________________________________________________________
539 void abbreviated_options_in_config_file(options_description
& desc
, variables_map
& vm
)
541 desc
.add_options()(",o", value
<string
>(), "the output file");
542 istringstream
is("o=output.txt\n");
543 store(parse_config_file(is
, desc
), vm
);
547 //________________________________________________________________________________________
549 // too_many_positional_options
551 //________________________________________________________________________________________
552 void too_many_positional_options(options_description
& desc
, variables_map
& vm
)
554 const char* argv
[] = {"program", "1", "2", "3"};
555 positional_options_description positional_args
;
556 positional_args
.add("two_positional_arguments", 2);
557 store(command_line_parser(4, argv
).options(desc
).positional(positional_args
).run(), vm
);
561 //________________________________________________________________________________________
563 // invalid_command_line_style
565 //________________________________________________________________________________________
567 void test_invalid_command_line_style_exception_msg()
569 string test_name
= "invalid_command_line_style";
570 using namespace command_line_style
;
571 options_description desc
;
572 desc
.add_options()("output,o", value
<string
>(), "the output file");
574 vector
<int> invalid_styles
;
575 invalid_styles
.push_back(allow_short
| short_allow_adjacent
);
576 invalid_styles
.push_back(allow_short
| allow_dash_for_short
);
577 invalid_styles
.push_back(allow_long
);
578 vector
<string
> invalid_diagnostics
;
579 invalid_diagnostics
.push_back("boost::program_options misconfiguration: choose one "
580 "or other of 'command_line_style::allow_slash_for_short' "
581 "(slashes) or 'command_line_style::allow_dash_for_short' "
582 "(dashes) for short options.");
583 invalid_diagnostics
.push_back("boost::program_options misconfiguration: choose one "
584 "or other of 'command_line_style::short_allow_next' "
585 "(whitespace separated arguments) or "
586 "'command_line_style::short_allow_adjacent' ('=' "
587 "separated arguments) for short options.");
588 invalid_diagnostics
.push_back("boost::program_options misconfiguration: choose one "
589 "or other of 'command_line_style::long_allow_next' "
590 "(whitespace separated arguments) or "
591 "'command_line_style::long_allow_adjacent' ('=' "
592 "separated arguments) for long options.");
595 const char* argv
[] = {"program"};
597 for (unsigned ii
= 0; ii
< 3; ++ii
)
599 bool exception_thrown
= false;
602 store(parse_command_line(1, argv
, desc
, invalid_styles
[ii
]), vm
);
604 catch (invalid_command_line_style
& e
)
606 string
error_msg("arguments are not allowed for unabbreviated option names");
607 CHECK_EQUAL(test_name
, e
.what(), invalid_diagnostics
[ii
]);
608 exception_thrown
= true;
610 catch (std::exception
& e
)
612 BOOST_ERROR(string(test_name
+ ":\nUnexpected exception. ") + e
.what() +
613 "\nExpected text:\n" + invalid_diagnostics
[ii
] + "\n");
614 exception_thrown
= true;
616 if (!exception_thrown
)
618 BOOST_ERROR(test_name
<< ": No exception thrown. ");
623 void test_empty_value_inner(options_description
&opts
, variables_map
& vm
) {
624 positional_options_description popts
;
625 opts
.add_options()("foo", value
<uint32_t>()->value_name("<time>")->required());
627 vector
<string
> tokens
{""};
628 parsed_options parsed
= command_line_parser(tokens
)
629 .style(command_line_style::default_style
& ~command_line_style::allow_guessing
)
636 void test_empty_value() {
637 // Test that passing empty token for an option that requires integer does not result
638 // in out-of-range error in error reporting code.
639 test_exception
<invalid_option_value
>(
641 "the argument for option '--foo' is invalid",
642 test_empty_value_inner
);
645 int main(int /*ac*/, char** /*av*/)
647 test_ambiguous_option_exception_msg();
648 test_unknown_option_exception_msg();
649 test_multiple_occurrences_exception_msg();
650 test_missing_value_exception_msg();
651 test_invalid_option_value_exception_msg();
652 test_invalid_bool_value_exception_msg();
653 test_multiple_values_not_allowed_exception_msg();
654 test_required_option_exception_msg();
655 test_at_least_one_value_required_exception_msg();
659 string expected_message
;
662 // check_reading_file
663 test_name
= "check_reading_file";
664 expected_message
= "can not read options configuration file 'no_such_file'";
665 test_exception
<reading_file
>(test_name
, expected_message
, check_reading_file
);
667 // config_file_wildcard
668 test_name
= "config_file_wildcard";
669 expected_message
= "options 'outpu*' and 'outp*' will both match the same arguments from the configuration file";
670 test_exception
<error
>(test_name
, expected_message
, config_file_wildcard
);
673 test_name
= "unrecognized_line";
674 expected_message
= "the options configuration file contains an invalid line 'funny wierd line'";
675 test_exception
<invalid_syntax
>(test_name
, expected_message
, unrecognized_line
);
678 // abbreviated_options_in_config_file
679 test_name
= "abbreviated_options_in_config_file";
680 expected_message
= "abbreviated option names are not permitted in options configuration files";
681 test_exception
<error
>(test_name
, expected_message
, abbreviated_options_in_config_file
);
683 test_name
= "too_many_positional_options";
684 expected_message
= "too many positional options have been specified on the command line";
685 test_exception
<too_many_positional_options_error
>(
686 test_name
, expected_message
, too_many_positional_options
);
688 test_invalid_command_line_style_exception_msg();