mirror of
https://github.com/catchorg/Catch2.git
synced 2025-09-18 02:45:40 +02:00
Session::applyCommandLine overload on wchar_t (#1401)
* Session::applyCommandLine overload on wchar_t This allows users on Windows to use Catch::Session::applyCommandLine with wchar_t * arguments of application. With this change Session::run became templated so both char and wchar_t version have the same implementation.
This commit is contained in:

committed by
Martin Hořeňovský

parent
6b9ca0888a
commit
e1307016f0
@@ -26,13 +26,22 @@ namespace Catch {
|
||||
void libIdentify();
|
||||
|
||||
int applyCommandLine( int argc, char const * const * argv );
|
||||
#if defined(CATCH_CONFIG_WCHAR) && defined(WIN32) && defined(UNICODE)
|
||||
int applyCommandLine( int argc, wchar_t const * const * argv );
|
||||
#endif
|
||||
|
||||
void useConfigData( ConfigData const& configData );
|
||||
|
||||
int run( int argc, char* argv[] );
|
||||
#if defined(CATCH_CONFIG_WCHAR) && defined(WIN32) && defined(UNICODE)
|
||||
int run( int argc, wchar_t* const argv[] );
|
||||
#endif
|
||||
template<typename CharT>
|
||||
int run(int argc, CharT const * const argv[]) {
|
||||
if (m_startupExceptions)
|
||||
return 1;
|
||||
int returnCode = applyCommandLine(argc, argv);
|
||||
if (returnCode == 0)
|
||||
returnCode = run();
|
||||
return returnCode;
|
||||
}
|
||||
|
||||
int run();
|
||||
|
||||
clara::Parser const& cli() const;
|
||||
|
Reference in New Issue
Block a user