Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unregistered reporter is not considered a command line error #1351

Closed
TorstenRobitzki opened this issue Aug 2, 2018 · 2 comments
Closed

Comments

@TorstenRobitzki
Copy link

TorstenRobitzki commented Aug 2, 2018

Description

when session.applyCommandLine() is called with an unregistered reporter, the function simply returns 0 and the later call to session.run() just outputs a text: No reporter registered with name: 'foo'

Steps to reproduce

int main()
{
  const char* argv[] = { "runner", "-r foo" };

  Catch::Session session;

  const int command_line_errors = session.applyCommandLine( std::size( argv ), const_cast< char** >( argv ) );

  if ( command_line_errors == 0 )
  {
    session.run();
  }
  else
  {
    Catch::cerr() << "Error parsing following command line: " << *std::prev( std::end( argv ) ) << std::endl;
  }
}

I would expect the parser to recognize this as command line argument error.

  • Catch version: v2.3
  • Operating System: No Operation System; bare metal
  • Compiler+version: gcc version 7.3.1 20180622 (release) [ARM/embedded-7-branch revision 261907] (GNU Tools for Arm Embedded Processors 7-2018-q2-update)
@TorstenRobitzki
Copy link
Author

Thanks a lot!

@horenmar
Copy link
Member

Thank @MaciejPatro 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants