Change capital variable names to lowercase #108

Closed
wants to merge 1 commit into
from
@@ -13,7 +13,7 @@ using namespace boost::unit_test;
BOOST_AUTO_TEST_CASE( test_case0 )
{
- if( runtime_config::get<log_level>( runtime_config::LOG_LEVEL ) < log_warnings )
+ if( runtime_config::get<log_level>( runtime_config::log_level_str ) < log_warnings )
unit_test_log.set_threshold_level( log_warnings );
BOOST_WARN( sizeof(int) > 4 );
@@ -62,7 +62,7 @@ test_phase_identifier()
void
compiler_log_formatter::log_start( std::ostream& output, counter_t test_cases_amount )
{
- m_color_output = runtime_config::get<bool>( runtime_config::COLOR_OUTPUT );
+ m_color_output = runtime_config::get<bool>( runtime_config::color_output_str );
if( test_cases_amount > 0 )
output << "Running " << test_cases_amount << " test "
@@ -396,7 +396,7 @@ parse_filters( test_unit_id master_tu_id, test_unit_id_list& tu_to_enable, test_
// 10. collect tu to enable and disable based on filters
bool had_selector_filter = false;
- std::vector<std::string> const& filters = runtime_config::get<std::vector<std::string> >( runtime_config::RUN_FILTERS );
+ std::vector<std::string> const& filters = runtime_config::get<std::vector<std::string> >( runtime_config::run_filters_str );
BOOST_TEST_FOREACH( const_string, filter, filters ) {
BOOST_TEST_SETUP_ASSERT( !filter.is_empty(), "Invalid filter specification" );
@@ -552,7 +552,7 @@ public:
test_unit_id_list tu_to_disable;
// 10. If there are any filters supplied, figure out lists of test units to enable/disable
- bool had_selector_filter = !runtime_config::get<std::vector<std::string> >( runtime_config::RUN_FILTERS ).empty() &&
+ bool had_selector_filter = !runtime_config::get<std::vector<std::string> >( runtime_config::run_filters_str ).empty() &&
parse_filters( master_tu_id, tu_to_enable, tu_to_disable );
// 20. Set the stage: either use default run status or disable all test units
@@ -657,7 +657,7 @@ public:
if( tu.p_type == TUT_SUITE ) {
test_suite const& ts = static_cast<test_suite const&>( tu );
- if( runtime_config::get<unsigned>( runtime_config::RANDOM_SEED ) == 0 ) {
+ if( runtime_config::get<unsigned>( runtime_config::random_seed_str ) == 0 ) {
typedef std::pair<counter_t,test_unit_id> value_type;
BOOST_TEST_FOREACH( value_type, chld, ts.m_ranked_children ) {
@@ -845,26 +845,26 @@ setup_loggers()
BOOST_TEST_I_TRY {
#ifdef BOOST_TEST_SUPPORT_TOKEN_ITERATOR
- bool has_combined_logger = runtime_config::has( runtime_config::COMBINED_LOGGER )
- && !runtime_config::get< std::vector<std::string> >( runtime_config::COMBINED_LOGGER ).empty();
+ bool has_combined_logger = runtime_config::has( runtime_config::combined_logger_str )
+ && !runtime_config::get< std::vector<std::string> >( runtime_config::combined_logger_str ).empty();
#else
bool has_combined_logger = false;
#endif
if( !has_combined_logger ) {
- unit_test_log.set_threshold_level( runtime_config::get<log_level>( runtime_config::LOG_LEVEL ) );
- const output_format format = runtime_config::get<output_format>( runtime_config::LOG_FORMAT );
+ unit_test_log.set_threshold_level( runtime_config::get<log_level>( runtime_config::log_level_str ) );
+ const output_format format = runtime_config::get<output_format>( runtime_config::log_format_str );
unit_test_log.set_format( format );
runtime_config::stream_holder& stream_logger = s_frk_state().m_log_sinks[format];
- if( runtime_config::has( runtime_config::LOG_SINK ) )
- stream_logger.setup( runtime_config::get<std::string>( runtime_config::LOG_SINK ) );
+ if( runtime_config::has( runtime_config::log_sink_str ) )
+ stream_logger.setup( runtime_config::get<std::string>( runtime_config::log_sink_str ) );
unit_test_log.set_stream( stream_logger.ref() );
}
else
{
- const std::vector<std::string>& v_output_format = runtime_config::get< std::vector<std::string> >( runtime_config::COMBINED_LOGGER ) ;
+ const std::vector<std::string>& v_output_format = runtime_config::get< std::vector<std::string> >( runtime_config::combined_logger_str ) ;
static const std::pair<const char*, log_level> all_log_levels[] = {
std::make_pair( "all" , log_successful_tests ),
@@ -1033,26 +1033,26 @@ init( init_unit_test_func init_func, int argc, char* argv[] )
impl::setup_loggers();
// 30. Set the desired report level, format and sink
- results_reporter::set_level( runtime_config::get<report_level>( runtime_config::REPORT_LEVEL ) );
- results_reporter::set_format( runtime_config::get<output_format>( runtime_config::REPORT_FORMAT ) );
+ results_reporter::set_level( runtime_config::get<report_level>( runtime_config::report_level_str ) );
+ results_reporter::set_format( runtime_config::get<output_format>( runtime_config::report_format_str ) );
- if( runtime_config::has( runtime_config::REPORT_SINK ) )
- s_frk_state().m_report_sink.setup( runtime_config::get<std::string>( runtime_config::REPORT_SINK ) );
+ if( runtime_config::has( runtime_config::report_sink_str ) )
+ s_frk_state().m_report_sink.setup( runtime_config::get<std::string>( runtime_config::report_sink_str ) );
results_reporter::set_stream( s_frk_state().m_report_sink.ref() );
// 40. Register default test observers
register_observer( results_collector );
register_observer( unit_test_log );
- if( runtime_config::get<bool>( runtime_config::SHOW_PROGRESS ) ) {
+ if( runtime_config::get<bool>( runtime_config::show_progress_str ) ) {
progress_monitor.set_stream( std::cout ); // defaults to stdout
register_observer( progress_monitor );
}
// 50. Set up memory leak detection
- unsigned long detect_mem_leak = runtime_config::get<unsigned long>( runtime_config::DETECT_MEM_LEAKS );
+ unsigned long detect_mem_leak = runtime_config::get<unsigned long>( runtime_config::detect_mem_leaks_str );
if( detect_mem_leak > 0 ) {
- debug::detect_memory_leaks( true, runtime_config::get<std::string>( runtime_config::REPORT_MEM_LEAKS ) );
+ debug::detect_memory_leaks( true, runtime_config::get<std::string>( runtime_config::report_mem_leaks_str ) );
debug::break_memory_alloc( (long)detect_mem_leak );
}
@@ -1408,7 +1408,7 @@ run( test_unit_id id, bool continue_test )
test_case_counter tcc;
traverse_test_tree( id, tcc );
- BOOST_TEST_SETUP_ASSERT( tcc.p_count != 0 , runtime_config::get<std::vector<std::string> >( runtime_config::RUN_FILTERS ).empty()
+ BOOST_TEST_SETUP_ASSERT( tcc.p_count != 0 , runtime_config::get<std::vector<std::string> >( runtime_config::run_filters_str ).empty()
? BOOST_TEST_L( "test tree is empty" )
: BOOST_TEST_L( "no test cases matching filter or all test cases were disabled" ) );
@@ -1428,7 +1428,7 @@ run( test_unit_id id, bool continue_test )
}
}
- unsigned seed = runtime_config::get<unsigned>( runtime_config::RANDOM_SEED );
+ unsigned seed = runtime_config::get<unsigned>( runtime_config::random_seed_str );
switch( seed ) {
case 0:
break;
@@ -83,7 +83,7 @@ void
plain_report_formatter::results_report_start( std::ostream& ostr )
{
m_indent = 0;
- m_color_output = runtime_config::get<bool>( runtime_config::COLOR_OUTPUT );
+ m_color_output = runtime_config::get<bool>( runtime_config::color_output_str );
ostr << '\n';
}
@@ -124,7 +124,7 @@ progress_monitor_impl& s_pm_impl() { static progress_monitor_impl the_inst; retu
void
progress_monitor_t::test_start( counter_t test_cases_amount )
{
- s_pm_impl().m_color_output = runtime_config::get<bool>( runtime_config::COLOR_OUTPUT );
+ s_pm_impl().m_color_output = runtime_config::get<bool>( runtime_config::color_output_str );
PM_SCOPED_COLOR();
@@ -168,7 +168,7 @@ unit_test_log_t::test_start( counter_t test_cases_amount )
current_logger_data.m_log_formatter->log_start( current_logger_data.stream(), test_cases_amount );
- if( runtime_config::get<bool>( runtime_config::BUILD_INFO ) )
+ if( runtime_config::get<bool>( runtime_config::build_info_str ) )
current_logger_data.m_log_formatter->log_build_info( current_logger_data.stream() );
current_logger_data.m_entry_in_progress = false;
@@ -188,7 +188,7 @@ unit_test_main( init_unit_test_func init_func, int argc, char* argv[] )
BOOST_TEST_I_TRY {
framework::init( init_func, argc, argv );
- if( runtime_config::get<bool>( runtime_config::WAIT_FOR_DEBUGGER ) ) {
+ if( runtime_config::get<bool>( runtime_config::wait_for_debugger_str ) ) {
results_reporter::get_stream() << "Press any key to continue..." << std::endl;
// getchar is defined as a macro in uClibc. Use parenthesis to fix
@@ -199,7 +199,7 @@ unit_test_main( init_unit_test_func init_func, int argc, char* argv[] )
framework::finalize_setup_phase();
- output_format list_cont = runtime_config::get<output_format>( runtime_config::LIST_CONTENT );
+ output_format list_cont = runtime_config::get<output_format>( runtime_config::list_content_str );
if( list_cont != unit_test::OF_INVALID ) {
if( list_cont == unit_test::OF_DOT ) {
ut_detail::dot_content_reporter reporter( results_reporter::get_stream() );
@@ -215,7 +215,7 @@ unit_test_main( init_unit_test_func init_func, int argc, char* argv[] )
return boost::exit_success;
}
- if( runtime_config::get<bool>( runtime_config::LIST_LABELS ) ) {
+ if( runtime_config::get<bool>( runtime_config::list_labels_str ) ) {
ut_detail::labels_collector collector;
traverse_test_tree( framework::master_test_suite().p_id, collector, true );
@@ -232,7 +232,7 @@ unit_test_main( init_unit_test_func init_func, int argc, char* argv[] )
results_reporter::make_report();
- result_code = !runtime_config::get<bool>( runtime_config::RESULT_CODE )
+ result_code = !runtime_config::get<bool>( runtime_config::result_code_str )
? boost::exit_success
: results_collector.results( framework::master_test_suite().p_id ).result_code();
}
@@ -37,11 +37,11 @@ unit_test_monitor_t::error_level
unit_test_monitor_t::execute_and_translate( boost::function<void ()> const& func, unsigned timeout )
{
BOOST_TEST_I_TRY {
- p_catch_system_errors.value = runtime_config::get<bool>( runtime_config::CATCH_SYS_ERRORS );
+ p_catch_system_errors.value = runtime_config::get<bool>( runtime_config::catch_sys_errors_str );
p_timeout.value = timeout;
- p_auto_start_dbg.value = runtime_config::get<bool>( runtime_config::AUTO_START_DBG );
- p_use_alt_stack.value = runtime_config::get<bool>( runtime_config::USE_ALT_STACK );
- p_detect_fp_exceptions.value = runtime_config::get<bool>( runtime_config::DETECT_FP_EXCEPT );
+ p_auto_start_dbg.value = runtime_config::get<bool>( runtime_config::auto_start_dbg_str );
+ p_use_alt_stack.value = runtime_config::get<bool>( runtime_config::use_alt_stack_str );
+ p_detect_fp_exceptions.value = runtime_config::get<bool>( runtime_config::detect_fp_except_str );
vexecute( func );
}
Oops, something went wrong.