Ticket #6235: dry_run.patch

File dry_run.patch, 3.3 KB (added by Marvin Sielenkemper <m.sielenkemper@…>, 11 years ago)
  • boost/test/impl/unit_test_parameters.ipp

     
    160160std::string CATCH_SYS_ERRORS  = "catch_system_errors";
    161161std::string DETECT_FP_EXCEPT  = "detect_fp_exceptions";
    162162std::string DETECT_MEM_LEAKS  = "detect_memory_leaks";
     163std::string DRY_RUN           = "dry_run";
    163164std::string LOG_FORMAT        = "log_format";
    164165std::string LOG_LEVEL         = "log_level";
    165166std::string LOG_SINK          = "log_sink";
     
    181182    CATCH_SYS_ERRORS  , "BOOST_TEST_CATCH_SYSTEM_ERRORS",
    182183    DETECT_FP_EXCEPT  , "BOOST_TEST_DETECT_FP_EXCEPTIONS",
    183184    DETECT_MEM_LEAKS  , "BOOST_TEST_DETECT_MEMORY_LEAK",
     185    DRY_RUN           , "BOOST_TEST_DRY_RUN",
    184186    LOG_FORMAT        , "BOOST_TEST_LOG_FORMAT",
    185187    LOG_LEVEL         , "BOOST_TEST_LOG_LEVEL",
    186188    LOG_SINK          , "BOOST_TEST_LOG_SINK",
     
    267269          << cla::named_parameter<long>( DETECT_MEM_LEAKS )
    268270            - (cla::prefix = "--",cla::separator = "=",cla::guess_name,cla::optional,
    269271               cla::description = "Allows to switch between catching and ignoring memory leaks")
     272          << cla::dual_name_parameter<bool>(  DRY_RUN + "|n" )
     273            - (cla::prefix = "--|-",cla::separator = "=| ",cla::guess_name,cla::optional,
     274               cla::description = "Does not run the tests and assumes they all succeed")
    270275          << cla::dual_name_parameter<unit_test::output_format>( LOG_FORMAT + "|f" )
    271276            - (cla::prefix = "--|-",cla::separator = "=| ",cla::guess_name,cla::optional,
    272277               cla::description = "Specifies log format")
     
    514519
    515520//____________________________________________________________________________//
    516521
     522bool
     523dry_run()
     524{
     525    return retrieve_parameter( DRY_RUN, s_cla_parser, false );
     526}
     527
     528//____________________________________________________________________________//
     529
    517530} // namespace runtime_config
    518531
    519532} // namespace unit_test
  • boost/test/impl/unit_test_monitor.ipp

     
    6666        p_use_alt_stack.value           = runtime_config::use_alt_stack();
    6767        p_detect_fp_exceptions.value    = runtime_config::detect_fp_exceptions();
    6868
    69         execute( callback0<int>( zero_return_wrapper( tc.test_func() ) ) );
     69        if ( !runtime_config::dry_run() )
     70            execute( callback0<int>( zero_return_wrapper( tc.test_func() ) ) );
    7071    }
    7172    catch( execution_exception const& ex ) {
    7273        framework::exception_caught( ex );
  • boost/test/detail/unit_test_parameters.hpp

     
    5555BOOST_TEST_DECL std::ostream*            log_sink();
    5656BOOST_TEST_DECL long                     detect_memory_leaks();
    5757BOOST_TEST_DECL int                      random_seed();
     58BOOST_TEST_DECL bool                     dry_run();
    5859
    5960} // namespace runtime_config
    6061