-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Boost.Test learned the '--version' command line argument
- added '--version' that prints information equivalent to "--build_info" and then exits - prints the Boost.Test variant in use - moved the definition of the BOOST_TEST_INCLUDED macro on the top of the files such that CLA can safely print the Boost.Test variant in use - added smoke test - Module name printing should use BOOST_TEST_MODULE (and not BOOST_TEST_MAIN): adding compilation check
- Loading branch information
1 parent
cbbacca
commit 86bcffe
Showing
5 changed files
with
69 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,6 +99,7 @@ std::string WAIT_FOR_DEBUGGER = "wait_for_debugger"; | |
|
||
std::string HELP = "help"; | ||
std::string USAGE = "usage"; | ||
std::string VERSION = "version"; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
raffienficiaud
Author
Member
|
||
|
||
//____________________________________________________________________________// | ||
|
||
|
@@ -148,12 +149,11 @@ register_parameters( rt::parameters_store& store ) | |
"compiler, STL version and Boost version." | ||
)); | ||
|
||
/////////////////////////////////////////////// | ||
|
||
build_info.add_cla_id( "--", BUILD_INFO, "=" ); | ||
build_info.add_cla_id( "-", "i", " " ); | ||
store.add( build_info ); | ||
|
||
/////////////////////////////////////////////// | ||
|
||
rt::option catch_sys_errors( CATCH_SYS_ERRORS, ( | ||
rt::description = "Allows to switch between catching and ignoring system errors (signals).", | ||
|
@@ -635,6 +635,14 @@ register_parameters( rt::parameters_store& store ) | |
)); | ||
usage.add_cla_id( "-", "?", " " ); | ||
store.add( usage ); | ||
|
||
/////////////////////////////////////////////// | ||
|
||
rt::option version( VERSION, ( | ||
rt::description = "Prints Boost.Test version and exits." | ||
)); | ||
version.add_cla_id( "--", VERSION, " " ); | ||
store.add( version ); | ||
} | ||
|
||
static rt::arguments_store s_arguments_store; | ||
|
@@ -668,7 +676,11 @@ init( int& argc, char** argv ) | |
rt::finalize_arguments( s_parameters_store, s_arguments_store ); | ||
|
||
// Report help if requested | ||
if( runtime_config::get<bool>( USAGE ) ) { | ||
if( runtime_config::get<bool>( VERSION ) ) { | ||
parser->version( std::cerr ); | ||
BOOST_TEST_I_THROW( framework::nothing_to_test( boost::exit_success ) ); | ||
} | ||
else if( runtime_config::get<bool>( USAGE ) ) { | ||
parser->usage( std::cerr ); | ||
BOOST_TEST_I_THROW( framework::nothing_to_test( boost::exit_success ) ); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// (C) Copyright Raffi Enficiaud 2016. | ||
// Distributed under the Boost Software License, Version 1.0. | ||
// (See accompanying file LICENSE_1_0.txt or copy at | ||
// http://www.boost.org/LICENSE_1_0.txt) | ||
|
||
// See http://www.boost.org/libs/test for the library home page. | ||
|
||
// explicitely not using BOOST_TEST_MODULE to check the compilation of the | ||
// parser (prints the BOOST_TEST_MODULE if defined) | ||
// Also this should be the included version | ||
|
||
#define BOOST_TEST_MAIN | ||
#include <boost/test/included/unit_test.hpp> | ||
|
||
BOOST_AUTO_TEST_CASE( check ) | ||
{ | ||
BOOST_TEST( true ); | ||
} |
This variable clashes with the
#define VERSION
that is found in the vast majority of the projects built with the GNU Autotools.