Opened 7 years ago

Closed 6 years ago

#11888 closed Bugs (wontfix)

boost.test throws an exception when passed a custom command line parameter

Reported by: James Whitworth <fun4jimmy@…> Owned by: Raffi Enficiaud
Milestone: To Be Determined Component: test
Version: Boost 1.60.0 Severity: Problem
Keywords: test; runtime_config; commandline; Cc:

Description

At work we have lots of custom command line arguments for our tests and the upgrade from 1.58.0 to 1.59.0 no longer works. When running the executable our flags set ("--use_timeouts" in this case) runtime_config::init incorrectly throws a unrecognized_param exception from within locate_parameter when parsing our custom option. It looks like it is trying to find a likely typo but there are none as it's not anything to do with the built in arguments.

The runtime_config.html documentation states "The rest of command line is forwarded to the test module initialization function supplied by you.".

This stops us upgrading to versions greater than 1.59 which in turn means we cannot currently upgrade to Visual Studio 2015.

Change History (8)

comment:1 by Raffi Enficiaud, 7 years ago

I believe you meant when you upgraded from 1.59 to 1.60, please confirm.

The API for command line has changed in 1.60, and -- needs to be added before user command line arguments, as explained eg. here http://www.boost.org/doc/libs/master/libs/test/doc/html/boost_test/change_log.html.

If you are using a test driver such as cmake, this can be easily achieved by testing against the version of boost.

Last edited 7 years ago by Raffi Enficiaud (previous) (diff)

comment:2 by James Whitworth <fun4jimmy@…>, 7 years ago

Ah ok, I just realised I didn't look at the 1.60 documentation. I skipped version 1.59 on windows when trying this upgrade as it was the latest version. I must have only looked at the 1.59 documentation though. I had to fix up some breaking api changes and someone had already fixed up similar errors when changing our linux builds over to version 1.59 so I wrongly assumed everything had changed in that version.

Is there a more detailed version of the changes between these version? I couldn't find mention of some of the changes in the documentation for either version. Off the top of my head some of the changes were the methods of test reporter changed and the way of querying the runtime config.

comment:3 by Raffi Enficiaud, 7 years ago

There is the changelog that you may find here, that summarizes as accurately as possible the changes between versions:

http://www.boost.org/doc/libs/master/libs/test/doc/html/boost_test/change_log.html

but maybe this deserves some more entry in the "runtime parameter configuration":

http://www.boost.org/doc/libs/master/libs/test/doc/html/boost_test/runtime_config.html

What do you think would make the information more accessible?

comment:4 by Raffi Enficiaud, 7 years ago

Owner: changed from Gennadiy Rozental to Raffi Enficiaud
Status: newassigned

comment:5 by Raffi Enficiaud, 7 years ago

Version: Boost 1.59.0Boost 1.60.0

comment:6 by James Whitworth <fun4jimmy@…>, 7 years ago

I think having the api in changes in change_log.html is the best place for them. I would have liked to know:

  • the call to boost::unit_test::runtime_config::log_format() was replaced with a generic template system boost::unit_test::runtime_config::get<boost::unit_test::output_format>( boost::unit_test::runtime_config::OUTPUT_FORMAT), this could then link to the runtime_config.html page with a more detailed explanation
  • The enum for format types was renamed boost::unit_test::XML was renamed to boost::unit_test::OF_XML etc.
  • boost::unit_test::unit_test_log_formatter::test_unit_skipped() now takes a const_string reason.
  • boost::unit_test::unit_test_log_formatter::log_exception() was replaced with log_exception_start and log_exception_finish
  • boost::unit_test::unit_test_log_formatter has new functions added for contexts: entry_context_start(), log_entry_context() and entry_context_finish()

If all that was available from the change_log.html then there would be less digging around in the source to see what was required to fix up. If any of these were marked as internal to boost test then I understand it's up to me to fix them but if they are in the public api then it would be good to have some mention of the changes.

I guess doing a diff with the last released version would get you a good idea of what should be mentioned.

comment:7 by Raffi Enficiaud, 7 years ago

Severity: ShowstopperProblem

comment:8 by Raffi Enficiaud, 6 years ago

Resolution: wontfix
Status: assignedclosed

All those have been documented in 1.62 (api documentation). I believe modifying the change_log now would not improve this. Also there were so many changes between 1.58 and 1.59...

Note: See TracTickets for help on using tickets.