mirror of
https://github.com/boostorg/test.git
synced 2026-01-31 08:42:13 +00:00
Merge branch 'local/loggers' into next-internal
This commit is contained in:
33
.gitignore
vendored
33
.gitignore
vendored
@@ -1,32 +1,15 @@
|
||||
doc/snippet/5mnstarter/build
|
||||
doc/html/BOOST_DATA_TEST_CASE.html
|
||||
doc/html/BOOST_DATA_TEST_CASE_IMPL.html
|
||||
doc/html/BOOST_DATA_TEST_CASE_NO_PARAMS.html
|
||||
doc/html/BOOST_DATA_TEST_CASE_PARAM.html
|
||||
doc/html/BOOST_DATA_TEST_CASE_PARAMS.html
|
||||
doc/html/BOOST_DATA_TEST_CASE_WITH_PARAMS.html
|
||||
doc/html/BOOST_DATA_TEST_CONTEXT.html
|
||||
doc/html/BOOST_LIB_NAME.html
|
||||
doc/html/BOOST_PARAM_CLASS_TEST_CASE.html
|
||||
doc/html/BOOST_PARAM_TEST_CASE.html
|
||||
doc/html/BOOST_TEST_SETUP_ASSERT.html
|
||||
doc/html/BOOST_TEST_SYS_ASSERT.html
|
||||
doc/html/TC_MAKE.html
|
||||
.vscode/
|
||||
doc/**/build
|
||||
doc/html/*.html
|
||||
doc/html/header/
|
||||
doc/html/boost/
|
||||
doc/html/boost_test/
|
||||
doc/html/index.html
|
||||
doc/html/boost*/
|
||||
doc/html/standalone_HTML.manifest
|
||||
doc/doxygen
|
||||
test_executable
|
||||
doc/snippet/dataset_1/build/
|
||||
doxygen_reference_generated_doc.xml
|
||||
standalonedoc_HTML.manifest
|
||||
doc/html/*.html
|
||||
doc/examples/build
|
||||
doc/doxygen
|
||||
build/tmp
|
||||
Master_Test_Suite*.xml
|
||||
smoke-ts-sink.*
|
||||
smoke-ts-sink-new-style.*
|
||||
smoke-ts-sink*.*
|
||||
build/tmp
|
||||
build/build_dir
|
||||
build/build_*/
|
||||
build/build_*
|
||||
|
||||
@@ -51,9 +51,6 @@ if(MSVC)
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# global path
|
||||
set(BOOST_TEST_ROOT_DIR ${BoostTest_SOURCE_DIR}/..)
|
||||
set(BOOST_ROOT_DIR ${BOOST_TEST_ROOT_DIR}/../..)
|
||||
@@ -96,7 +93,7 @@ set(BOOST_UTF_SRC
|
||||
${BOOST_TEST_ROOT_DIR}/src/unit_test_parameters.cpp
|
||||
${BOOST_TEST_ROOT_DIR}/src/xml_log_formatter.cpp
|
||||
${BOOST_TEST_ROOT_DIR}/src/xml_report_formatter.cpp
|
||||
)
|
||||
)
|
||||
|
||||
add_library(boost_test_framework
|
||||
STATIC
|
||||
@@ -120,7 +117,6 @@ target_include_directories(boost_test_framework_shared
|
||||
${BOOST_ROOT_DIR_ABS}/)
|
||||
set_target_properties(boost_test_framework_shared PROPERTIES FOLDER "UTF")
|
||||
|
||||
|
||||
####
|
||||
# Documentation files (files only, no target)
|
||||
file(GLOB_RECURSE
|
||||
@@ -131,162 +127,5 @@ add_custom_target(
|
||||
SOURCES ${BOOST_UTF_DOC_FILES})
|
||||
set_property(TARGET quickbook PROPERTY FOLDER "Documentation/")
|
||||
|
||||
|
||||
|
||||
####
|
||||
# Unit tests
|
||||
|
||||
# documentation tests
|
||||
file(GLOB_RECURSE
|
||||
BOOST_UTF_DOC_EXAMPLES
|
||||
CONFIGURE_DEPENDS
|
||||
${BOOST_TEST_ROOT_DIR}/doc/examples/*.cpp)
|
||||
|
||||
foreach(_h IN LISTS BOOST_UTF_DOC_EXAMPLES)
|
||||
get_filename_component(_hh ${_h} NAME_WE)
|
||||
add_executable(doc-${_hh} ${_h} ${BOOST_TEST_ROOT_DIR}/doc/examples/${_hh}.output)
|
||||
target_include_directories(doc-${_hh}
|
||||
PUBLIC
|
||||
${BOOST_TEST_ROOT_DIR}/include/
|
||||
${BOOST_ROOT_DIR_ABS}/)
|
||||
set_target_properties(doc-${_hh} PROPERTIES FOLDER "Doc examples")
|
||||
|
||||
add_test(NAME doc-${_hh}-test
|
||||
COMMAND doc-${_hh})
|
||||
get_filename_component(_ext ${_h} EXT)
|
||||
string(FIND ${_ext} "fail" _index_fail)
|
||||
if(${_index_fail} GREATER -1)
|
||||
message(STATUS "test ${_hh}.${_ext} = ${_index_fail}")
|
||||
set_tests_properties(doc-${_hh}-test PROPERTIES WILL_FAIL TRUE)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
|
||||
# unit tests folder
|
||||
set(BOOST_TEST_UNITTESTS_FOLDER ${BOOST_TEST_ROOT_DIR}/test)
|
||||
set(BOOST_TEST_EXAMPLES_FOLDER ${BOOST_TEST_ROOT_DIR}/example)
|
||||
|
||||
# datasets
|
||||
file(GLOB
|
||||
BOOST_TEST_UNITTESTS_DATASET
|
||||
CONFIGURE_DEPENDS
|
||||
${BOOST_TEST_UNITTESTS_FOLDER}/test-organization-ts/datasets-test/*.cpp
|
||||
${BOOST_TEST_UNITTESTS_FOLDER}/test-organization-ts/datasets-test/*.hpp)
|
||||
add_executable(boost_test_datasets ${BOOST_TEST_UNITTESTS_DATASET})
|
||||
target_include_directories(boost_test_datasets
|
||||
PUBLIC
|
||||
${BOOST_TEST_ROOT_DIR}/include/
|
||||
${BOOST_ROOT_DIR_ABS}/)
|
||||
target_link_libraries(boost_test_datasets boost_test_framework)
|
||||
#target_compile_definitions(boost_test_datasets PUBLIC "BOOST_TEST_DYN_LINK=0")
|
||||
set_target_properties(boost_test_datasets PROPERTIES FOLDER "Unit tests")
|
||||
add_test(NAME bt-unittest-dataset
|
||||
COMMAND boost_test_datasets)
|
||||
|
||||
|
||||
####
|
||||
# TS writing-test-ts
|
||||
|
||||
set(BOOST_UTF_TESTS_IND_FILES
|
||||
writing-test-ts
|
||||
execution_monitor-ts
|
||||
framework-ts
|
||||
usage-variants-ts
|
||||
utils-ts
|
||||
test-organization-ts
|
||||
smoke-ts
|
||||
)
|
||||
|
||||
|
||||
foreach(_ts IN LISTS BOOST_UTF_TESTS_IND_FILES)
|
||||
|
||||
message("parsing test suite ${_ts}")
|
||||
file(GLOB
|
||||
_boost_utf_current_tsuite
|
||||
${BOOST_TEST_UNITTESTS_FOLDER}/${_ts}/*.cpp)
|
||||
|
||||
|
||||
foreach(_h IN LISTS _boost_utf_current_tsuite)
|
||||
get_filename_component(_hh ${_h} ABSOLUTE)
|
||||
get_filename_component(_name ${_h} NAME_WE)
|
||||
file(RELATIVE_PATH _v ${BOOST_TEST_UNITTESTS_FOLDER} ${_hh})
|
||||
#get_filename_component(_v "${_v}" DIRECTORY)
|
||||
message("adding ${_ts}/${_name}")
|
||||
add_executable(${_name} ${_hh})
|
||||
target_link_libraries(${_name} PRIVATE boost_test_framework)
|
||||
set_target_properties(${_name} PROPERTIES FOLDER "Unit tests/${_ts}")
|
||||
add_test(NAME bt-unittest-${_name}
|
||||
COMMAND ${_name})
|
||||
endforeach()
|
||||
|
||||
unset(_boost_utf_current_tsuite)
|
||||
|
||||
endforeach() # test suite
|
||||
|
||||
|
||||
#
|
||||
# Example code
|
||||
#
|
||||
|
||||
set(LIST_EXAMPLES
|
||||
unit_test_example_01.cpp,shared,fail
|
||||
unit_test_example_02.cpp,static,fail
|
||||
unit_test_example_03.cpp,static,fail
|
||||
unit_test_example_04.cpp,shared,fail
|
||||
unit_test_example_05.cpp,shared,fail
|
||||
unit_test_example_06.cpp,shared,fail
|
||||
unit_test_example_07.cpp,shared,run
|
||||
unit_test_example_08.cpp,shared,run
|
||||
unit_test_example_09_1.cpp,unit_test_example_09_2.cpp,shared,run
|
||||
|
||||
unit_test_example_10.cpp,static,fail
|
||||
unit_test_example_11.cpp,static,fail
|
||||
unit_test_example_12.cpp,static,link
|
||||
unit_test_example_13.cpp,shared,run
|
||||
unit_test_example_15.cpp,shared,fail
|
||||
unit_test_example_16.cpp,shared,run
|
||||
|
||||
const_string_test.cpp,none,run
|
||||
named_param_example.cpp,none,run
|
||||
|
||||
external_main_example_1.cpp,shared,fail
|
||||
external_main_example_2.cpp,shared,fail
|
||||
external_main_example_3.cpp,none,fail
|
||||
filtering_example.cpp,static,fail
|
||||
)
|
||||
|
||||
foreach(_var IN LISTS LIST_EXAMPLES)
|
||||
string(REPLACE "," ";" _var_to_list "${_var}")
|
||||
list(REVERSE _var_to_list)
|
||||
list(GET _var_to_list 0 action)
|
||||
list(GET _var_to_list 1 boost_test_type)
|
||||
list(REMOVE_AT _var_to_list 0)
|
||||
list(REMOVE_AT _var_to_list 0)
|
||||
|
||||
list(GET _var_to_list 0 first_file)
|
||||
get_filename_component(_name_example "${first_file}" NAME_WE)
|
||||
|
||||
set(_list_files)
|
||||
foreach(_file IN LISTS _var_to_list)
|
||||
set(_list_files ${_list_files} ${BOOST_TEST_EXAMPLES_FOLDER}/${_file})
|
||||
endforeach()
|
||||
add_executable(${_name_example} ${_list_files})
|
||||
set_target_properties(${_name_example} PROPERTIES FOLDER "Examples")
|
||||
|
||||
if("${boost_test_type}" STREQUAL "shared")
|
||||
target_link_libraries(${_name_example} PRIVATE boost_test_framework_shared)
|
||||
elseif("${boost_test_type}" STREQUAL "static")
|
||||
target_link_libraries(${_name_example} PRIVATE boost_test_framework)
|
||||
elseif(NOT "${boost_test_type}" STREQUAL "none")
|
||||
message(FATAL_ERROR "Wrong action for example target '${_name_example}'")
|
||||
endif()
|
||||
|
||||
if("${action}" STREQUAL "run" OR "${action}" STREQUAL "run-fail")
|
||||
add_test(NAME bt-exampletest-${_name_example}
|
||||
COMMAND ${_name_example})
|
||||
|
||||
if("${action}" STREQUAL "run-fail")
|
||||
set_tests_properties(bt-exampletest-${_name_example} PROPERTIES WILL_FAIL TRUE)
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
add_subdirectory(${BOOST_TEST_ROOT_DIR}/test tmp_folders_tests)
|
||||
|
||||
@@ -991,6 +991,7 @@ setup_loggers()
|
||||
log_cleaner );
|
||||
}
|
||||
unit_test_log.set_stream( stream_logger.ref() );
|
||||
unit_test_log.configure();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1185,7 +1186,6 @@ init( init_unit_test_func init_func, int argc, char* argv[] )
|
||||
// 40. Register default test observers
|
||||
register_observer( results_collector );
|
||||
register_observer( unit_test_log );
|
||||
register_observer( framework_init_observer );
|
||||
|
||||
if( runtime_config::get<bool>( runtime_config::btrt_show_progress ) ) {
|
||||
progress_monitor.set_stream( std::cout ); // defaults to stdout
|
||||
@@ -1605,6 +1605,33 @@ struct swap_on_delete {
|
||||
Cont& m_c2;
|
||||
};
|
||||
|
||||
struct register_observer_helper {
|
||||
register_observer_helper(test_observer& observer)
|
||||
: m_observer(observer)
|
||||
{
|
||||
register_obs();
|
||||
}
|
||||
|
||||
~register_observer_helper() {
|
||||
if(m_registered)
|
||||
deregister_observer( m_observer );
|
||||
}
|
||||
|
||||
void deregister_obs() {
|
||||
m_registered = false;
|
||||
deregister_observer( m_observer );
|
||||
}
|
||||
|
||||
void register_obs() {
|
||||
m_registered = true;
|
||||
register_observer( m_observer );
|
||||
}
|
||||
|
||||
|
||||
test_observer& m_observer;
|
||||
bool m_registered;
|
||||
};
|
||||
|
||||
void
|
||||
run( test_unit_id id, bool continue_test )
|
||||
{
|
||||
@@ -1626,6 +1653,9 @@ run( test_unit_id id, bool continue_test )
|
||||
bool init_ok = true;
|
||||
const_string setup_error;
|
||||
|
||||
framework_init_observer_t local_init_observer;
|
||||
register_observer_helper init_observer_helper( local_init_observer );
|
||||
|
||||
if( call_start_finish ) {
|
||||
// indicates the framework that no test is in progress now if observers need to be notified
|
||||
impl::s_frk_state().m_test_in_progress = false;
|
||||
@@ -1633,13 +1663,13 @@ run( test_unit_id id, bool continue_test )
|
||||
BOOST_TEST_FOREACH( test_observer*, to, impl::s_frk_state().m_observers ) {
|
||||
BOOST_TEST_I_TRY {
|
||||
ut_detail::test_unit_id_restore restore_current_test_unit(impl::s_frk_state().m_curr_test_unit, id);
|
||||
unit_test_monitor_t::error_level result = unit_test_monitor.execute_and_translate( boost::bind( &test_observer::test_start, to, tcc.p_count ) );
|
||||
unit_test_monitor_t::error_level result = unit_test_monitor.execute_and_translate( boost::bind( &test_observer::test_start, to, tcc.p_count, id ) );
|
||||
if( init_ok ) {
|
||||
if( result != unit_test_monitor_t::test_ok ) {
|
||||
init_ok = false;
|
||||
}
|
||||
else {
|
||||
if( unit_test::framework_init_observer.has_failed() ) {
|
||||
if( local_init_observer.has_failed() ) {
|
||||
init_ok = false;
|
||||
}
|
||||
}
|
||||
@@ -1656,6 +1686,9 @@ run( test_unit_id id, bool continue_test )
|
||||
}
|
||||
}
|
||||
|
||||
// removing this observer as it should not be of any use for the tests
|
||||
init_observer_helper.deregister_obs();
|
||||
|
||||
if( init_ok ) {
|
||||
|
||||
// attaching the global fixtures to the main entry point
|
||||
@@ -1694,7 +1727,10 @@ run( test_unit_id id, bool continue_test )
|
||||
|
||||
results_reporter::make_report( INV_REPORT_LEVEL, id );
|
||||
|
||||
unit_test::framework_init_observer.clear();
|
||||
// reinstalling this observer
|
||||
init_observer_helper.register_obs();
|
||||
|
||||
local_init_observer.clear();
|
||||
if( call_start_finish ) {
|
||||
// indicates the framework that no test is in progress anymore if observers need to be notified
|
||||
// and this is a teardown, so assertions should not raise any exception otherwise an exception
|
||||
@@ -1709,7 +1745,7 @@ run( test_unit_id id, bool continue_test )
|
||||
impl::s_frk_state().m_test_in_progress = was_in_progress;
|
||||
|
||||
// propagates the init/teardown error if any
|
||||
BOOST_TEST_SETUP_ASSERT( init_ok && !unit_test::framework_init_observer.has_failed(), setup_error );
|
||||
BOOST_TEST_SETUP_ASSERT( init_ok && !local_init_observer.has_failed(), setup_error );
|
||||
}
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
@@ -126,7 +126,7 @@ BOOST_TEST_SINGLETON_CONS_IMPL(progress_monitor_t)
|
||||
//____________________________________________________________________________//
|
||||
|
||||
void
|
||||
progress_monitor_t::test_start( counter_t test_cases_amount )
|
||||
progress_monitor_t::test_start( counter_t test_cases_amount, test_unit_id )
|
||||
{
|
||||
s_pm_impl().m_color_output = runtime_config::get<bool>( runtime_config::btrt_color_output );
|
||||
|
||||
|
||||
@@ -145,6 +145,27 @@ struct results_collector_impl {
|
||||
|
||||
results_collector_impl& s_rc_impl() { static results_collector_impl the_inst; return the_inst; }
|
||||
|
||||
// deletes the entries of results_collector_impl
|
||||
class clear_subtree_result : public test_tree_visitor {
|
||||
public:
|
||||
clear_subtree_result(results_collector_impl& store)
|
||||
: m_store( store )
|
||||
{}
|
||||
|
||||
private:
|
||||
virtual bool visit( test_unit const& tu)
|
||||
{
|
||||
typedef std::map<test_unit_id,test_results>::iterator iterator;
|
||||
iterator found = m_store.m_results_store.find(tu.p_id);
|
||||
if(found != m_store.m_results_store.end()) {
|
||||
m_store.m_results_store.erase( found );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
results_collector_impl& m_store;
|
||||
};
|
||||
|
||||
} // local namespace
|
||||
|
||||
//____________________________________________________________________________//
|
||||
@@ -154,9 +175,11 @@ BOOST_TEST_SINGLETON_CONS_IMPL( results_collector_t )
|
||||
//____________________________________________________________________________//
|
||||
|
||||
void
|
||||
results_collector_t::test_start( counter_t )
|
||||
results_collector_t::test_start( counter_t, test_unit_id id )
|
||||
{
|
||||
s_rc_impl().m_results_store.clear();
|
||||
// deletes the results under id only
|
||||
clear_subtree_result tree_clear(s_rc_impl());
|
||||
traverse_test_tree( id, tree_clear );
|
||||
}
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
@@ -29,41 +29,16 @@ namespace unit_test {
|
||||
// ************** framework_init_observer_t ************** //
|
||||
// ************************************************************************** //
|
||||
|
||||
namespace {
|
||||
|
||||
struct test_init_observer_check {
|
||||
bool has_failure;
|
||||
|
||||
void clear()
|
||||
{
|
||||
has_failure = false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
test_init_observer_check& s_tioc_impl() { static test_init_observer_check the_inst; return the_inst; }
|
||||
|
||||
} // local namespace
|
||||
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
// singleton pattern
|
||||
BOOST_TEST_SINGLETON_CONS_IMPL(framework_init_observer_t)
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
void
|
||||
framework_init_observer_t::clear()
|
||||
{
|
||||
if(!framework::test_in_progress())
|
||||
s_tioc_impl().clear();
|
||||
m_has_failure = false;
|
||||
}
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
void
|
||||
framework_init_observer_t::test_start( counter_t )
|
||||
framework_init_observer_t::test_start( counter_t, test_unit_id )
|
||||
{
|
||||
clear();
|
||||
}
|
||||
@@ -73,11 +48,8 @@ framework_init_observer_t::test_start( counter_t )
|
||||
void
|
||||
framework_init_observer_t::assertion_result( unit_test::assertion_result ar )
|
||||
{
|
||||
test_init_observer_check& tr = s_tioc_impl();
|
||||
switch( ar ) {
|
||||
case AR_TRIGGERED: break;
|
||||
case AR_PASSED: break;
|
||||
case AR_FAILED: tr.has_failure = true; break;
|
||||
case AR_FAILED: m_has_failure = true; break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -88,14 +60,13 @@ framework_init_observer_t::assertion_result( unit_test::assertion_result ar )
|
||||
void
|
||||
framework_init_observer_t::exception_caught( execution_exception const& )
|
||||
{
|
||||
test_init_observer_check& tr = s_tioc_impl();
|
||||
tr.has_failure = true;
|
||||
m_has_failure = true;
|
||||
}
|
||||
|
||||
void
|
||||
framework_init_observer_t::test_aborted()
|
||||
{
|
||||
s_tioc_impl().has_failure = true;
|
||||
m_has_failure = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -104,7 +75,7 @@ framework_init_observer_t::test_aborted()
|
||||
bool
|
||||
framework_init_observer_t::has_failed() const
|
||||
{
|
||||
return s_tioc_impl().has_failure;
|
||||
return m_has_failure;
|
||||
}
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
@@ -131,11 +131,18 @@ struct unit_test_log_impl {
|
||||
typedef std::vector<unit_test_log_data_helper_impl> v_formatter_data_t;
|
||||
v_formatter_data_t m_log_formatter_data;
|
||||
|
||||
typedef std::vector<unit_test_log_data_helper_impl*> vp_formatter_data_t;
|
||||
vp_formatter_data_t m_active_log_formatter_data;
|
||||
|
||||
// entry data
|
||||
log_entry_data m_entry_data;
|
||||
|
||||
bool has_entry_in_progress() const {
|
||||
BOOST_TEST_FOREACH( unit_test_log_data_helper_impl const&, current_logger_data, m_log_formatter_data ) {
|
||||
for( vp_formatter_data_t::const_iterator it(m_active_log_formatter_data.begin()), ite(m_active_log_formatter_data.end());
|
||||
it < ite;
|
||||
++it)
|
||||
{
|
||||
unit_test_log_data_helper_impl& current_logger_data = **it;
|
||||
if( current_logger_data.m_entry_in_progress )
|
||||
return true;
|
||||
}
|
||||
@@ -155,30 +162,53 @@ struct unit_test_log_impl {
|
||||
|
||||
unit_test_log_impl& s_log_impl() { static unit_test_log_impl the_inst; return the_inst; }
|
||||
|
||||
// convenience
|
||||
typedef unit_test_log_impl::vp_formatter_data_t vp_logger_t;
|
||||
typedef unit_test_log_impl::v_formatter_data_t v_logger_t;
|
||||
|
||||
} // local namespace
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
BOOST_TEST_SINGLETON_CONS_IMPL( unit_test_log_t )
|
||||
|
||||
void
|
||||
unit_test_log_t::configure( )
|
||||
{
|
||||
// configure is not test_start:
|
||||
// test_start pushes the necessary log information when the test module is starting, and implies configure.
|
||||
// configure: should be called each time the set of loggers, stream or configuration is changed.
|
||||
s_log_impl().m_active_log_formatter_data.clear();
|
||||
for( unit_test_log_impl::v_formatter_data_t::iterator it(s_log_impl().m_log_formatter_data.begin()),
|
||||
ite(s_log_impl().m_log_formatter_data.end());
|
||||
it < ite;
|
||||
++it)
|
||||
{
|
||||
if( !it->m_enabled || it->get_log_level() == log_nothing )
|
||||
continue;
|
||||
|
||||
s_log_impl().m_active_log_formatter_data.push_back(&*it);
|
||||
it->m_entry_in_progress = false;
|
||||
}
|
||||
}
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
void
|
||||
unit_test_log_t::test_start( counter_t test_cases_amount )
|
||||
unit_test_log_t::test_start( counter_t test_cases_amount, test_unit_id )
|
||||
{
|
||||
BOOST_TEST_FOREACH( unit_test_log_data_helper_impl&, current_logger_data, s_log_impl().m_log_formatter_data ) {
|
||||
if( !current_logger_data.m_enabled || current_logger_data.get_log_level() == log_nothing )
|
||||
continue;
|
||||
configure();
|
||||
vp_logger_t& vloggers = s_log_impl().m_active_log_formatter_data;
|
||||
for( vp_logger_t::iterator it(vloggers.begin()), ite(vloggers.end()); it < ite; ++it)
|
||||
{
|
||||
unit_test_log_data_helper_impl& current_logger_data = **it;
|
||||
|
||||
current_logger_data.m_log_formatter->log_start( current_logger_data.stream(), test_cases_amount );
|
||||
|
||||
current_logger_data.m_log_formatter->log_build_info(
|
||||
current_logger_data.stream(),
|
||||
runtime_config::get<bool>( runtime_config::btrt_build_info ));
|
||||
|
||||
//current_logger_data.stream().flush();
|
||||
|
||||
current_logger_data.m_entry_in_progress = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,12 +217,11 @@ unit_test_log_t::test_start( counter_t test_cases_amount )
|
||||
void
|
||||
unit_test_log_t::test_finish()
|
||||
{
|
||||
BOOST_TEST_FOREACH( unit_test_log_data_helper_impl&, current_logger_data, s_log_impl().m_log_formatter_data ) {
|
||||
if( !current_logger_data.m_enabled || current_logger_data.get_log_level() == log_nothing )
|
||||
continue;
|
||||
|
||||
vp_logger_t& vloggers = s_log_impl().m_active_log_formatter_data;
|
||||
for( vp_logger_t::iterator it(vloggers.begin()), ite(vloggers.end()); it < ite; ++it)
|
||||
{
|
||||
unit_test_log_data_helper_impl& current_logger_data = **it;
|
||||
current_logger_data.m_log_formatter->log_finish( current_logger_data.stream() );
|
||||
|
||||
current_logger_data.stream().flush();
|
||||
}
|
||||
}
|
||||
@@ -212,8 +241,12 @@ unit_test_log_t::test_unit_start( test_unit const& tu )
|
||||
{
|
||||
if( s_log_impl().has_entry_in_progress() )
|
||||
*this << log::end();
|
||||
BOOST_TEST_FOREACH( unit_test_log_data_helper_impl&, current_logger_data, s_log_impl().m_log_formatter_data ) {
|
||||
if( !current_logger_data.m_enabled || current_logger_data.get_log_level() > log_test_units )
|
||||
|
||||
vp_logger_t& vloggers = s_log_impl().m_active_log_formatter_data;
|
||||
for( vp_logger_t::iterator it(vloggers.begin()), ite(vloggers.end()); it < ite; ++it)
|
||||
{
|
||||
unit_test_log_data_helper_impl& current_logger_data = **it;
|
||||
if( current_logger_data.get_log_level() > log_test_units )
|
||||
continue;
|
||||
current_logger_data.m_log_formatter->test_unit_start( current_logger_data.stream(), tu );
|
||||
}
|
||||
@@ -229,9 +262,11 @@ unit_test_log_t::test_unit_finish( test_unit const& tu, unsigned long elapsed )
|
||||
if( s_log_impl().has_entry_in_progress() )
|
||||
*this << log::end();
|
||||
|
||||
BOOST_TEST_FOREACH( unit_test_log_data_helper_impl&, current_logger_data, s_log_impl().m_log_formatter_data ) {
|
||||
|
||||
if( !current_logger_data.m_enabled || current_logger_data.get_log_level() > log_test_units )
|
||||
vp_logger_t& vloggers = s_log_impl().m_active_log_formatter_data;
|
||||
for( vp_logger_t::iterator it(vloggers.begin()), ite(vloggers.end()); it < ite; ++it)
|
||||
{
|
||||
unit_test_log_data_helper_impl& current_logger_data = **it;
|
||||
if( current_logger_data.get_log_level() > log_test_units )
|
||||
continue;
|
||||
|
||||
current_logger_data.m_log_formatter->test_unit_finish( current_logger_data.stream(), tu, elapsed );
|
||||
@@ -246,8 +281,11 @@ unit_test_log_t::test_unit_skipped( test_unit const& tu, const_string reason )
|
||||
if( s_log_impl().has_entry_in_progress() )
|
||||
*this << log::end();
|
||||
|
||||
BOOST_TEST_FOREACH( unit_test_log_data_helper_impl&, current_logger_data, s_log_impl().m_log_formatter_data ) {
|
||||
if( !current_logger_data.m_enabled || current_logger_data.get_log_level() > log_test_units )
|
||||
vp_logger_t& vloggers = s_log_impl().m_active_log_formatter_data;
|
||||
for( vp_logger_t::iterator it(vloggers.begin()), ite(vloggers.end()); it < ite; ++it)
|
||||
{
|
||||
unit_test_log_data_helper_impl& current_logger_data = **it;
|
||||
if( current_logger_data.get_log_level() > log_test_units )
|
||||
continue;
|
||||
|
||||
current_logger_data.m_log_formatter->test_unit_skipped( current_logger_data.stream(), tu, reason );
|
||||
@@ -260,8 +298,11 @@ unit_test_log_t::test_unit_aborted( test_unit const& tu )
|
||||
if( s_log_impl().has_entry_in_progress() )
|
||||
*this << log::end();
|
||||
|
||||
BOOST_TEST_FOREACH( unit_test_log_data_helper_impl&, current_logger_data, s_log_impl().m_log_formatter_data ) {
|
||||
if( !current_logger_data.m_enabled || current_logger_data.get_log_level() > log_test_units )
|
||||
vp_logger_t& vloggers = s_log_impl().m_active_log_formatter_data;
|
||||
for( vp_logger_t::iterator it(vloggers.begin()), ite(vloggers.end()); it < ite; ++it)
|
||||
{
|
||||
unit_test_log_data_helper_impl& current_logger_data = **it;
|
||||
if( current_logger_data.get_log_level() > log_test_units )
|
||||
continue;
|
||||
|
||||
current_logger_data.m_log_formatter->test_unit_aborted(current_logger_data.stream(), tu );
|
||||
@@ -274,8 +315,11 @@ unit_test_log_t::test_unit_timed_out( test_unit const& tu )
|
||||
if( s_log_impl().has_entry_in_progress() )
|
||||
*this << log::end();
|
||||
|
||||
BOOST_TEST_FOREACH( unit_test_log_data_helper_impl&, current_logger_data, s_log_impl().m_log_formatter_data ) {
|
||||
if( !current_logger_data.m_enabled || current_logger_data.get_log_level() > log_test_units )
|
||||
vp_logger_t& vloggers = s_log_impl().m_active_log_formatter_data;
|
||||
for( vp_logger_t::iterator it(vloggers.begin()), ite(vloggers.end()); it < ite; ++it)
|
||||
{
|
||||
unit_test_log_data_helper_impl& current_logger_data = **it;
|
||||
if( current_logger_data.get_log_level() > log_test_units )
|
||||
continue;
|
||||
|
||||
current_logger_data.m_log_formatter->test_unit_timed_out(current_logger_data.stream(), tu );
|
||||
@@ -295,9 +339,12 @@ unit_test_log_t::exception_caught( execution_exception const& ex )
|
||||
if( s_log_impl().has_entry_in_progress() )
|
||||
*this << log::end();
|
||||
|
||||
BOOST_TEST_FOREACH( unit_test_log_data_helper_impl&, current_logger_data, s_log_impl().m_log_formatter_data ) {
|
||||
vp_logger_t& vloggers = s_log_impl().m_active_log_formatter_data;
|
||||
for( vp_logger_t::iterator it(vloggers.begin()), ite(vloggers.end()); it < ite; ++it)
|
||||
{
|
||||
unit_test_log_data_helper_impl& current_logger_data = **it;
|
||||
|
||||
if( current_logger_data.m_enabled && l >= current_logger_data.get_log_level() ) {
|
||||
if( l >= current_logger_data.get_log_level() ) {
|
||||
|
||||
current_logger_data.m_log_formatter->log_exception_start( current_logger_data.stream(), s_log_impl().m_checkpoint_data, ex );
|
||||
|
||||
@@ -331,10 +378,11 @@ unit_test_log_t::operator<<( log::begin const& b )
|
||||
if( s_log_impl().has_entry_in_progress() )
|
||||
*this << log::end();
|
||||
|
||||
BOOST_TEST_FOREACH( unit_test_log_data_helper_impl&, current_logger_data, s_log_impl().m_log_formatter_data ) {
|
||||
if( current_logger_data.m_enabled ) {
|
||||
current_logger_data.m_stream_state_saver->restore();
|
||||
}
|
||||
vp_logger_t& vloggers = s_log_impl().m_active_log_formatter_data;
|
||||
for( vp_logger_t::iterator it(vloggers.begin()), ite(vloggers.end()); it < ite; ++it)
|
||||
{
|
||||
unit_test_log_data_helper_impl& current_logger_data = **it;
|
||||
current_logger_data.m_stream_state_saver->restore();
|
||||
}
|
||||
|
||||
s_log_impl().m_entry_data.clear();
|
||||
@@ -359,8 +407,11 @@ unit_test_log_t::operator<<( log::end const& )
|
||||
if( s_log_impl().has_entry_in_progress() ) {
|
||||
log_entry_context( s_log_impl().m_entry_data.m_level );
|
||||
|
||||
BOOST_TEST_FOREACH( unit_test_log_data_helper_impl&, current_logger_data, s_log_impl().m_log_formatter_data ) {
|
||||
if( current_logger_data.m_enabled && current_logger_data.m_entry_in_progress ) {
|
||||
vp_logger_t& vloggers = s_log_impl().m_active_log_formatter_data;
|
||||
for( vp_logger_t::iterator it(vloggers.begin()), ite(vloggers.end()); it < ite; ++it)
|
||||
{
|
||||
unit_test_log_data_helper_impl& current_logger_data = **it;
|
||||
if( current_logger_data.m_entry_in_progress ) {
|
||||
current_logger_data.m_log_formatter->log_entry_finish( current_logger_data.stream() );
|
||||
}
|
||||
current_logger_data.m_entry_in_progress = false;
|
||||
@@ -395,53 +446,42 @@ unit_test_log_t::operator()( log_level l )
|
||||
//____________________________________________________________________________//
|
||||
|
||||
bool
|
||||
unit_test_log_t::log_entry_start(output_format log_format)
|
||||
log_entry_start(unit_test_log_data_helper_impl ¤t_logger_data)
|
||||
{
|
||||
BOOST_TEST_FOREACH( unit_test_log_data_helper_impl&, current_logger_data, s_log_impl().m_log_formatter_data ) {
|
||||
|
||||
if( current_logger_data.m_format != log_format )
|
||||
continue;
|
||||
|
||||
if( current_logger_data.m_entry_in_progress )
|
||||
return true;
|
||||
|
||||
if( !current_logger_data.m_enabled )
|
||||
return false;
|
||||
|
||||
switch( s_log_impl().m_entry_data.m_level ) {
|
||||
case log_successful_tests:
|
||||
current_logger_data.m_log_formatter->log_entry_start( current_logger_data.stream(), s_log_impl().m_entry_data,
|
||||
unit_test_log_formatter::BOOST_UTL_ET_INFO );
|
||||
break;
|
||||
case log_messages:
|
||||
current_logger_data.m_log_formatter->log_entry_start( current_logger_data.stream(), s_log_impl().m_entry_data,
|
||||
unit_test_log_formatter::BOOST_UTL_ET_MESSAGE );
|
||||
break;
|
||||
case log_warnings:
|
||||
current_logger_data.m_log_formatter->log_entry_start( current_logger_data.stream(), s_log_impl().m_entry_data,
|
||||
unit_test_log_formatter::BOOST_UTL_ET_WARNING );
|
||||
break;
|
||||
case log_all_errors:
|
||||
case log_cpp_exception_errors:
|
||||
case log_system_errors:
|
||||
current_logger_data.m_log_formatter->log_entry_start( current_logger_data.stream(), s_log_impl().m_entry_data,
|
||||
unit_test_log_formatter::BOOST_UTL_ET_ERROR );
|
||||
break;
|
||||
case log_fatal_errors:
|
||||
current_logger_data.m_log_formatter->log_entry_start( current_logger_data.stream(), s_log_impl().m_entry_data,
|
||||
unit_test_log_formatter::BOOST_UTL_ET_FATAL_ERROR );
|
||||
break;
|
||||
case log_nothing:
|
||||
case log_test_units:
|
||||
case invalid_log_level:
|
||||
return false;
|
||||
}
|
||||
|
||||
current_logger_data.m_entry_in_progress = true;
|
||||
if( current_logger_data.m_entry_in_progress )
|
||||
return true;
|
||||
|
||||
switch( s_log_impl().m_entry_data.m_level ) {
|
||||
case log_successful_tests:
|
||||
current_logger_data.m_log_formatter->log_entry_start( current_logger_data.stream(), s_log_impl().m_entry_data,
|
||||
unit_test_log_formatter::BOOST_UTL_ET_INFO );
|
||||
break;
|
||||
case log_messages:
|
||||
current_logger_data.m_log_formatter->log_entry_start( current_logger_data.stream(), s_log_impl().m_entry_data,
|
||||
unit_test_log_formatter::BOOST_UTL_ET_MESSAGE );
|
||||
break;
|
||||
case log_warnings:
|
||||
current_logger_data.m_log_formatter->log_entry_start( current_logger_data.stream(), s_log_impl().m_entry_data,
|
||||
unit_test_log_formatter::BOOST_UTL_ET_WARNING );
|
||||
break;
|
||||
case log_all_errors:
|
||||
case log_cpp_exception_errors:
|
||||
case log_system_errors:
|
||||
current_logger_data.m_log_formatter->log_entry_start( current_logger_data.stream(), s_log_impl().m_entry_data,
|
||||
unit_test_log_formatter::BOOST_UTL_ET_ERROR );
|
||||
break;
|
||||
case log_fatal_errors:
|
||||
current_logger_data.m_log_formatter->log_entry_start( current_logger_data.stream(), s_log_impl().m_entry_data,
|
||||
unit_test_log_formatter::BOOST_UTL_ET_FATAL_ERROR );
|
||||
break;
|
||||
case log_nothing:
|
||||
case log_test_units:
|
||||
case invalid_log_level:
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
current_logger_data.m_entry_in_progress = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
//____________________________________________________________________________//
|
||||
@@ -449,8 +489,15 @@ unit_test_log_t::log_entry_start(output_format log_format)
|
||||
unit_test_log_t&
|
||||
unit_test_log_t::operator<<( const_string value )
|
||||
{
|
||||
BOOST_TEST_FOREACH( unit_test_log_data_helper_impl&, current_logger_data, s_log_impl().m_log_formatter_data ) {
|
||||
if( current_logger_data.m_enabled && s_log_impl().m_entry_data.m_level >= current_logger_data.get_log_level() && !value.empty() && log_entry_start(current_logger_data.m_format) )
|
||||
if(value.empty()) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
vp_logger_t& vloggers = s_log_impl().m_active_log_formatter_data;
|
||||
for( vp_logger_t::iterator it(vloggers.begin()), ite(vloggers.end()); it < ite; ++it)
|
||||
{
|
||||
unit_test_log_data_helper_impl& current_logger_data = **it;
|
||||
if( s_log_impl().m_entry_data.m_level >= current_logger_data.get_log_level() && log_entry_start(current_logger_data) )
|
||||
current_logger_data.m_log_formatter->log_entry_value( current_logger_data.stream(), value );
|
||||
|
||||
}
|
||||
@@ -462,9 +509,16 @@ unit_test_log_t::operator<<( const_string value )
|
||||
unit_test_log_t&
|
||||
unit_test_log_t::operator<<( lazy_ostream const& value )
|
||||
{
|
||||
BOOST_TEST_FOREACH( unit_test_log_data_helper_impl&, current_logger_data, s_log_impl().m_log_formatter_data ) {
|
||||
if( current_logger_data.m_enabled && s_log_impl().m_entry_data.m_level >= current_logger_data.get_log_level() && !value.empty() ) {
|
||||
if( log_entry_start(current_logger_data.m_format) ) {
|
||||
if(value.empty()) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
vp_logger_t& vloggers = s_log_impl().m_active_log_formatter_data;
|
||||
for( vp_logger_t::iterator it(vloggers.begin()), ite(vloggers.end()); it < ite; ++it)
|
||||
{
|
||||
unit_test_log_data_helper_impl& current_logger_data = **it;
|
||||
if( s_log_impl().m_entry_data.m_level >= current_logger_data.get_log_level() ) {
|
||||
if( log_entry_start(current_logger_data) ) {
|
||||
current_logger_data.m_log_formatter->log_entry_value( current_logger_data.stream(), value );
|
||||
}
|
||||
}
|
||||
@@ -483,25 +537,26 @@ unit_test_log_t::log_entry_context( log_level l )
|
||||
|
||||
const_string frame;
|
||||
|
||||
BOOST_TEST_FOREACH( unit_test_log_data_helper_impl&, current_logger_data, s_log_impl().m_log_formatter_data ) {
|
||||
if( current_logger_data.m_enabled ) {
|
||||
current_logger_data.m_log_formatter->entry_context_start( current_logger_data.stream(), l );
|
||||
}
|
||||
vp_logger_t& vloggers = s_log_impl().m_active_log_formatter_data;
|
||||
for( vp_logger_t::iterator it(vloggers.begin()), ite(vloggers.end()); it < ite; ++it)
|
||||
{
|
||||
unit_test_log_data_helper_impl& current_logger_data = **it;
|
||||
current_logger_data.m_log_formatter->entry_context_start( current_logger_data.stream(), l );
|
||||
}
|
||||
|
||||
while( !(frame=context.next()).is_empty() )
|
||||
{
|
||||
BOOST_TEST_FOREACH( unit_test_log_data_helper_impl&, current_logger_data, s_log_impl().m_log_formatter_data ) {
|
||||
if( current_logger_data.m_enabled ) {
|
||||
current_logger_data.m_log_formatter->log_entry_context( current_logger_data.stream(), l, frame );
|
||||
}
|
||||
for( vp_logger_t::iterator it(vloggers.begin()), ite(vloggers.end()); it < ite; ++it)
|
||||
{
|
||||
unit_test_log_data_helper_impl& current_logger_data = **it;
|
||||
current_logger_data.m_log_formatter->log_entry_context( current_logger_data.stream(), l, frame );
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_TEST_FOREACH( unit_test_log_data_helper_impl&, current_logger_data, s_log_impl().m_log_formatter_data ) {
|
||||
if( current_logger_data.m_enabled ) {
|
||||
current_logger_data.m_log_formatter->entry_context_finish( current_logger_data.stream(), l );
|
||||
}
|
||||
for( vp_logger_t::iterator it(vloggers.begin()), ite(vloggers.end()); it < ite; ++it)
|
||||
{
|
||||
unit_test_log_data_helper_impl& current_logger_data = **it;
|
||||
current_logger_data.m_log_formatter->entry_context_finish( current_logger_data.stream(), l );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -521,7 +576,11 @@ unit_test_log_t::set_stream( std::ostream& str )
|
||||
if( s_log_impl().has_entry_in_progress() )
|
||||
return;
|
||||
|
||||
BOOST_TEST_FOREACH( unit_test_log_data_helper_impl&, current_logger_data, s_log_impl().m_log_formatter_data ) {
|
||||
v_logger_t& vloggers = s_log_impl().m_log_formatter_data;
|
||||
for( v_logger_t::iterator it(vloggers.begin()), ite(vloggers.end()); it < ite; ++it)
|
||||
{
|
||||
unit_test_log_data_helper_impl& current_logger_data = *it;
|
||||
|
||||
current_logger_data.m_stream = &str;
|
||||
current_logger_data.m_stream_state_saver.reset( new io_saver_type( str ) );
|
||||
}
|
||||
@@ -535,7 +594,10 @@ unit_test_log_t::set_stream( output_format log_format, std::ostream& str )
|
||||
if( s_log_impl().has_entry_in_progress() )
|
||||
return;
|
||||
|
||||
BOOST_TEST_FOREACH( unit_test_log_data_helper_impl&, current_logger_data, s_log_impl().m_log_formatter_data ) {
|
||||
v_logger_t& vloggers = s_log_impl().m_log_formatter_data;
|
||||
for( v_logger_t::iterator it(vloggers.begin()), ite(vloggers.end()); it < ite; ++it)
|
||||
{
|
||||
unit_test_log_data_helper_impl& current_logger_data = *it;
|
||||
if( current_logger_data.m_format == log_format) {
|
||||
current_logger_data.m_stream = &str;
|
||||
current_logger_data.m_stream_state_saver.reset( new io_saver_type( str ) );
|
||||
@@ -547,7 +609,10 @@ unit_test_log_t::set_stream( output_format log_format, std::ostream& str )
|
||||
std::ostream*
|
||||
unit_test_log_t::get_stream( output_format log_format ) const
|
||||
{
|
||||
BOOST_TEST_FOREACH( unit_test_log_data_helper_impl&, current_logger_data, s_log_impl().m_log_formatter_data ) {
|
||||
v_logger_t& vloggers = s_log_impl().m_log_formatter_data;
|
||||
for( v_logger_t::iterator it(vloggers.begin()), ite(vloggers.end()); it < ite; ++it)
|
||||
{
|
||||
unit_test_log_data_helper_impl& current_logger_data = *it;
|
||||
if( current_logger_data.m_format == log_format) {
|
||||
return current_logger_data.m_stream;
|
||||
}
|
||||
@@ -557,31 +622,43 @@ unit_test_log_t::get_stream( output_format log_format ) const
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
void
|
||||
log_level
|
||||
unit_test_log_t::set_threshold_level( log_level lev )
|
||||
{
|
||||
if( s_log_impl().has_entry_in_progress() || lev == invalid_log_level )
|
||||
return;
|
||||
return invalid_log_level;
|
||||
|
||||
BOOST_TEST_FOREACH( unit_test_log_data_helper_impl&, current_logger_data, s_log_impl().m_log_formatter_data ) {
|
||||
log_level ret = log_nothing;
|
||||
v_logger_t& vloggers = s_log_impl().m_log_formatter_data;
|
||||
for( v_logger_t::iterator it(vloggers.begin()), ite(vloggers.end()); it < ite; ++it)
|
||||
{
|
||||
unit_test_log_data_helper_impl& current_logger_data = *it;
|
||||
ret = (std::min)(ret, current_logger_data.m_log_formatter->get_log_level());
|
||||
current_logger_data.m_log_formatter->set_log_level( lev );
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
void
|
||||
log_level
|
||||
unit_test_log_t::set_threshold_level( output_format log_format, log_level lev )
|
||||
{
|
||||
if( s_log_impl().has_entry_in_progress() || lev == invalid_log_level )
|
||||
return;
|
||||
return invalid_log_level;
|
||||
|
||||
BOOST_TEST_FOREACH( unit_test_log_data_helper_impl&, current_logger_data, s_log_impl().m_log_formatter_data ) {
|
||||
log_level ret = log_nothing;
|
||||
v_logger_t& vloggers = s_log_impl().m_log_formatter_data;
|
||||
for( v_logger_t::iterator it(vloggers.begin()), ite(vloggers.end()); it < ite; ++it)
|
||||
{
|
||||
unit_test_log_data_helper_impl& current_logger_data = *it;
|
||||
if( current_logger_data.m_format == log_format) {
|
||||
ret = current_logger_data.m_log_formatter->get_log_level();
|
||||
current_logger_data.m_log_formatter->set_log_level( lev );
|
||||
break;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
//____________________________________________________________________________//
|
||||
@@ -592,7 +669,10 @@ unit_test_log_t::set_format( output_format log_format )
|
||||
if( s_log_impl().has_entry_in_progress() )
|
||||
return;
|
||||
|
||||
BOOST_TEST_FOREACH( unit_test_log_data_helper_impl&, current_logger_data, s_log_impl().m_log_formatter_data ) {
|
||||
v_logger_t& vloggers = s_log_impl().m_log_formatter_data;
|
||||
for( v_logger_t::iterator it(vloggers.begin()), ite(vloggers.end()); it < ite; ++it)
|
||||
{
|
||||
unit_test_log_data_helper_impl& current_logger_data = *it;
|
||||
current_logger_data.m_enabled = current_logger_data.m_format == log_format;
|
||||
}
|
||||
}
|
||||
@@ -605,7 +685,10 @@ unit_test_log_t::add_format( output_format log_format )
|
||||
if( s_log_impl().has_entry_in_progress() )
|
||||
return;
|
||||
|
||||
BOOST_TEST_FOREACH( unit_test_log_data_helper_impl&, current_logger_data, s_log_impl().m_log_formatter_data ) {
|
||||
v_logger_t& vloggers = s_log_impl().m_log_formatter_data;
|
||||
for( v_logger_t::iterator it(vloggers.begin()), ite(vloggers.end()); it < ite; ++it)
|
||||
{
|
||||
unit_test_log_data_helper_impl& current_logger_data = *it;
|
||||
if( current_logger_data.m_format == log_format) {
|
||||
current_logger_data.m_enabled = true;
|
||||
break;
|
||||
@@ -617,7 +700,11 @@ unit_test_log_t::add_format( output_format log_format )
|
||||
|
||||
unit_test_log_formatter*
|
||||
unit_test_log_t::get_formatter( output_format log_format ) {
|
||||
BOOST_TEST_FOREACH( unit_test_log_data_helper_impl&, current_logger_data, s_log_impl().m_log_formatter_data ) {
|
||||
|
||||
v_logger_t& vloggers = s_log_impl().m_log_formatter_data;
|
||||
for( v_logger_t::iterator it(vloggers.begin()), ite(vloggers.end()); it < ite; ++it)
|
||||
{
|
||||
unit_test_log_data_helper_impl& current_logger_data = *it;
|
||||
if( current_logger_data.m_format == log_format) {
|
||||
return current_logger_data.m_log_formatter.get();
|
||||
}
|
||||
@@ -630,10 +717,8 @@ void
|
||||
unit_test_log_t::add_formatter( unit_test_log_formatter* the_formatter )
|
||||
{
|
||||
// remove only user defined logger
|
||||
for(unit_test_log_impl::v_formatter_data_t::iterator it(s_log_impl().m_log_formatter_data.begin()),
|
||||
ite(s_log_impl().m_log_formatter_data.end());
|
||||
it != ite;
|
||||
++it)
|
||||
v_logger_t& vloggers = s_log_impl().m_log_formatter_data;
|
||||
for(v_logger_t::iterator it(vloggers.begin()), ite(vloggers.end()); it < ite; ++it)
|
||||
{
|
||||
if( it->m_format == OF_CUSTOM_LOGGER) {
|
||||
s_log_impl().m_log_formatter_data.erase(it);
|
||||
@@ -642,21 +727,23 @@ unit_test_log_t::add_formatter( unit_test_log_formatter* the_formatter )
|
||||
}
|
||||
|
||||
if( the_formatter ) {
|
||||
s_log_impl().m_log_formatter_data.push_back( unit_test_log_data_helper_impl(the_formatter, OF_CUSTOM_LOGGER, true) );
|
||||
s_log_impl().m_active_log_formatter_data.clear(); // otherwise dandling references
|
||||
vloggers.push_back( unit_test_log_data_helper_impl(the_formatter, OF_CUSTOM_LOGGER, true) );
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
unit_test_log_t::set_formatter( unit_test_log_formatter* the_formatter )
|
||||
{
|
||||
if( s_log_impl().has_entry_in_progress() )
|
||||
return;
|
||||
|
||||
// remove only user defined logger
|
||||
log_level current_level = invalid_log_level;
|
||||
std::ostream *current_stream = 0;
|
||||
output_format previous_format = OF_INVALID;
|
||||
for(unit_test_log_impl::v_formatter_data_t::iterator it(s_log_impl().m_log_formatter_data.begin()),
|
||||
ite(s_log_impl().m_log_formatter_data.end());
|
||||
it != ite;
|
||||
++it)
|
||||
v_logger_t& vloggers = s_log_impl().m_log_formatter_data;
|
||||
for(v_logger_t::iterator it(vloggers.begin()), ite(vloggers.end()); it < ite; ++it)
|
||||
{
|
||||
if( it->m_enabled ) {
|
||||
if( current_level == invalid_log_level || it->m_format < previous_format || it->m_format == OF_CUSTOM_LOGGER) {
|
||||
@@ -673,6 +760,8 @@ unit_test_log_t::set_formatter( unit_test_log_formatter* the_formatter )
|
||||
set_threshold_level(OF_CUSTOM_LOGGER, current_level);
|
||||
set_stream(OF_CUSTOM_LOGGER, *current_stream);
|
||||
}
|
||||
|
||||
configure();
|
||||
}
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
@@ -34,7 +34,7 @@ class BOOST_TEST_DECL progress_monitor_t : public test_observer {
|
||||
public:
|
||||
/// @name Test observer interface
|
||||
/// @{
|
||||
virtual void test_start( counter_t test_cases_amount );
|
||||
virtual void test_start( counter_t test_cases_amount, test_unit_id );
|
||||
virtual void test_aborted();
|
||||
|
||||
virtual void test_unit_finish( test_unit const&, unsigned long );
|
||||
|
||||
@@ -121,7 +121,7 @@ public:
|
||||
class BOOST_TEST_DECL results_collector_t : public test_observer {
|
||||
public:
|
||||
|
||||
virtual void test_start( counter_t );
|
||||
virtual void test_start( counter_t, test_unit_id );
|
||||
|
||||
virtual void test_unit_start( test_unit const& );
|
||||
virtual void test_unit_finish( test_unit const&, unsigned long );
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace unit_test {
|
||||
class BOOST_TEST_DECL framework_init_observer_t : public test_observer {
|
||||
public:
|
||||
|
||||
virtual void test_start( counter_t );
|
||||
virtual void test_start( counter_t, test_unit_id );
|
||||
|
||||
virtual void assertion_result( unit_test::assertion_result );
|
||||
virtual void exception_caught( execution_exception const& );
|
||||
@@ -47,12 +47,10 @@ public:
|
||||
/// Indicates if a failure has been recorded so far
|
||||
bool has_failed( ) const;
|
||||
|
||||
/// Singleton pattern
|
||||
BOOST_TEST_SINGLETON_CONS( framework_init_observer_t )
|
||||
private:
|
||||
bool m_has_failure;
|
||||
};
|
||||
|
||||
BOOST_TEST_SINGLETON_INST( framework_init_observer )
|
||||
|
||||
} // namespace unit_test
|
||||
} // namespace boost
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ struct global_configuration_impl : public global_configuration {
|
||||
}
|
||||
|
||||
// test observer interface
|
||||
virtual void test_start( counter_t ) {
|
||||
virtual void test_start( counter_t, test_unit_id ) {
|
||||
m_configuration_observer = new F;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,8 @@ public:
|
||||
//!
|
||||
//! @param[in] number_of_test_cases indicates the number of test cases. Only active
|
||||
//! test cases are taken into account.
|
||||
virtual void test_start( counter_t /* number_of_test_cases */ ) {}
|
||||
//! @param[in] root_test_unit_id the ID root of the test tree currently being tested
|
||||
virtual void test_start( counter_t /* number_of_test_cases */, test_unit_id root_test_unit_id ) {}
|
||||
|
||||
//! Called after the framework ends executing the test cases
|
||||
//!
|
||||
|
||||
@@ -111,7 +111,7 @@ private:
|
||||
class BOOST_TEST_DECL unit_test_log_t : public test_observer {
|
||||
public:
|
||||
// test_observer interface implementation
|
||||
virtual void test_start( counter_t test_cases_amount );
|
||||
virtual void test_start( counter_t test_cases_amount, test_unit_id );
|
||||
virtual void test_finish();
|
||||
virtual void test_aborted();
|
||||
|
||||
@@ -147,13 +147,15 @@ public:
|
||||
//! Sets the threshold level for all loggers/formatters.
|
||||
//!
|
||||
//! This will override the log level of all loggers, whether enabled or not.
|
||||
void set_threshold_level( log_level );
|
||||
//! @return the minimum of the previous log level of all formatters (new in Boost 1.73)
|
||||
log_level set_threshold_level( log_level );
|
||||
|
||||
//! Sets the threshold/log level of a specific format
|
||||
//!
|
||||
//! @note Has no effect if the specified format is not found
|
||||
//! @par Since Boost 1.62
|
||||
void set_threshold_level( output_format, log_level );
|
||||
//! @return the previous log level of the corresponding formatter (new in Boost 1.73)
|
||||
log_level set_threshold_level( output_format, log_level );
|
||||
|
||||
//! Add a format to the set of loggers
|
||||
//!
|
||||
@@ -215,9 +217,10 @@ public:
|
||||
|
||||
ut_detail::entry_value_collector operator()( log_level ); // initiate entry collection
|
||||
|
||||
//! Prepares internal states after log levels, streams and format has been set up
|
||||
void configure();
|
||||
private:
|
||||
// Implementation helpers
|
||||
bool log_entry_start(output_format log_format);
|
||||
void log_entry_context( log_level l );
|
||||
void clear_entry_context();
|
||||
|
||||
|
||||
187
test/CMakeLists.txt
Normal file
187
test/CMakeLists.txt
Normal file
@@ -0,0 +1,187 @@
|
||||
####
|
||||
# Unit tests for the Unit Test Framework library
|
||||
|
||||
if(NOT DEFINED BOOST_TEST_ROOT_DIR)
|
||||
message(FATAL_ERROR "Please use this file from the main CMakeLists.txt from the build/ folder")
|
||||
endif()
|
||||
|
||||
if(NOT TARGET boost_test_framework OR NOT TARGET boost_test_framework_shared)
|
||||
message(FATAL_ERROR "Please use this file from the main CMakeLists.txt from the build/ folder")
|
||||
endif()
|
||||
|
||||
# unit tests folder
|
||||
set(BOOST_TEST_UNITTESTS_FOLDER ${BOOST_TEST_ROOT_DIR}/test)
|
||||
set(BOOST_TEST_EXAMPLES_FOLDER ${BOOST_TEST_ROOT_DIR}/example)
|
||||
|
||||
|
||||
# documentation tests
|
||||
file(GLOB_RECURSE
|
||||
BOOST_UTF_DOC_EXAMPLES
|
||||
CONFIGURE_DEPENDS
|
||||
${BOOST_TEST_ROOT_DIR}/doc/examples/*.cpp)
|
||||
|
||||
foreach(_h IN LISTS BOOST_UTF_DOC_EXAMPLES)
|
||||
get_filename_component(_hh ${_h} NAME_WE)
|
||||
add_executable(doc-${_hh}
|
||||
${_h}
|
||||
${BOOST_TEST_ROOT_DIR}/doc/examples/${_hh}.output)
|
||||
set_target_properties(doc-${_hh}
|
||||
PROPERTIES
|
||||
FOLDER "Doc examples"
|
||||
VS_DEBUGGER_WORKING_DIRECTORY ${BOOST_TEST_UNITTESTS_FOLDER})
|
||||
target_include_directories(doc-${_hh}
|
||||
PUBLIC
|
||||
${BOOST_TEST_ROOT_DIR}/include/
|
||||
${BOOST_ROOT_DIR_ABS}/)
|
||||
|
||||
add_test(NAME doc-${_hh}-test
|
||||
COMMAND doc-${_hh})
|
||||
get_filename_component(_ext ${_h} EXT)
|
||||
string(FIND ${_ext} "fail" _index_fail)
|
||||
if(${_index_fail} GREATER -1)
|
||||
set_tests_properties(doc-${_hh}-test
|
||||
PROPERTIES
|
||||
WILL_FAIL TRUE)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
|
||||
# datasets
|
||||
file(GLOB
|
||||
BOOST_TEST_UNITTESTS_DATASET
|
||||
CONFIGURE_DEPENDS
|
||||
${BOOST_TEST_UNITTESTS_FOLDER}/test-organization-ts/datasets-test/*.cpp
|
||||
${BOOST_TEST_UNITTESTS_FOLDER}/test-organization-ts/datasets-test/*.hpp)
|
||||
add_executable(boost_test_datasets ${BOOST_TEST_UNITTESTS_DATASET})
|
||||
set_target_properties(boost_test_datasets
|
||||
PROPERTIES
|
||||
FOLDER "Unit tests"
|
||||
VS_DEBUGGER_WORKING_DIRECTORY ${BOOST_TEST_UNITTESTS_FOLDER})
|
||||
target_include_directories(boost_test_datasets
|
||||
PUBLIC
|
||||
${BOOST_TEST_ROOT_DIR}/include/
|
||||
${BOOST_ROOT_DIR_ABS}/)
|
||||
target_link_libraries(boost_test_datasets boost_test_framework)
|
||||
add_test(NAME bt-unittest-dataset
|
||||
COMMAND boost_test_datasets)
|
||||
|
||||
|
||||
####
|
||||
# TS writing-test-ts
|
||||
|
||||
set(BOOST_UTF_TESTS_FIND_FILES
|
||||
writing-test-ts
|
||||
execution_monitor-ts
|
||||
framework-ts
|
||||
usage-variants-ts
|
||||
utils-ts
|
||||
test-organization-ts
|
||||
smoke-ts
|
||||
)
|
||||
|
||||
|
||||
foreach(_ts IN LISTS BOOST_UTF_TESTS_FIND_FILES)
|
||||
|
||||
file(GLOB
|
||||
_boost_utf_current_tsuite
|
||||
${BOOST_TEST_UNITTESTS_FOLDER}/${_ts}/*.cpp)
|
||||
|
||||
foreach(_h IN LISTS _boost_utf_current_tsuite)
|
||||
get_filename_component(_hh ${_h} ABSOLUTE)
|
||||
get_filename_component(_name ${_h} NAME_WE)
|
||||
file(RELATIVE_PATH _v ${BOOST_TEST_UNITTESTS_FOLDER} ${_hh})
|
||||
|
||||
add_executable(${_name} ${_hh})
|
||||
set_target_properties(${_name}
|
||||
PROPERTIES
|
||||
FOLDER "Unit tests/${_ts}"
|
||||
VS_DEBUGGER_WORKING_DIRECTORY ${BOOST_TEST_UNITTESTS_FOLDER})
|
||||
target_link_libraries(${_name}
|
||||
PRIVATE
|
||||
boost_test_framework) # inaccurate
|
||||
|
||||
add_test(NAME bt-unittest-${_name}
|
||||
COMMAND ${_name})
|
||||
endforeach()
|
||||
|
||||
unset(_boost_utf_current_tsuite)
|
||||
|
||||
endforeach() # test suite
|
||||
|
||||
|
||||
#
|
||||
# Example code
|
||||
#
|
||||
|
||||
set(LIST_EXAMPLES
|
||||
unit_test_example_01.cpp,shared,fail
|
||||
unit_test_example_02.cpp,static,fail
|
||||
unit_test_example_03.cpp,static,fail
|
||||
unit_test_example_04.cpp,shared,fail
|
||||
unit_test_example_05.cpp,shared,fail
|
||||
unit_test_example_06.cpp,shared,fail
|
||||
unit_test_example_07.cpp,shared,run
|
||||
unit_test_example_08.cpp,shared,run
|
||||
unit_test_example_09_1.cpp,unit_test_example_09_2.cpp,shared,run
|
||||
|
||||
unit_test_example_10.cpp,static,fail
|
||||
unit_test_example_11.cpp,static,fail
|
||||
unit_test_example_12.cpp,static,link
|
||||
unit_test_example_13.cpp,shared,run
|
||||
unit_test_example_15.cpp,shared,fail
|
||||
unit_test_example_16.cpp,shared,run
|
||||
|
||||
const_string_test.cpp,none,run
|
||||
named_param_example.cpp,none,run
|
||||
|
||||
external_main_example_1.cpp,shared,fail
|
||||
external_main_example_2.cpp,shared,fail
|
||||
external_main_example_3.cpp,none,fail
|
||||
filtering_example.cpp,static,fail
|
||||
)
|
||||
|
||||
foreach(_var IN LISTS LIST_EXAMPLES)
|
||||
string(REPLACE "," ";" _var_to_list "${_var}")
|
||||
list(REVERSE _var_to_list)
|
||||
list(GET _var_to_list 0 action)
|
||||
list(GET _var_to_list 1 boost_test_type)
|
||||
list(REMOVE_AT _var_to_list 0)
|
||||
list(REMOVE_AT _var_to_list 0)
|
||||
|
||||
list(GET _var_to_list 0 first_file)
|
||||
get_filename_component(_name_example "${first_file}" NAME_WE)
|
||||
|
||||
set(_list_files)
|
||||
foreach(_file IN LISTS _var_to_list)
|
||||
set(_list_files ${_list_files} ${BOOST_TEST_EXAMPLES_FOLDER}/${_file})
|
||||
endforeach()
|
||||
|
||||
add_executable(${_name_example} ${_list_files})
|
||||
set_target_properties(${_name_example}
|
||||
PROPERTIES
|
||||
FOLDER "Examples"
|
||||
VS_DEBUGGER_WORKING_DIRECTORY ${BOOST_TEST_UNITTESTS_FOLDER})
|
||||
|
||||
if("${boost_test_type}" STREQUAL "shared")
|
||||
target_link_libraries(${_name_example}
|
||||
PRIVATE
|
||||
boost_test_framework_shared)
|
||||
elseif("${boost_test_type}" STREQUAL "static")
|
||||
target_link_libraries(${_name_example}
|
||||
PRIVATE
|
||||
boost_test_framework)
|
||||
elseif(NOT "${boost_test_type}" STREQUAL "none")
|
||||
message(FATAL_ERROR "Wrong action for example target '${_name_example}'")
|
||||
endif()
|
||||
|
||||
if("${action}" STREQUAL "run" OR "${action}" STREQUAL "run-fail")
|
||||
add_test(NAME bt-exampletest-${_name_example}
|
||||
COMMAND ${_name_example})
|
||||
|
||||
if("${action}" STREQUAL "run-fail")
|
||||
set_tests_properties(bt-exampletest-${_name_example}
|
||||
PROPERTIES
|
||||
WILL_FAIL TRUE)
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,15 +1,15 @@
|
||||
* 1-format *******************************************************************
|
||||
Running 2 test cases...
|
||||
xxx/log-count-skipped-test.cpp:146: Entering test suite "fake master test suite"
|
||||
xxx/log-count-skipped-test.cpp:133: Entering test case "test_1"
|
||||
xxx/log-count-skipped-test.cpp:143: Entering test suite "fake master test suite"
|
||||
xxx/log-count-skipped-test.cpp:130: Entering test case "test_1"
|
||||
xxx/log-count-skipped-test.cpp:47: info: check 2 + 2 == 4 has passed
|
||||
xxx/log-count-skipped-test.cpp:133: Leaving test case "test_1"
|
||||
xxx/log-count-skipped-test.cpp:134: Test case "fake master test suite/test_2" is skipped because precondition failed: test is skipped because -some precondition-
|
||||
xxx/log-count-skipped-test.cpp:135: Test case "fake master test suite/test_3" is skipped because disabled
|
||||
xxx/log-count-skipped-test.cpp:146: Leaving test suite "fake master test suite"
|
||||
xxx/log-count-skipped-test.cpp:130: Leaving test case "test_1"
|
||||
xxx/log-count-skipped-test.cpp:131: Test case "fake master test suite/test_2" is skipped because precondition failed: test is skipped because -some precondition-
|
||||
xxx/log-count-skipped-test.cpp:132: Test case "fake master test suite/test_3" is skipped because disabled
|
||||
xxx/log-count-skipped-test.cpp:143: Leaving test suite "fake master test suite"
|
||||
|
||||
* 2-format *******************************************************************
|
||||
<TestLog><TestSuite name="fake master test suite" file="xxx/log-count-skipped-test.cpp" line="146"><TestCase name="test_1" file="xxx/log-count-skipped-test.cpp" line="133"><Info file="xxx/log-count-skipped-test.cpp" line="47"><![CDATA[check 2 + 2 == 4 has passed]]></Info><TestingTime>ZZZ</TestingTime></TestCase><TestCase name="test_2" skipped="yes" reason="precondition failed: test is skipped because -some precondition-"/><TestCase name="test_3" skipped="yes" reason="disabled"/></TestSuite></TestLog>
|
||||
<TestLog><TestSuite name="fake master test suite" file="xxx/log-count-skipped-test.cpp" line="143"><TestCase name="test_1" file="xxx/log-count-skipped-test.cpp" line="130"><Info file="xxx/log-count-skipped-test.cpp" line="47"><![CDATA[check 2 + 2 == 4 has passed]]></Info><TestingTime>ZZZ</TestingTime></TestCase><TestCase name="test_2" skipped="yes" reason="precondition failed: test is skipped because -some precondition-"/><TestCase name="test_3" skipped="yes" reason="disabled"/></TestSuite></TestLog>
|
||||
* 3-format *******************************************************************
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<testsuite tests="1" skipped="2" errors="0" failures="0" id="0" name="fake_master_test_suite" time="0.1234">
|
||||
@@ -54,18 +54,18 @@ xxx/log-count-skipped-test.cpp:146: Leaving test suite "fake master test suite"
|
||||
</testsuite>
|
||||
* 1-format *******************************************************************
|
||||
Running 2 test cases...
|
||||
xxx/log-count-skipped-test.cpp:146: Entering test suite "fake master test suite"
|
||||
xxx/log-count-skipped-test.cpp:133: Entering test case "test_1"
|
||||
xxx/log-count-skipped-test.cpp:143: Entering test suite "fake master test suite"
|
||||
xxx/log-count-skipped-test.cpp:130: Entering test case "test_1"
|
||||
xxx/log-count-skipped-test.cpp:47: info: check 2 + 2 == 4 has passed
|
||||
xxx/log-count-skipped-test.cpp:133: Leaving test case "test_1"
|
||||
xxx/log-count-skipped-test.cpp:134: Entering test case "test_2"
|
||||
xxx/log-count-skipped-test.cpp:130: Leaving test case "test_1"
|
||||
xxx/log-count-skipped-test.cpp:131: Entering test case "test_2"
|
||||
xxx/log-count-skipped-test.cpp:52: error: in "fake master test suite/test_2": check 0 == 1 has failed [0 != 1]
|
||||
xxx/log-count-skipped-test.cpp:134: Leaving test case "test_2"
|
||||
xxx/log-count-skipped-test.cpp:135: Test case "fake master test suite/test_3" is skipped because disabled
|
||||
xxx/log-count-skipped-test.cpp:146: Leaving test suite "fake master test suite"
|
||||
xxx/log-count-skipped-test.cpp:131: Leaving test case "test_2"
|
||||
xxx/log-count-skipped-test.cpp:132: Test case "fake master test suite/test_3" is skipped because disabled
|
||||
xxx/log-count-skipped-test.cpp:143: Leaving test suite "fake master test suite"
|
||||
|
||||
* 2-format *******************************************************************
|
||||
<TestLog><TestSuite name="fake master test suite" file="xxx/log-count-skipped-test.cpp" line="146"><TestCase name="test_1" file="xxx/log-count-skipped-test.cpp" line="133"><Info file="xxx/log-count-skipped-test.cpp" line="47"><![CDATA[check 2 + 2 == 4 has passed]]></Info><TestingTime>ZZZ</TestingTime></TestCase><TestCase name="test_2" file="xxx/log-count-skipped-test.cpp" line="134"><Error file="xxx/log-count-skipped-test.cpp" line="52"><![CDATA[check 0 == 1 has failed [0 != 1]]]></Error><TestingTime>ZZZ</TestingTime></TestCase><TestCase name="test_3" skipped="yes" reason="disabled"/></TestSuite></TestLog>
|
||||
<TestLog><TestSuite name="fake master test suite" file="xxx/log-count-skipped-test.cpp" line="143"><TestCase name="test_1" file="xxx/log-count-skipped-test.cpp" line="130"><Info file="xxx/log-count-skipped-test.cpp" line="47"><![CDATA[check 2 + 2 == 4 has passed]]></Info><TestingTime>ZZZ</TestingTime></TestCase><TestCase name="test_2" file="xxx/log-count-skipped-test.cpp" line="131"><Error file="xxx/log-count-skipped-test.cpp" line="52"><![CDATA[check 0 == 1 has failed [0 != 1]]]></Error><TestingTime>ZZZ</TestingTime></TestCase><TestCase name="test_3" skipped="yes" reason="disabled"/></TestSuite></TestLog>
|
||||
* 3-format *******************************************************************
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<testsuite tests="2" skipped="1" errors="0" failures="1" id="0" name="fake_master_test_suite" time="0.1234">
|
||||
@@ -87,7 +87,7 @@ ASSERTION FAILURE:
|
||||
]]></failure><system-err><![CDATA[Failures detected in:
|
||||
- test case: fake master test suite/test_2
|
||||
- file: log-count-skipped-test.cpp
|
||||
- line: 134
|
||||
- line: 131
|
||||
]]></system-err>
|
||||
</testcase>
|
||||
<testcase assertions="0" name="test_3" time="0.1234">
|
||||
@@ -112,7 +112,7 @@ ASSERTION FAILURE:
|
||||
]]></failure><system-err><![CDATA[Failures detected in:
|
||||
- test case: fake master test suite/test_2
|
||||
- file: log-count-skipped-test.cpp
|
||||
- line: 134
|
||||
- line: 131
|
||||
]]></system-err>
|
||||
</testcase>
|
||||
<testcase assertions="0" name="test_3" time="0.1234">
|
||||
@@ -124,18 +124,18 @@ ASSERTION FAILURE:
|
||||
</testsuite>
|
||||
* 1-format *******************************************************************
|
||||
Running 3 test cases...
|
||||
xxx/log-count-skipped-test.cpp:159: Entering test suite "fake master test suite2"
|
||||
xxx/log-count-skipped-test.cpp:133: Entering test case "test_1"
|
||||
xxx/log-count-skipped-test.cpp:156: Entering test suite "fake master test suite2"
|
||||
xxx/log-count-skipped-test.cpp:130: Entering test case "test_1"
|
||||
xxx/log-count-skipped-test.cpp:47: info: check 2 + 2 == 4 has passed
|
||||
xxx/log-count-skipped-test.cpp:133: Leaving test case "test_1"
|
||||
xxx/log-count-skipped-test.cpp:134: Test case "fake master test suite2/test_2" is skipped because precondition failed: test is skipped because -some precondition-
|
||||
xxx/log-count-skipped-test.cpp:135: Test case "fake master test suite2/test_3" is skipped because disabled
|
||||
xxx/log-count-skipped-test.cpp:165: Test suite "fake master test suite2/child1" is skipped because disabled
|
||||
xxx/log-count-skipped-test.cpp:170: Test suite "fake master test suite2/child2" is skipped because precondition failed: test is skipped because -some precondition-
|
||||
xxx/log-count-skipped-test.cpp:159: Leaving test suite "fake master test suite2"
|
||||
xxx/log-count-skipped-test.cpp:130: Leaving test case "test_1"
|
||||
xxx/log-count-skipped-test.cpp:131: Test case "fake master test suite2/test_2" is skipped because precondition failed: test is skipped because -some precondition-
|
||||
xxx/log-count-skipped-test.cpp:132: Test case "fake master test suite2/test_3" is skipped because disabled
|
||||
xxx/log-count-skipped-test.cpp:162: Test suite "fake master test suite2/child1" is skipped because disabled
|
||||
xxx/log-count-skipped-test.cpp:167: Test suite "fake master test suite2/child2" is skipped because precondition failed: test is skipped because -some precondition-
|
||||
xxx/log-count-skipped-test.cpp:156: Leaving test suite "fake master test suite2"
|
||||
|
||||
* 2-format *******************************************************************
|
||||
<TestLog><TestSuite name="fake master test suite2" file="xxx/log-count-skipped-test.cpp" line="159"><TestCase name="test_1" file="xxx/log-count-skipped-test.cpp" line="133"><Info file="xxx/log-count-skipped-test.cpp" line="47"><![CDATA[check 2 + 2 == 4 has passed]]></Info><TestingTime>ZZZ</TestingTime></TestCase><TestCase name="test_2" skipped="yes" reason="precondition failed: test is skipped because -some precondition-"/><TestCase name="test_3" skipped="yes" reason="disabled"/><TestSuite name="child1" skipped="yes" reason="disabled"/><TestSuite name="child2" skipped="yes" reason="precondition failed: test is skipped because -some precondition-"/></TestSuite></TestLog>
|
||||
<TestLog><TestSuite name="fake master test suite2" file="xxx/log-count-skipped-test.cpp" line="156"><TestCase name="test_1" file="xxx/log-count-skipped-test.cpp" line="130"><Info file="xxx/log-count-skipped-test.cpp" line="47"><![CDATA[check 2 + 2 == 4 has passed]]></Info><TestingTime>ZZZ</TestingTime></TestCase><TestCase name="test_2" skipped="yes" reason="precondition failed: test is skipped because -some precondition-"/><TestCase name="test_3" skipped="yes" reason="disabled"/><TestSuite name="child1" skipped="yes" reason="disabled"/><TestSuite name="child2" skipped="yes" reason="precondition failed: test is skipped because -some precondition-"/></TestSuite></TestLog>
|
||||
* 3-format *******************************************************************
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<testsuite tests="1" skipped="6" errors="0" failures="0" id="0" name="fake_master_test_suite2" time="0.1234">
|
||||
@@ -236,25 +236,25 @@ xxx/log-count-skipped-test.cpp:159: Leaving test suite "fake master test suite2"
|
||||
</testsuite>
|
||||
* 1-format *******************************************************************
|
||||
Running 3 test cases...
|
||||
xxx/log-count-skipped-test.cpp:159: Entering test suite "fake master test suite2"
|
||||
xxx/log-count-skipped-test.cpp:133: Entering test case "test_1"
|
||||
xxx/log-count-skipped-test.cpp:156: Entering test suite "fake master test suite2"
|
||||
xxx/log-count-skipped-test.cpp:130: Entering test case "test_1"
|
||||
xxx/log-count-skipped-test.cpp:47: info: check 2 + 2 == 4 has passed
|
||||
xxx/log-count-skipped-test.cpp:133: Leaving test case "test_1"
|
||||
xxx/log-count-skipped-test.cpp:134: Entering test case "test_2"
|
||||
xxx/log-count-skipped-test.cpp:130: Leaving test case "test_1"
|
||||
xxx/log-count-skipped-test.cpp:131: Entering test case "test_2"
|
||||
xxx/log-count-skipped-test.cpp:52: error: in "fake master test suite2/test_2": check 0 == 1 has failed [0 != 1]
|
||||
xxx/log-count-skipped-test.cpp:134: Leaving test case "test_2"
|
||||
xxx/log-count-skipped-test.cpp:135: Test case "fake master test suite2/test_3" is skipped because disabled
|
||||
xxx/log-count-skipped-test.cpp:165: Test suite "fake master test suite2/child1" is skipped because disabled
|
||||
xxx/log-count-skipped-test.cpp:170: Entering test suite "child2"
|
||||
xxx/log-count-skipped-test.cpp:169: Test case "fake master test suite2/child2/test_1" is skipped because disabled
|
||||
xxx/log-count-skipped-test.cpp:172: Entering test case "t2"
|
||||
xxx/log-count-skipped-test.cpp:131: Leaving test case "test_2"
|
||||
xxx/log-count-skipped-test.cpp:132: Test case "fake master test suite2/test_3" is skipped because disabled
|
||||
xxx/log-count-skipped-test.cpp:162: Test suite "fake master test suite2/child1" is skipped because disabled
|
||||
xxx/log-count-skipped-test.cpp:167: Entering test suite "child2"
|
||||
xxx/log-count-skipped-test.cpp:166: Test case "fake master test suite2/child2/test_1" is skipped because disabled
|
||||
xxx/log-count-skipped-test.cpp:169: Entering test case "t2"
|
||||
xxx/log-count-skipped-test.cpp:47: info: check 2 + 2 == 4 has passed
|
||||
xxx/log-count-skipped-test.cpp:172: Leaving test case "t2"
|
||||
xxx/log-count-skipped-test.cpp:170: Leaving test suite "child2"
|
||||
xxx/log-count-skipped-test.cpp:159: Leaving test suite "fake master test suite2"
|
||||
xxx/log-count-skipped-test.cpp:169: Leaving test case "t2"
|
||||
xxx/log-count-skipped-test.cpp:167: Leaving test suite "child2"
|
||||
xxx/log-count-skipped-test.cpp:156: Leaving test suite "fake master test suite2"
|
||||
|
||||
* 2-format *******************************************************************
|
||||
<TestLog><TestSuite name="fake master test suite2" file="xxx/log-count-skipped-test.cpp" line="159"><TestCase name="test_1" file="xxx/log-count-skipped-test.cpp" line="133"><Info file="xxx/log-count-skipped-test.cpp" line="47"><![CDATA[check 2 + 2 == 4 has passed]]></Info><TestingTime>ZZZ</TestingTime></TestCase><TestCase name="test_2" file="xxx/log-count-skipped-test.cpp" line="134"><Error file="xxx/log-count-skipped-test.cpp" line="52"><![CDATA[check 0 == 1 has failed [0 != 1]]]></Error><TestingTime>ZZZ</TestingTime></TestCase><TestCase name="test_3" skipped="yes" reason="disabled"/><TestSuite name="child1" skipped="yes" reason="disabled"/><TestSuite name="child2" file="xxx/log-count-skipped-test.cpp" line="170"><TestCase name="test_1" skipped="yes" reason="disabled"/><TestCase name="t2" file="xxx/log-count-skipped-test.cpp" line="172"><Info file="xxx/log-count-skipped-test.cpp" line="47"><![CDATA[check 2 + 2 == 4 has passed]]></Info><TestingTime>ZZZ</TestingTime></TestCase></TestSuite></TestSuite></TestLog>
|
||||
<TestLog><TestSuite name="fake master test suite2" file="xxx/log-count-skipped-test.cpp" line="156"><TestCase name="test_1" file="xxx/log-count-skipped-test.cpp" line="130"><Info file="xxx/log-count-skipped-test.cpp" line="47"><![CDATA[check 2 + 2 == 4 has passed]]></Info><TestingTime>ZZZ</TestingTime></TestCase><TestCase name="test_2" file="xxx/log-count-skipped-test.cpp" line="131"><Error file="xxx/log-count-skipped-test.cpp" line="52"><![CDATA[check 0 == 1 has failed [0 != 1]]]></Error><TestingTime>ZZZ</TestingTime></TestCase><TestCase name="test_3" skipped="yes" reason="disabled"/><TestSuite name="child1" skipped="yes" reason="disabled"/><TestSuite name="child2" file="xxx/log-count-skipped-test.cpp" line="167"><TestCase name="test_1" skipped="yes" reason="disabled"/><TestCase name="t2" file="xxx/log-count-skipped-test.cpp" line="169"><Info file="xxx/log-count-skipped-test.cpp" line="47"><![CDATA[check 2 + 2 == 4 has passed]]></Info><TestingTime>ZZZ</TestingTime></TestCase></TestSuite></TestSuite></TestLog>
|
||||
* 3-format *******************************************************************
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<testsuite tests="3" skipped="4" errors="0" failures="1" id="0" name="fake_master_test_suite2" time="0.1234">
|
||||
@@ -276,7 +276,7 @@ ASSERTION FAILURE:
|
||||
]]></failure><system-err><![CDATA[Failures detected in:
|
||||
- test case: fake master test suite2/test_2
|
||||
- file: log-count-skipped-test.cpp
|
||||
- line: 134
|
||||
- line: 131
|
||||
]]></system-err>
|
||||
</testcase>
|
||||
<testcase assertions="0" name="test_3" time="0.1234">
|
||||
@@ -329,7 +329,7 @@ ASSERTION FAILURE:
|
||||
]]></failure><system-err><![CDATA[Failures detected in:
|
||||
- test case: fake master test suite2/test_2
|
||||
- file: log-count-skipped-test.cpp
|
||||
- line: 134
|
||||
- line: 131
|
||||
]]></system-err>
|
||||
</testcase>
|
||||
<testcase assertions="0" name="test_3" time="0.1234">
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
* 1-format *******************************************************************
|
||||
Running 1 test case...
|
||||
xxx/log-formatter-test.cpp:209: Entering test suite "1 test cases inside"
|
||||
xxx/log-formatter-test.cpp:210: Entering test case "good_foo"
|
||||
xxx/log-formatter-test.cpp:159: Entering test suite "1 test cases inside"
|
||||
xxx/log-formatter-test.cpp:160: Entering test case "good_foo"
|
||||
Test case Fake Test Suite Hierarchy/1 test cases inside/good_foo did not check any assertions
|
||||
xxx/log-formatter-test.cpp:210: Leaving test case "good_foo"
|
||||
xxx/log-formatter-test.cpp:209: Leaving test suite "1 test cases inside"
|
||||
xxx/log-formatter-test.cpp:160: Leaving test case "good_foo"
|
||||
xxx/log-formatter-test.cpp:159: Leaving test suite "1 test cases inside"
|
||||
|
||||
* 2-format *******************************************************************
|
||||
<TestLog><TestSuite name="1 test cases inside" file="xxx/log-formatter-test.cpp" line="209"><TestCase name="good_foo" file="xxx/log-formatter-test.cpp" line="210"><Message file="boost.test framework" line="0"><![CDATA[Test case Fake Test Suite Hierarchy/1 test cases inside/good_foo did not check any assertions]]></Message><TestingTime>ZZZ</TestingTime></TestCase></TestSuite></TestLog>
|
||||
<TestLog><TestSuite name="1 test cases inside" file="xxx/log-formatter-test.cpp" line="159"><TestCase name="good_foo" file="xxx/log-formatter-test.cpp" line="160"><Message file="boost.test framework" line="0"><![CDATA[Test case Fake Test Suite Hierarchy/1 test cases inside/good_foo did not check any assertions]]></Message><TestingTime>ZZZ</TestingTime></TestCase></TestSuite></TestLog>
|
||||
* 3-format *******************************************************************
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<testsuite tests="1" skipped="0" errors="0" failures="0" id="0" name="1_test_cases_inside" time="0.1234">
|
||||
@@ -28,8 +28,8 @@ xxx/log-formatter-test.cpp:209: Leaving test suite "1 test cases inside"
|
||||
</testsuite>
|
||||
* 1-format *******************************************************************
|
||||
Running 1 test case...
|
||||
xxx/log-formatter-test.cpp:212: Entering test suite "1 bad test case inside"
|
||||
xxx/log-formatter-test.cpp:213: Entering test case "bad_foo"
|
||||
xxx/log-formatter-test.cpp:162: Entering test suite "1 bad test case inside"
|
||||
xxx/log-formatter-test.cpp:163: Entering test case "bad_foo"
|
||||
xxx/log-formatter-test.cpp:50: error: in "1 bad test case inside/bad_foo":
|
||||
this is a message
|
||||
xxx/log-formatter-test.cpp:53: info: check true has passed
|
||||
@@ -38,11 +38,11 @@ Failure occurred in a following context:
|
||||
Context value=something
|
||||
Context value2=something different
|
||||
xxx/log-formatter-test.cpp:59: error: in "1 bad test case inside/bad_foo": non sense
|
||||
xxx/log-formatter-test.cpp:213: Leaving test case "bad_foo"
|
||||
xxx/log-formatter-test.cpp:212: Leaving test suite "1 bad test case inside"
|
||||
xxx/log-formatter-test.cpp:163: Leaving test case "bad_foo"
|
||||
xxx/log-formatter-test.cpp:162: Leaving test suite "1 bad test case inside"
|
||||
|
||||
* 2-format *******************************************************************
|
||||
<TestLog><TestSuite name="1 bad test case inside" file="xxx/log-formatter-test.cpp" line="212"><TestCase name="bad_foo" file="xxx/log-formatter-test.cpp" line="213"><Error file="xxx/log-formatter-test.cpp" line="50"><![CDATA[]]></Error><Message file="xxx/log-formatter-test.cpp" line="52"><![CDATA[this is a message]]></Message><Info file="xxx/log-formatter-test.cpp" line="53"><![CDATA[check true has passed]]></Info><Error file="xxx/log-formatter-test.cpp" line="57"><![CDATA[with some message]]><Context><Frame><![CDATA[Context value=something]]></Frame><Frame><![CDATA[Context value2=something different]]></Frame></Context></Error><Error file="xxx/log-formatter-test.cpp" line="59"><![CDATA[non sense]]></Error><TestingTime>ZZZ</TestingTime></TestCase></TestSuite></TestLog>
|
||||
<TestLog><TestSuite name="1 bad test case inside" file="xxx/log-formatter-test.cpp" line="162"><TestCase name="bad_foo" file="xxx/log-formatter-test.cpp" line="163"><Error file="xxx/log-formatter-test.cpp" line="50"><![CDATA[]]></Error><Message file="xxx/log-formatter-test.cpp" line="52"><![CDATA[this is a message]]></Message><Info file="xxx/log-formatter-test.cpp" line="53"><![CDATA[check true has passed]]></Info><Error file="xxx/log-formatter-test.cpp" line="57"><![CDATA[with some message]]><Context><Frame><![CDATA[Context value=something]]></Frame><Frame><![CDATA[Context value2=something different]]></Frame></Context></Error><Error file="xxx/log-formatter-test.cpp" line="59"><![CDATA[non sense]]></Error><TestingTime>ZZZ</TestingTime></TestCase></TestSuite></TestLog>
|
||||
* 3-format *******************************************************************
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<testsuite tests="1" skipped="0" errors="0" failures="1" id="0" name="1_bad_test_case_inside" time="0.1234">
|
||||
@@ -83,7 +83,7 @@ INFO:
|
||||
<system-err><![CDATA[Failures detected in:
|
||||
- test case: 1 bad test case inside/bad_foo
|
||||
- file: log-formatter-test.cpp
|
||||
- line: 213
|
||||
- line: 163
|
||||
]]></system-err>
|
||||
</testcase>
|
||||
</testsuite>
|
||||
@@ -116,21 +116,21 @@ ASSERTION FAILURE:
|
||||
]]></failure><system-err><![CDATA[Failures detected in:
|
||||
- test case: 1 bad test case inside/bad_foo
|
||||
- file: log-formatter-test.cpp
|
||||
- line: 213
|
||||
- line: 163
|
||||
]]></system-err>
|
||||
</testcase>
|
||||
</testsuite>
|
||||
* 1-format *******************************************************************
|
||||
Running 1 test case...
|
||||
xxx/log-formatter-test.cpp:215: Entering test suite "1 almost good test case inside"
|
||||
xxx/log-formatter-test.cpp:216: Entering test case "almost_good_foo"
|
||||
xxx/log-formatter-test.cpp:165: Entering test suite "1 almost good test case inside"
|
||||
xxx/log-formatter-test.cpp:166: Entering test case "almost_good_foo"
|
||||
xxx/log-formatter-test.cpp:46: warning: in "1 almost good test case inside/almost_good_foo": condition 2>3 is not satisfied [2 <= 3]
|
||||
Test case 1 almost good test case inside/almost_good_foo did not check any assertions
|
||||
xxx/log-formatter-test.cpp:216: Leaving test case "almost_good_foo"
|
||||
xxx/log-formatter-test.cpp:215: Leaving test suite "1 almost good test case inside"
|
||||
xxx/log-formatter-test.cpp:166: Leaving test case "almost_good_foo"
|
||||
xxx/log-formatter-test.cpp:165: Leaving test suite "1 almost good test case inside"
|
||||
|
||||
* 2-format *******************************************************************
|
||||
<TestLog><TestSuite name="1 almost good test case inside" file="xxx/log-formatter-test.cpp" line="215"><TestCase name="almost_good_foo" file="xxx/log-formatter-test.cpp" line="216"><Warning file="xxx/log-formatter-test.cpp" line="46"><![CDATA[condition 2>3 is not satisfied [2 <= 3]]]></Warning><Message file="boost.test framework" line="0"><![CDATA[Test case 1 almost good test case inside/almost_good_foo did not check any assertions]]></Message><TestingTime>ZZZ</TestingTime></TestCase></TestSuite></TestLog>
|
||||
<TestLog><TestSuite name="1 almost good test case inside" file="xxx/log-formatter-test.cpp" line="165"><TestCase name="almost_good_foo" file="xxx/log-formatter-test.cpp" line="166"><Warning file="xxx/log-formatter-test.cpp" line="46"><![CDATA[condition 2>3 is not satisfied [2 <= 3]]]></Warning><Message file="boost.test framework" line="0"><![CDATA[Test case 1 almost good test case inside/almost_good_foo did not check any assertions]]></Message><TestingTime>ZZZ</TestingTime></TestCase></TestSuite></TestLog>
|
||||
* 3-format *******************************************************************
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<testsuite tests="0" skipped="0" errors="0" failures="0" id="0" name="1_almost_good_test_case_inside" time="0.1234">
|
||||
@@ -156,11 +156,11 @@ MESSAGE:
|
||||
</testsuite>
|
||||
* 1-format *******************************************************************
|
||||
Running 2 test cases...
|
||||
xxx/log-formatter-test.cpp:218: Entering test suite "2 test cases inside"
|
||||
xxx/log-formatter-test.cpp:219: Entering test case "good_foo"
|
||||
xxx/log-formatter-test.cpp:168: Entering test suite "2 test cases inside"
|
||||
xxx/log-formatter-test.cpp:169: Entering test case "good_foo"
|
||||
Test case Fake Test Suite Hierarchy/2 test cases inside/good_foo did not check any assertions
|
||||
xxx/log-formatter-test.cpp:219: Leaving test case "good_foo"
|
||||
xxx/log-formatter-test.cpp:220: Entering test case "bad_foo"
|
||||
xxx/log-formatter-test.cpp:169: Leaving test case "good_foo"
|
||||
xxx/log-formatter-test.cpp:170: Entering test case "bad_foo"
|
||||
xxx/log-formatter-test.cpp:50: error: in "Fake Test Suite Hierarchy/2 test cases inside/bad_foo":
|
||||
this is a message
|
||||
xxx/log-formatter-test.cpp:53: info: check true has passed
|
||||
@@ -169,11 +169,11 @@ Failure occurred in a following context:
|
||||
Context value=something
|
||||
Context value2=something different
|
||||
xxx/log-formatter-test.cpp:59: error: in "Fake Test Suite Hierarchy/2 test cases inside/bad_foo": non sense
|
||||
xxx/log-formatter-test.cpp:220: Leaving test case "bad_foo"
|
||||
xxx/log-formatter-test.cpp:218: Leaving test suite "2 test cases inside"
|
||||
xxx/log-formatter-test.cpp:170: Leaving test case "bad_foo"
|
||||
xxx/log-formatter-test.cpp:168: Leaving test suite "2 test cases inside"
|
||||
|
||||
* 2-format *******************************************************************
|
||||
<TestLog><TestSuite name="2 test cases inside" file="xxx/log-formatter-test.cpp" line="218"><TestCase name="good_foo" file="xxx/log-formatter-test.cpp" line="219"><Message file="boost.test framework" line="0"><![CDATA[Test case Fake Test Suite Hierarchy/2 test cases inside/good_foo did not check any assertions]]></Message><TestingTime>ZZZ</TestingTime></TestCase><TestCase name="bad_foo" file="xxx/log-formatter-test.cpp" line="220"><Error file="xxx/log-formatter-test.cpp" line="50"><![CDATA[]]></Error><Message file="xxx/log-formatter-test.cpp" line="52"><![CDATA[this is a message]]></Message><Info file="xxx/log-formatter-test.cpp" line="53"><![CDATA[check true has passed]]></Info><Error file="xxx/log-formatter-test.cpp" line="57"><![CDATA[with some message]]><Context><Frame><![CDATA[Context value=something]]></Frame><Frame><![CDATA[Context value2=something different]]></Frame></Context></Error><Error file="xxx/log-formatter-test.cpp" line="59"><![CDATA[non sense]]></Error><TestingTime>ZZZ</TestingTime></TestCase></TestSuite></TestLog>
|
||||
<TestLog><TestSuite name="2 test cases inside" file="xxx/log-formatter-test.cpp" line="168"><TestCase name="good_foo" file="xxx/log-formatter-test.cpp" line="169"><Message file="boost.test framework" line="0"><![CDATA[Test case Fake Test Suite Hierarchy/2 test cases inside/good_foo did not check any assertions]]></Message><TestingTime>ZZZ</TestingTime></TestCase><TestCase name="bad_foo" file="xxx/log-formatter-test.cpp" line="170"><Error file="xxx/log-formatter-test.cpp" line="50"><![CDATA[]]></Error><Message file="xxx/log-formatter-test.cpp" line="52"><![CDATA[this is a message]]></Message><Info file="xxx/log-formatter-test.cpp" line="53"><![CDATA[check true has passed]]></Info><Error file="xxx/log-formatter-test.cpp" line="57"><![CDATA[with some message]]><Context><Frame><![CDATA[Context value=something]]></Frame><Frame><![CDATA[Context value2=something different]]></Frame></Context></Error><Error file="xxx/log-formatter-test.cpp" line="59"><![CDATA[non sense]]></Error><TestingTime>ZZZ</TestingTime></TestCase></TestSuite></TestLog>
|
||||
* 3-format *******************************************************************
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<testsuite tests="2" skipped="0" errors="0" failures="1" id="0" name="2_test_cases_inside" time="0.1234">
|
||||
@@ -222,7 +222,7 @@ INFO:
|
||||
<system-err><![CDATA[Failures detected in:
|
||||
- test case: Fake Test Suite Hierarchy/2 test cases inside/bad_foo
|
||||
- file: log-formatter-test.cpp
|
||||
- line: 220
|
||||
- line: 170
|
||||
]]></system-err>
|
||||
</testcase>
|
||||
</testsuite>
|
||||
@@ -257,14 +257,14 @@ ASSERTION FAILURE:
|
||||
]]></failure><system-err><![CDATA[Failures detected in:
|
||||
- test case: Fake Test Suite Hierarchy/2 test cases inside/bad_foo
|
||||
- file: log-formatter-test.cpp
|
||||
- line: 220
|
||||
- line: 170
|
||||
]]></system-err>
|
||||
</testcase>
|
||||
</testsuite>
|
||||
* 1-format *******************************************************************
|
||||
Running 3 test cases...
|
||||
xxx/log-formatter-test.cpp:222: Entering test suite "3 test cases inside"
|
||||
xxx/log-formatter-test.cpp:223: Entering test case "bad_foo"
|
||||
xxx/log-formatter-test.cpp:172: Entering test suite "3 test cases inside"
|
||||
xxx/log-formatter-test.cpp:173: Entering test case "bad_foo"
|
||||
xxx/log-formatter-test.cpp:50: error: in "Fake Test Suite Hierarchy/3 test cases inside/bad_foo":
|
||||
this is a message
|
||||
xxx/log-formatter-test.cpp:53: info: check true has passed
|
||||
@@ -273,17 +273,17 @@ Failure occurred in a following context:
|
||||
Context value=something
|
||||
Context value2=something different
|
||||
xxx/log-formatter-test.cpp:59: error: in "Fake Test Suite Hierarchy/3 test cases inside/bad_foo": non sense
|
||||
xxx/log-formatter-test.cpp:223: Leaving test case "bad_foo"
|
||||
xxx/log-formatter-test.cpp:224: Entering test case "very_bad_foo"
|
||||
xxx/log-formatter-test.cpp:173: Leaving test case "bad_foo"
|
||||
xxx/log-formatter-test.cpp:174: Entering test case "very_bad_foo"
|
||||
xxx/log-formatter-test.cpp:64: fatal error: in "Fake Test Suite Hierarchy/3 test cases inside/very_bad_foo": very_bad_foo is fatal
|
||||
Failure occurred in a following context:
|
||||
some context
|
||||
xxx/log-formatter-test.cpp:224: Leaving test case "very_bad_foo"
|
||||
xxx/log-formatter-test.cpp:226: Test case "Fake Test Suite Hierarchy/3 test cases inside/bad_foo2" is skipped because dependency test case "Fake Test Suite Hierarchy/3 test cases inside/very_bad_foo" has failed
|
||||
xxx/log-formatter-test.cpp:222: Leaving test suite "3 test cases inside"
|
||||
xxx/log-formatter-test.cpp:174: Leaving test case "very_bad_foo"
|
||||
xxx/log-formatter-test.cpp:176: Test case "Fake Test Suite Hierarchy/3 test cases inside/bad_foo2" is skipped because dependency test case "Fake Test Suite Hierarchy/3 test cases inside/very_bad_foo" has failed
|
||||
xxx/log-formatter-test.cpp:172: Leaving test suite "3 test cases inside"
|
||||
|
||||
* 2-format *******************************************************************
|
||||
<TestLog><TestSuite name="3 test cases inside" file="xxx/log-formatter-test.cpp" line="222"><TestCase name="bad_foo" file="xxx/log-formatter-test.cpp" line="223"><Error file="xxx/log-formatter-test.cpp" line="50"><![CDATA[]]></Error><Message file="xxx/log-formatter-test.cpp" line="52"><![CDATA[this is a message]]></Message><Info file="xxx/log-formatter-test.cpp" line="53"><![CDATA[check true has passed]]></Info><Error file="xxx/log-formatter-test.cpp" line="57"><![CDATA[with some message]]><Context><Frame><![CDATA[Context value=something]]></Frame><Frame><![CDATA[Context value2=something different]]></Frame></Context></Error><Error file="xxx/log-formatter-test.cpp" line="59"><![CDATA[non sense]]></Error><TestingTime>ZZZ</TestingTime></TestCase><TestCase name="very_bad_foo" file="xxx/log-formatter-test.cpp" line="224"><FatalError file="xxx/log-formatter-test.cpp" line="64"><![CDATA[very_bad_foo is fatal]]><Context><Frame><![CDATA[some context]]></Frame></Context></FatalError><TestingTime>ZZZ</TestingTime></TestCase><TestCase name="bad_foo2" skipped="yes" reason="dependency test case "Fake Test Suite Hierarchy/3 test cases inside/very_bad_foo" has failed"/></TestSuite></TestLog>
|
||||
<TestLog><TestSuite name="3 test cases inside" file="xxx/log-formatter-test.cpp" line="172"><TestCase name="bad_foo" file="xxx/log-formatter-test.cpp" line="173"><Error file="xxx/log-formatter-test.cpp" line="50"><![CDATA[]]></Error><Message file="xxx/log-formatter-test.cpp" line="52"><![CDATA[this is a message]]></Message><Info file="xxx/log-formatter-test.cpp" line="53"><![CDATA[check true has passed]]></Info><Error file="xxx/log-formatter-test.cpp" line="57"><![CDATA[with some message]]><Context><Frame><![CDATA[Context value=something]]></Frame><Frame><![CDATA[Context value2=something different]]></Frame></Context></Error><Error file="xxx/log-formatter-test.cpp" line="59"><![CDATA[non sense]]></Error><TestingTime>ZZZ</TestingTime></TestCase><TestCase name="very_bad_foo" file="xxx/log-formatter-test.cpp" line="174"><FatalError file="xxx/log-formatter-test.cpp" line="64"><![CDATA[very_bad_foo is fatal]]><Context><Frame><![CDATA[some context]]></Frame></Context></FatalError><TestingTime>ZZZ</TestingTime></TestCase><TestCase name="bad_foo2" skipped="yes" reason="dependency test case "Fake Test Suite Hierarchy/3 test cases inside/very_bad_foo" has failed"/></TestSuite></TestLog>
|
||||
* 3-format *******************************************************************
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<testsuite tests="2" skipped="1" errors="1" failures="1" id="0" name="3_test_cases_inside" time="0.1234">
|
||||
@@ -324,7 +324,7 @@ INFO:
|
||||
<system-err><![CDATA[Failures detected in:
|
||||
- test case: Fake Test Suite Hierarchy/3 test cases inside/bad_foo
|
||||
- file: log-formatter-test.cpp
|
||||
- line: 223
|
||||
- line: 173
|
||||
]]></system-err>
|
||||
</testcase>
|
||||
<testcase assertions="1" name="very_bad_foo" time="0.1234">
|
||||
@@ -340,7 +340,7 @@ ASSERTION FAILURE:
|
||||
]]></failure><system-err><![CDATA[Failures detected in:
|
||||
- test case: Fake Test Suite Hierarchy/3 test cases inside/very_bad_foo
|
||||
- file: log-formatter-test.cpp
|
||||
- line: 224
|
||||
- line: 174
|
||||
]]></system-err>
|
||||
</testcase>
|
||||
<testcase assertions="0" name="bad_foo2" time="0.1234">
|
||||
@@ -379,7 +379,7 @@ ASSERTION FAILURE:
|
||||
]]></failure><system-err><![CDATA[Failures detected in:
|
||||
- test case: Fake Test Suite Hierarchy/3 test cases inside/bad_foo
|
||||
- file: log-formatter-test.cpp
|
||||
- line: 223
|
||||
- line: 173
|
||||
]]></system-err>
|
||||
</testcase>
|
||||
<testcase assertions="1" name="very_bad_foo" time="0.1234">
|
||||
@@ -395,7 +395,7 @@ ASSERTION FAILURE:
|
||||
]]></failure><system-err><![CDATA[Failures detected in:
|
||||
- test case: Fake Test Suite Hierarchy/3 test cases inside/very_bad_foo
|
||||
- file: log-formatter-test.cpp
|
||||
- line: 224
|
||||
- line: 174
|
||||
]]></system-err>
|
||||
</testcase>
|
||||
<testcase assertions="0" name="bad_foo2" time="0.1234">
|
||||
@@ -407,8 +407,8 @@ ASSERTION FAILURE:
|
||||
</testsuite>
|
||||
* 1-format *******************************************************************
|
||||
Running 4 test cases...
|
||||
xxx/log-formatter-test.cpp:230: Entering test suite "4 test cases inside"
|
||||
xxx/log-formatter-test.cpp:231: Entering test case "bad_foo"
|
||||
xxx/log-formatter-test.cpp:180: Entering test suite "4 test cases inside"
|
||||
xxx/log-formatter-test.cpp:181: Entering test case "bad_foo"
|
||||
xxx/log-formatter-test.cpp:50: error: in "Fake Test Suite Hierarchy/4 test cases inside/bad_foo":
|
||||
this is a message
|
||||
xxx/log-formatter-test.cpp:53: info: check true has passed
|
||||
@@ -417,13 +417,13 @@ Failure occurred in a following context:
|
||||
Context value=something
|
||||
Context value2=something different
|
||||
xxx/log-formatter-test.cpp:59: error: in "Fake Test Suite Hierarchy/4 test cases inside/bad_foo": non sense
|
||||
xxx/log-formatter-test.cpp:231: Leaving test case "bad_foo"
|
||||
xxx/log-formatter-test.cpp:232: Entering test case "very_bad_foo"
|
||||
xxx/log-formatter-test.cpp:181: Leaving test case "bad_foo"
|
||||
xxx/log-formatter-test.cpp:182: Entering test case "very_bad_foo"
|
||||
xxx/log-formatter-test.cpp:64: fatal error: in "Fake Test Suite Hierarchy/4 test cases inside/very_bad_foo": very_bad_foo is fatal
|
||||
Failure occurred in a following context:
|
||||
some context
|
||||
xxx/log-formatter-test.cpp:232: Leaving test case "very_bad_foo"
|
||||
xxx/log-formatter-test.cpp:233: Entering test case "very_bad_exception"
|
||||
xxx/log-formatter-test.cpp:182: Leaving test case "very_bad_foo"
|
||||
xxx/log-formatter-test.cpp:183: Entering test case "very_bad_exception"
|
||||
xxx/log-formatter-test.cpp:73: error: in "Fake Test Suite Hierarchy/4 test cases inside/very_bad_exception": with some message
|
||||
Failure occurred in a following context:
|
||||
Context value=something
|
||||
@@ -432,8 +432,8 @@ unknown location:0: fatal error: in "Fake Test Suite Hierarchy/4 test cases insi
|
||||
xxx/log-formatter-test.cpp:73: last checkpoint
|
||||
Failure occurred in a following context:
|
||||
exception context should be shown
|
||||
xxx/log-formatter-test.cpp:233: Leaving test case "very_bad_exception"
|
||||
xxx/log-formatter-test.cpp:234: Entering test case "bad_foo2"
|
||||
xxx/log-formatter-test.cpp:183: Leaving test case "very_bad_exception"
|
||||
xxx/log-formatter-test.cpp:184: Entering test case "bad_foo2"
|
||||
xxx/log-formatter-test.cpp:50: error: in "Fake Test Suite Hierarchy/4 test cases inside/bad_foo2":
|
||||
this is a message
|
||||
xxx/log-formatter-test.cpp:53: info: check true has passed
|
||||
@@ -442,11 +442,11 @@ Failure occurred in a following context:
|
||||
Context value=something
|
||||
Context value2=something different
|
||||
xxx/log-formatter-test.cpp:59: error: in "Fake Test Suite Hierarchy/4 test cases inside/bad_foo2": non sense
|
||||
xxx/log-formatter-test.cpp:234: Leaving test case "bad_foo2"
|
||||
xxx/log-formatter-test.cpp:230: Leaving test suite "4 test cases inside"
|
||||
xxx/log-formatter-test.cpp:184: Leaving test case "bad_foo2"
|
||||
xxx/log-formatter-test.cpp:180: Leaving test suite "4 test cases inside"
|
||||
|
||||
* 2-format *******************************************************************
|
||||
<TestLog><TestSuite name="4 test cases inside" file="xxx/log-formatter-test.cpp" line="230"><TestCase name="bad_foo" file="xxx/log-formatter-test.cpp" line="231"><Error file="xxx/log-formatter-test.cpp" line="50"><![CDATA[]]></Error><Message file="xxx/log-formatter-test.cpp" line="52"><![CDATA[this is a message]]></Message><Info file="xxx/log-formatter-test.cpp" line="53"><![CDATA[check true has passed]]></Info><Error file="xxx/log-formatter-test.cpp" line="57"><![CDATA[with some message]]><Context><Frame><![CDATA[Context value=something]]></Frame><Frame><![CDATA[Context value2=something different]]></Frame></Context></Error><Error file="xxx/log-formatter-test.cpp" line="59"><![CDATA[non sense]]></Error><TestingTime>ZZZ</TestingTime></TestCase><TestCase name="very_bad_foo" file="xxx/log-formatter-test.cpp" line="232"><FatalError file="xxx/log-formatter-test.cpp" line="64"><![CDATA[very_bad_foo is fatal]]><Context><Frame><![CDATA[some context]]></Frame></Context></FatalError><TestingTime>ZZZ</TestingTime></TestCase><TestCase name="very_bad_exception" file="xxx/log-formatter-test.cpp" line="233"><Error file="xxx/log-formatter-test.cpp" line="73"><![CDATA[with some message]]><Context><Frame><![CDATA[Context value=something]]></Frame><Frame><![CDATA[Context value2=something different]]></Frame></Context></Error><Exception file="unknown location" line="0"><![CDATA[unknown type]]><LastCheckpoint file="xxx/log-formatter-test.cpp" line="73"><![CDATA[]]></LastCheckpoint><Context><Frame><![CDATA[exception context should be shown]]></Frame></Context></Exception><TestingTime>ZZZ</TestingTime></TestCase><TestCase name="bad_foo2" file="xxx/log-formatter-test.cpp" line="234"><Error file="xxx/log-formatter-test.cpp" line="50"><![CDATA[]]></Error><Message file="xxx/log-formatter-test.cpp" line="52"><![CDATA[this is a message]]></Message><Info file="xxx/log-formatter-test.cpp" line="53"><![CDATA[check true has passed]]></Info><Error file="xxx/log-formatter-test.cpp" line="57"><![CDATA[with some message]]><Context><Frame><![CDATA[Context value=something]]></Frame><Frame><![CDATA[Context value2=something different]]></Frame></Context></Error><Error file="xxx/log-formatter-test.cpp" line="59"><![CDATA[non sense]]></Error><TestingTime>ZZZ</TestingTime></TestCase></TestSuite></TestLog>
|
||||
<TestLog><TestSuite name="4 test cases inside" file="xxx/log-formatter-test.cpp" line="180"><TestCase name="bad_foo" file="xxx/log-formatter-test.cpp" line="181"><Error file="xxx/log-formatter-test.cpp" line="50"><![CDATA[]]></Error><Message file="xxx/log-formatter-test.cpp" line="52"><![CDATA[this is a message]]></Message><Info file="xxx/log-formatter-test.cpp" line="53"><![CDATA[check true has passed]]></Info><Error file="xxx/log-formatter-test.cpp" line="57"><![CDATA[with some message]]><Context><Frame><![CDATA[Context value=something]]></Frame><Frame><![CDATA[Context value2=something different]]></Frame></Context></Error><Error file="xxx/log-formatter-test.cpp" line="59"><![CDATA[non sense]]></Error><TestingTime>ZZZ</TestingTime></TestCase><TestCase name="very_bad_foo" file="xxx/log-formatter-test.cpp" line="182"><FatalError file="xxx/log-formatter-test.cpp" line="64"><![CDATA[very_bad_foo is fatal]]><Context><Frame><![CDATA[some context]]></Frame></Context></FatalError><TestingTime>ZZZ</TestingTime></TestCase><TestCase name="very_bad_exception" file="xxx/log-formatter-test.cpp" line="183"><Error file="xxx/log-formatter-test.cpp" line="73"><![CDATA[with some message]]><Context><Frame><![CDATA[Context value=something]]></Frame><Frame><![CDATA[Context value2=something different]]></Frame></Context></Error><Exception file="unknown location" line="0"><![CDATA[unknown type]]><LastCheckpoint file="xxx/log-formatter-test.cpp" line="73"><![CDATA[]]></LastCheckpoint><Context><Frame><![CDATA[exception context should be shown]]></Frame></Context></Exception><TestingTime>ZZZ</TestingTime></TestCase><TestCase name="bad_foo2" file="xxx/log-formatter-test.cpp" line="184"><Error file="xxx/log-formatter-test.cpp" line="50"><![CDATA[]]></Error><Message file="xxx/log-formatter-test.cpp" line="52"><![CDATA[this is a message]]></Message><Info file="xxx/log-formatter-test.cpp" line="53"><![CDATA[check true has passed]]></Info><Error file="xxx/log-formatter-test.cpp" line="57"><![CDATA[with some message]]><Context><Frame><![CDATA[Context value=something]]></Frame><Frame><![CDATA[Context value2=something different]]></Frame></Context></Error><Error file="xxx/log-formatter-test.cpp" line="59"><![CDATA[non sense]]></Error><TestingTime>ZZZ</TestingTime></TestCase></TestSuite></TestLog>
|
||||
* 3-format *******************************************************************
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<testsuite tests="4" skipped="0" errors="2" failures="2" id="0" name="4_test_cases_inside" time="0.1234">
|
||||
@@ -487,7 +487,7 @@ INFO:
|
||||
<system-err><![CDATA[Failures detected in:
|
||||
- test case: Fake Test Suite Hierarchy/4 test cases inside/bad_foo
|
||||
- file: log-formatter-test.cpp
|
||||
- line: 231
|
||||
- line: 181
|
||||
]]></system-err>
|
||||
</testcase>
|
||||
<testcase assertions="1" name="very_bad_foo" time="0.1234">
|
||||
@@ -503,7 +503,7 @@ ASSERTION FAILURE:
|
||||
]]></failure><system-err><![CDATA[Failures detected in:
|
||||
- test case: Fake Test Suite Hierarchy/4 test cases inside/very_bad_foo
|
||||
- file: log-formatter-test.cpp
|
||||
- line: 232
|
||||
- line: 182
|
||||
]]></system-err>
|
||||
</testcase>
|
||||
<testcase assertions="2" name="very_bad_exception" time="0.1234">
|
||||
@@ -538,7 +538,7 @@ CONTEXT:
|
||||
]]></error><system-err><![CDATA[Failures detected in:
|
||||
- test case: Fake Test Suite Hierarchy/4 test cases inside/very_bad_exception
|
||||
- file: log-formatter-test.cpp
|
||||
- line: 233
|
||||
- line: 183
|
||||
]]></system-err>
|
||||
</testcase>
|
||||
<testcase assertions="4" name="bad_foo2" time="0.1234">
|
||||
@@ -578,7 +578,7 @@ INFO:
|
||||
<system-err><![CDATA[Failures detected in:
|
||||
- test case: Fake Test Suite Hierarchy/4 test cases inside/bad_foo2
|
||||
- file: log-formatter-test.cpp
|
||||
- line: 234
|
||||
- line: 184
|
||||
]]></system-err>
|
||||
</testcase>
|
||||
</testsuite>
|
||||
@@ -611,7 +611,7 @@ ASSERTION FAILURE:
|
||||
]]></failure><system-err><![CDATA[Failures detected in:
|
||||
- test case: Fake Test Suite Hierarchy/4 test cases inside/bad_foo
|
||||
- file: log-formatter-test.cpp
|
||||
- line: 231
|
||||
- line: 181
|
||||
]]></system-err>
|
||||
</testcase>
|
||||
<testcase assertions="1" name="very_bad_foo" time="0.1234">
|
||||
@@ -627,7 +627,7 @@ ASSERTION FAILURE:
|
||||
]]></failure><system-err><![CDATA[Failures detected in:
|
||||
- test case: Fake Test Suite Hierarchy/4 test cases inside/very_bad_foo
|
||||
- file: log-formatter-test.cpp
|
||||
- line: 232
|
||||
- line: 182
|
||||
]]></system-err>
|
||||
</testcase>
|
||||
<testcase assertions="2" name="very_bad_exception" time="0.1234">
|
||||
@@ -662,7 +662,7 @@ CONTEXT:
|
||||
]]></error><system-err><![CDATA[Failures detected in:
|
||||
- test case: Fake Test Suite Hierarchy/4 test cases inside/very_bad_exception
|
||||
- file: log-formatter-test.cpp
|
||||
- line: 233
|
||||
- line: 183
|
||||
]]></system-err>
|
||||
</testcase>
|
||||
<testcase assertions="4" name="bad_foo2" time="0.1234">
|
||||
@@ -691,19 +691,19 @@ ASSERTION FAILURE:
|
||||
]]></failure><system-err><![CDATA[Failures detected in:
|
||||
- test case: Fake Test Suite Hierarchy/4 test cases inside/bad_foo2
|
||||
- file: log-formatter-test.cpp
|
||||
- line: 234
|
||||
- line: 184
|
||||
]]></system-err>
|
||||
</testcase>
|
||||
</testsuite>
|
||||
* 1-format *******************************************************************
|
||||
Running 11 test cases...
|
||||
xxx/log-formatter-test.cpp:236: Entering test suite "Fake Test Suite Hierarchy"
|
||||
xxx/log-formatter-test.cpp:207: Test suite "Fake Test Suite Hierarchy/0 test cases inside" is skipped because disabled
|
||||
xxx/log-formatter-test.cpp:209: Entering test suite "1 test cases inside"
|
||||
xxx/log-formatter-test.cpp:210: Entering test case "good_foo"
|
||||
xxx/log-formatter-test.cpp:186: Entering test suite "Fake Test Suite Hierarchy"
|
||||
xxx/log-formatter-test.cpp:157: Test suite "Fake Test Suite Hierarchy/0 test cases inside" is skipped because disabled
|
||||
xxx/log-formatter-test.cpp:159: Entering test suite "1 test cases inside"
|
||||
xxx/log-formatter-test.cpp:160: Entering test case "good_foo"
|
||||
Test case Fake Test Suite Hierarchy/1 test cases inside/good_foo did not check any assertions
|
||||
xxx/log-formatter-test.cpp:210: Leaving test case "good_foo"
|
||||
xxx/log-formatter-test.cpp:269: Entering test case "bad_foo"
|
||||
xxx/log-formatter-test.cpp:160: Leaving test case "good_foo"
|
||||
xxx/log-formatter-test.cpp:219: Entering test case "bad_foo"
|
||||
xxx/log-formatter-test.cpp:50: error: in "Fake Test Suite Hierarchy/1 test cases inside/bad_foo":
|
||||
this is a message
|
||||
xxx/log-formatter-test.cpp:53: info: check true has passed
|
||||
@@ -712,13 +712,13 @@ Failure occurred in a following context:
|
||||
Context value=something
|
||||
Context value2=something different
|
||||
xxx/log-formatter-test.cpp:59: error: in "Fake Test Suite Hierarchy/1 test cases inside/bad_foo": non sense
|
||||
xxx/log-formatter-test.cpp:269: Leaving test case "bad_foo"
|
||||
xxx/log-formatter-test.cpp:209: Leaving test suite "1 test cases inside"
|
||||
xxx/log-formatter-test.cpp:218: Entering test suite "2 test cases inside"
|
||||
xxx/log-formatter-test.cpp:219: Entering test case "good_foo"
|
||||
xxx/log-formatter-test.cpp:219: Leaving test case "bad_foo"
|
||||
xxx/log-formatter-test.cpp:159: Leaving test suite "1 test cases inside"
|
||||
xxx/log-formatter-test.cpp:168: Entering test suite "2 test cases inside"
|
||||
xxx/log-formatter-test.cpp:169: Entering test case "good_foo"
|
||||
Test case Fake Test Suite Hierarchy/2 test cases inside/good_foo did not check any assertions
|
||||
xxx/log-formatter-test.cpp:219: Leaving test case "good_foo"
|
||||
xxx/log-formatter-test.cpp:220: Entering test case "bad_foo"
|
||||
xxx/log-formatter-test.cpp:169: Leaving test case "good_foo"
|
||||
xxx/log-formatter-test.cpp:170: Entering test case "bad_foo"
|
||||
xxx/log-formatter-test.cpp:50: error: in "Fake Test Suite Hierarchy/2 test cases inside/bad_foo":
|
||||
this is a message
|
||||
xxx/log-formatter-test.cpp:53: info: check true has passed
|
||||
@@ -727,10 +727,10 @@ Failure occurred in a following context:
|
||||
Context value=something
|
||||
Context value2=something different
|
||||
xxx/log-formatter-test.cpp:59: error: in "Fake Test Suite Hierarchy/2 test cases inside/bad_foo": non sense
|
||||
xxx/log-formatter-test.cpp:220: Leaving test case "bad_foo"
|
||||
xxx/log-formatter-test.cpp:218: Leaving test suite "2 test cases inside"
|
||||
xxx/log-formatter-test.cpp:230: Entering test suite "4 test cases inside"
|
||||
xxx/log-formatter-test.cpp:231: Entering test case "bad_foo"
|
||||
xxx/log-formatter-test.cpp:170: Leaving test case "bad_foo"
|
||||
xxx/log-formatter-test.cpp:168: Leaving test suite "2 test cases inside"
|
||||
xxx/log-formatter-test.cpp:180: Entering test suite "4 test cases inside"
|
||||
xxx/log-formatter-test.cpp:181: Entering test case "bad_foo"
|
||||
xxx/log-formatter-test.cpp:50: error: in "Fake Test Suite Hierarchy/4 test cases inside/bad_foo":
|
||||
this is a message
|
||||
xxx/log-formatter-test.cpp:53: info: check true has passed
|
||||
@@ -739,13 +739,13 @@ Failure occurred in a following context:
|
||||
Context value=something
|
||||
Context value2=something different
|
||||
xxx/log-formatter-test.cpp:59: error: in "Fake Test Suite Hierarchy/4 test cases inside/bad_foo": non sense
|
||||
xxx/log-formatter-test.cpp:231: Leaving test case "bad_foo"
|
||||
xxx/log-formatter-test.cpp:232: Entering test case "very_bad_foo"
|
||||
xxx/log-formatter-test.cpp:181: Leaving test case "bad_foo"
|
||||
xxx/log-formatter-test.cpp:182: Entering test case "very_bad_foo"
|
||||
xxx/log-formatter-test.cpp:64: fatal error: in "Fake Test Suite Hierarchy/4 test cases inside/very_bad_foo": very_bad_foo is fatal
|
||||
Failure occurred in a following context:
|
||||
some context
|
||||
xxx/log-formatter-test.cpp:232: Leaving test case "very_bad_foo"
|
||||
xxx/log-formatter-test.cpp:233: Entering test case "very_bad_exception"
|
||||
xxx/log-formatter-test.cpp:182: Leaving test case "very_bad_foo"
|
||||
xxx/log-formatter-test.cpp:183: Entering test case "very_bad_exception"
|
||||
xxx/log-formatter-test.cpp:73: error: in "Fake Test Suite Hierarchy/4 test cases inside/very_bad_exception": with some message
|
||||
Failure occurred in a following context:
|
||||
Context value=something
|
||||
@@ -754,8 +754,8 @@ unknown location:0: fatal error: in "Fake Test Suite Hierarchy/4 test cases insi
|
||||
xxx/log-formatter-test.cpp:73: last checkpoint
|
||||
Failure occurred in a following context:
|
||||
exception context should be shown
|
||||
xxx/log-formatter-test.cpp:233: Leaving test case "very_bad_exception"
|
||||
xxx/log-formatter-test.cpp:234: Entering test case "bad_foo2"
|
||||
xxx/log-formatter-test.cpp:183: Leaving test case "very_bad_exception"
|
||||
xxx/log-formatter-test.cpp:184: Entering test case "bad_foo2"
|
||||
xxx/log-formatter-test.cpp:50: error: in "Fake Test Suite Hierarchy/4 test cases inside/bad_foo2":
|
||||
this is a message
|
||||
xxx/log-formatter-test.cpp:53: info: check true has passed
|
||||
@@ -764,13 +764,13 @@ Failure occurred in a following context:
|
||||
Context value=something
|
||||
Context value2=something different
|
||||
xxx/log-formatter-test.cpp:59: error: in "Fake Test Suite Hierarchy/4 test cases inside/bad_foo2": non sense
|
||||
xxx/log-formatter-test.cpp:234: Leaving test case "bad_foo2"
|
||||
xxx/log-formatter-test.cpp:230: Leaving test suite "4 test cases inside"
|
||||
xxx/log-formatter-test.cpp:222: Test suite "Fake Test Suite Hierarchy/3 test cases inside" is skipped because dependency test suite "Fake Test Suite Hierarchy/1 test cases inside" has failed
|
||||
xxx/log-formatter-test.cpp:236: Leaving test suite "Fake Test Suite Hierarchy"
|
||||
xxx/log-formatter-test.cpp:184: Leaving test case "bad_foo2"
|
||||
xxx/log-formatter-test.cpp:180: Leaving test suite "4 test cases inside"
|
||||
xxx/log-formatter-test.cpp:172: Test suite "Fake Test Suite Hierarchy/3 test cases inside" is skipped because dependency test suite "Fake Test Suite Hierarchy/1 test cases inside" has failed
|
||||
xxx/log-formatter-test.cpp:186: Leaving test suite "Fake Test Suite Hierarchy"
|
||||
|
||||
* 2-format *******************************************************************
|
||||
<TestLog><TestSuite name="Fake Test Suite Hierarchy" file="xxx/log-formatter-test.cpp" line="236"><TestSuite name="0 test cases inside" skipped="yes" reason="disabled"/><TestSuite name="1 test cases inside" file="xxx/log-formatter-test.cpp" line="209"><TestCase name="good_foo" file="xxx/log-formatter-test.cpp" line="210"><Message file="boost.test framework" line="0"><![CDATA[Test case Fake Test Suite Hierarchy/1 test cases inside/good_foo did not check any assertions]]></Message><TestingTime>ZZZ</TestingTime></TestCase><TestCase name="bad_foo" file="xxx/log-formatter-test.cpp" line="269"><Error file="xxx/log-formatter-test.cpp" line="50"><![CDATA[]]></Error><Message file="xxx/log-formatter-test.cpp" line="52"><![CDATA[this is a message]]></Message><Info file="xxx/log-formatter-test.cpp" line="53"><![CDATA[check true has passed]]></Info><Error file="xxx/log-formatter-test.cpp" line="57"><![CDATA[with some message]]><Context><Frame><![CDATA[Context value=something]]></Frame><Frame><![CDATA[Context value2=something different]]></Frame></Context></Error><Error file="xxx/log-formatter-test.cpp" line="59"><![CDATA[non sense]]></Error><TestingTime>ZZZ</TestingTime></TestCase></TestSuite><TestSuite name="2 test cases inside" file="xxx/log-formatter-test.cpp" line="218"><TestCase name="good_foo" file="xxx/log-formatter-test.cpp" line="219"><Message file="boost.test framework" line="0"><![CDATA[Test case Fake Test Suite Hierarchy/2 test cases inside/good_foo did not check any assertions]]></Message><TestingTime>ZZZ</TestingTime></TestCase><TestCase name="bad_foo" file="xxx/log-formatter-test.cpp" line="220"><Error file="xxx/log-formatter-test.cpp" line="50"><![CDATA[]]></Error><Message file="xxx/log-formatter-test.cpp" line="52"><![CDATA[this is a message]]></Message><Info file="xxx/log-formatter-test.cpp" line="53"><![CDATA[check true has passed]]></Info><Error file="xxx/log-formatter-test.cpp" line="57"><![CDATA[with some message]]><Context><Frame><![CDATA[Context value=something]]></Frame><Frame><![CDATA[Context value2=something different]]></Frame></Context></Error><Error file="xxx/log-formatter-test.cpp" line="59"><![CDATA[non sense]]></Error><TestingTime>ZZZ</TestingTime></TestCase></TestSuite><TestSuite name="4 test cases inside" file="xxx/log-formatter-test.cpp" line="230"><TestCase name="bad_foo" file="xxx/log-formatter-test.cpp" line="231"><Error file="xxx/log-formatter-test.cpp" line="50"><![CDATA[]]></Error><Message file="xxx/log-formatter-test.cpp" line="52"><![CDATA[this is a message]]></Message><Info file="xxx/log-formatter-test.cpp" line="53"><![CDATA[check true has passed]]></Info><Error file="xxx/log-formatter-test.cpp" line="57"><![CDATA[with some message]]><Context><Frame><![CDATA[Context value=something]]></Frame><Frame><![CDATA[Context value2=something different]]></Frame></Context></Error><Error file="xxx/log-formatter-test.cpp" line="59"><![CDATA[non sense]]></Error><TestingTime>ZZZ</TestingTime></TestCase><TestCase name="very_bad_foo" file="xxx/log-formatter-test.cpp" line="232"><FatalError file="xxx/log-formatter-test.cpp" line="64"><![CDATA[very_bad_foo is fatal]]><Context><Frame><![CDATA[some context]]></Frame></Context></FatalError><TestingTime>ZZZ</TestingTime></TestCase><TestCase name="very_bad_exception" file="xxx/log-formatter-test.cpp" line="233"><Error file="xxx/log-formatter-test.cpp" line="73"><![CDATA[with some message]]><Context><Frame><![CDATA[Context value=something]]></Frame><Frame><![CDATA[Context value2=something different]]></Frame></Context></Error><Exception file="unknown location" line="0"><![CDATA[unknown type]]><LastCheckpoint file="xxx/log-formatter-test.cpp" line="73"><![CDATA[]]></LastCheckpoint><Context><Frame><![CDATA[exception context should be shown]]></Frame></Context></Exception><TestingTime>ZZZ</TestingTime></TestCase><TestCase name="bad_foo2" file="xxx/log-formatter-test.cpp" line="234"><Error file="xxx/log-formatter-test.cpp" line="50"><![CDATA[]]></Error><Message file="xxx/log-formatter-test.cpp" line="52"><![CDATA[this is a message]]></Message><Info file="xxx/log-formatter-test.cpp" line="53"><![CDATA[check true has passed]]></Info><Error file="xxx/log-formatter-test.cpp" line="57"><![CDATA[with some message]]><Context><Frame><![CDATA[Context value=something]]></Frame><Frame><![CDATA[Context value2=something different]]></Frame></Context></Error><Error file="xxx/log-formatter-test.cpp" line="59"><![CDATA[non sense]]></Error><TestingTime>ZZZ</TestingTime></TestCase></TestSuite><TestSuite name="3 test cases inside" skipped="yes" reason="dependency test suite "Fake Test Suite Hierarchy/1 test cases inside" has failed"/></TestSuite></TestLog>
|
||||
<TestLog><TestSuite name="Fake Test Suite Hierarchy" file="xxx/log-formatter-test.cpp" line="186"><TestSuite name="0 test cases inside" skipped="yes" reason="disabled"/><TestSuite name="1 test cases inside" file="xxx/log-formatter-test.cpp" line="159"><TestCase name="good_foo" file="xxx/log-formatter-test.cpp" line="160"><Message file="boost.test framework" line="0"><![CDATA[Test case Fake Test Suite Hierarchy/1 test cases inside/good_foo did not check any assertions]]></Message><TestingTime>ZZZ</TestingTime></TestCase><TestCase name="bad_foo" file="xxx/log-formatter-test.cpp" line="219"><Error file="xxx/log-formatter-test.cpp" line="50"><![CDATA[]]></Error><Message file="xxx/log-formatter-test.cpp" line="52"><![CDATA[this is a message]]></Message><Info file="xxx/log-formatter-test.cpp" line="53"><![CDATA[check true has passed]]></Info><Error file="xxx/log-formatter-test.cpp" line="57"><![CDATA[with some message]]><Context><Frame><![CDATA[Context value=something]]></Frame><Frame><![CDATA[Context value2=something different]]></Frame></Context></Error><Error file="xxx/log-formatter-test.cpp" line="59"><![CDATA[non sense]]></Error><TestingTime>ZZZ</TestingTime></TestCase></TestSuite><TestSuite name="2 test cases inside" file="xxx/log-formatter-test.cpp" line="168"><TestCase name="good_foo" file="xxx/log-formatter-test.cpp" line="169"><Message file="boost.test framework" line="0"><![CDATA[Test case Fake Test Suite Hierarchy/2 test cases inside/good_foo did not check any assertions]]></Message><TestingTime>ZZZ</TestingTime></TestCase><TestCase name="bad_foo" file="xxx/log-formatter-test.cpp" line="170"><Error file="xxx/log-formatter-test.cpp" line="50"><![CDATA[]]></Error><Message file="xxx/log-formatter-test.cpp" line="52"><![CDATA[this is a message]]></Message><Info file="xxx/log-formatter-test.cpp" line="53"><![CDATA[check true has passed]]></Info><Error file="xxx/log-formatter-test.cpp" line="57"><![CDATA[with some message]]><Context><Frame><![CDATA[Context value=something]]></Frame><Frame><![CDATA[Context value2=something different]]></Frame></Context></Error><Error file="xxx/log-formatter-test.cpp" line="59"><![CDATA[non sense]]></Error><TestingTime>ZZZ</TestingTime></TestCase></TestSuite><TestSuite name="4 test cases inside" file="xxx/log-formatter-test.cpp" line="180"><TestCase name="bad_foo" file="xxx/log-formatter-test.cpp" line="181"><Error file="xxx/log-formatter-test.cpp" line="50"><![CDATA[]]></Error><Message file="xxx/log-formatter-test.cpp" line="52"><![CDATA[this is a message]]></Message><Info file="xxx/log-formatter-test.cpp" line="53"><![CDATA[check true has passed]]></Info><Error file="xxx/log-formatter-test.cpp" line="57"><![CDATA[with some message]]><Context><Frame><![CDATA[Context value=something]]></Frame><Frame><![CDATA[Context value2=something different]]></Frame></Context></Error><Error file="xxx/log-formatter-test.cpp" line="59"><![CDATA[non sense]]></Error><TestingTime>ZZZ</TestingTime></TestCase><TestCase name="very_bad_foo" file="xxx/log-formatter-test.cpp" line="182"><FatalError file="xxx/log-formatter-test.cpp" line="64"><![CDATA[very_bad_foo is fatal]]><Context><Frame><![CDATA[some context]]></Frame></Context></FatalError><TestingTime>ZZZ</TestingTime></TestCase><TestCase name="very_bad_exception" file="xxx/log-formatter-test.cpp" line="183"><Error file="xxx/log-formatter-test.cpp" line="73"><![CDATA[with some message]]><Context><Frame><![CDATA[Context value=something]]></Frame><Frame><![CDATA[Context value2=something different]]></Frame></Context></Error><Exception file="unknown location" line="0"><![CDATA[unknown type]]><LastCheckpoint file="xxx/log-formatter-test.cpp" line="73"><![CDATA[]]></LastCheckpoint><Context><Frame><![CDATA[exception context should be shown]]></Frame></Context></Exception><TestingTime>ZZZ</TestingTime></TestCase><TestCase name="bad_foo2" file="xxx/log-formatter-test.cpp" line="184"><Error file="xxx/log-formatter-test.cpp" line="50"><![CDATA[]]></Error><Message file="xxx/log-formatter-test.cpp" line="52"><![CDATA[this is a message]]></Message><Info file="xxx/log-formatter-test.cpp" line="53"><![CDATA[check true has passed]]></Info><Error file="xxx/log-formatter-test.cpp" line="57"><![CDATA[with some message]]><Context><Frame><![CDATA[Context value=something]]></Frame><Frame><![CDATA[Context value2=something different]]></Frame></Context></Error><Error file="xxx/log-formatter-test.cpp" line="59"><![CDATA[non sense]]></Error><TestingTime>ZZZ</TestingTime></TestCase></TestSuite><TestSuite name="3 test cases inside" skipped="yes" reason="dependency test suite "Fake Test Suite Hierarchy/1 test cases inside" has failed"/></TestSuite></TestLog>
|
||||
* 3-format *******************************************************************
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<testsuite tests="8" skipped="3" errors="2" failures="4" id="0" name="Fake_Test_Suite_Hierarchy" time="0.1234">
|
||||
@@ -819,7 +819,7 @@ INFO:
|
||||
<system-err><![CDATA[Failures detected in:
|
||||
- test case: Fake Test Suite Hierarchy/1 test cases inside/bad_foo
|
||||
- file: log-formatter-test.cpp
|
||||
- line: 269
|
||||
- line: 219
|
||||
]]></system-err>
|
||||
</testcase>
|
||||
<testcase assertions="0" classname="2_test_cases_inside" name="good_foo" time="0.1234">
|
||||
@@ -867,7 +867,7 @@ INFO:
|
||||
<system-err><![CDATA[Failures detected in:
|
||||
- test case: Fake Test Suite Hierarchy/2 test cases inside/bad_foo
|
||||
- file: log-formatter-test.cpp
|
||||
- line: 220
|
||||
- line: 170
|
||||
]]></system-err>
|
||||
</testcase>
|
||||
<testcase assertions="0" classname="3_test_cases_inside" name="bad_foo" time="0.1234">
|
||||
@@ -928,7 +928,7 @@ INFO:
|
||||
<system-err><![CDATA[Failures detected in:
|
||||
- test case: Fake Test Suite Hierarchy/4 test cases inside/bad_foo
|
||||
- file: log-formatter-test.cpp
|
||||
- line: 231
|
||||
- line: 181
|
||||
]]></system-err>
|
||||
</testcase>
|
||||
<testcase assertions="1" classname="4_test_cases_inside" name="very_bad_foo" time="0.1234">
|
||||
@@ -944,7 +944,7 @@ ASSERTION FAILURE:
|
||||
]]></failure><system-err><![CDATA[Failures detected in:
|
||||
- test case: Fake Test Suite Hierarchy/4 test cases inside/very_bad_foo
|
||||
- file: log-formatter-test.cpp
|
||||
- line: 232
|
||||
- line: 182
|
||||
]]></system-err>
|
||||
</testcase>
|
||||
<testcase assertions="2" classname="4_test_cases_inside" name="very_bad_exception" time="0.1234">
|
||||
@@ -979,7 +979,7 @@ CONTEXT:
|
||||
]]></error><system-err><![CDATA[Failures detected in:
|
||||
- test case: Fake Test Suite Hierarchy/4 test cases inside/very_bad_exception
|
||||
- file: log-formatter-test.cpp
|
||||
- line: 233
|
||||
- line: 183
|
||||
]]></system-err>
|
||||
</testcase>
|
||||
<testcase assertions="4" classname="4_test_cases_inside" name="bad_foo2" time="0.1234">
|
||||
@@ -1019,7 +1019,7 @@ INFO:
|
||||
<system-err><![CDATA[Failures detected in:
|
||||
- test case: Fake Test Suite Hierarchy/4 test cases inside/bad_foo2
|
||||
- file: log-formatter-test.cpp
|
||||
- line: 234
|
||||
- line: 184
|
||||
]]></system-err>
|
||||
</testcase>
|
||||
</testsuite>
|
||||
@@ -1054,7 +1054,7 @@ ASSERTION FAILURE:
|
||||
]]></failure><system-err><![CDATA[Failures detected in:
|
||||
- test case: Fake Test Suite Hierarchy/1 test cases inside/bad_foo
|
||||
- file: log-formatter-test.cpp
|
||||
- line: 269
|
||||
- line: 219
|
||||
]]></system-err>
|
||||
</testcase>
|
||||
<testcase assertions="0" classname="2_test_cases_inside" name="good_foo" time="0.1234">
|
||||
@@ -1085,7 +1085,7 @@ ASSERTION FAILURE:
|
||||
]]></failure><system-err><![CDATA[Failures detected in:
|
||||
- test case: Fake Test Suite Hierarchy/2 test cases inside/bad_foo
|
||||
- file: log-formatter-test.cpp
|
||||
- line: 220
|
||||
- line: 170
|
||||
]]></system-err>
|
||||
</testcase>
|
||||
<testcase assertions="0" classname="3_test_cases_inside" name="bad_foo" time="0.1234">
|
||||
@@ -1135,7 +1135,7 @@ ASSERTION FAILURE:
|
||||
]]></failure><system-err><![CDATA[Failures detected in:
|
||||
- test case: Fake Test Suite Hierarchy/4 test cases inside/bad_foo
|
||||
- file: log-formatter-test.cpp
|
||||
- line: 231
|
||||
- line: 181
|
||||
]]></system-err>
|
||||
</testcase>
|
||||
<testcase assertions="1" classname="4_test_cases_inside" name="very_bad_foo" time="0.1234">
|
||||
@@ -1151,7 +1151,7 @@ ASSERTION FAILURE:
|
||||
]]></failure><system-err><![CDATA[Failures detected in:
|
||||
- test case: Fake Test Suite Hierarchy/4 test cases inside/very_bad_foo
|
||||
- file: log-formatter-test.cpp
|
||||
- line: 232
|
||||
- line: 182
|
||||
]]></system-err>
|
||||
</testcase>
|
||||
<testcase assertions="2" classname="4_test_cases_inside" name="very_bad_exception" time="0.1234">
|
||||
@@ -1186,7 +1186,7 @@ CONTEXT:
|
||||
]]></error><system-err><![CDATA[Failures detected in:
|
||||
- test case: Fake Test Suite Hierarchy/4 test cases inside/very_bad_exception
|
||||
- file: log-formatter-test.cpp
|
||||
- line: 233
|
||||
- line: 183
|
||||
]]></system-err>
|
||||
</testcase>
|
||||
<testcase assertions="4" classname="4_test_cases_inside" name="bad_foo2" time="0.1234">
|
||||
@@ -1215,23 +1215,23 @@ ASSERTION FAILURE:
|
||||
]]></failure><system-err><![CDATA[Failures detected in:
|
||||
- test case: Fake Test Suite Hierarchy/4 test cases inside/bad_foo2
|
||||
- file: log-formatter-test.cpp
|
||||
- line: 234
|
||||
- line: 184
|
||||
]]></system-err>
|
||||
</testcase>
|
||||
</testsuite>
|
||||
* 1-format *******************************************************************
|
||||
Running 2 test cases...
|
||||
xxx/log-formatter-test.cpp:243: Entering test suite "Timeout"
|
||||
xxx/log-formatter-test.cpp:244: Entering test case "good_foo"
|
||||
xxx/log-formatter-test.cpp:193: Entering test suite "Timeout"
|
||||
xxx/log-formatter-test.cpp:194: Entering test case "good_foo"
|
||||
Test case Timeout/good_foo did not check any assertions
|
||||
xxx/log-formatter-test.cpp:244: Leaving test case "good_foo"
|
||||
xxx/log-formatter-test.cpp:245: Entering test case "timeout_foo"
|
||||
xxx/log-formatter-test.cpp:194: Leaving test case "good_foo"
|
||||
xxx/log-formatter-test.cpp:195: Entering test case "timeout_foo"
|
||||
unknown location:0: fatal error: in "Timeout/timeout_foo": fake timeout
|
||||
xxx/log-formatter-test.cpp:245: Leaving test case "timeout_foo"
|
||||
xxx/log-formatter-test.cpp:243: Leaving test suite "Timeout"
|
||||
xxx/log-formatter-test.cpp:195: Leaving test case "timeout_foo"
|
||||
xxx/log-formatter-test.cpp:193: Leaving test suite "Timeout"
|
||||
|
||||
* 2-format *******************************************************************
|
||||
<TestLog><TestSuite name="Timeout" file="xxx/log-formatter-test.cpp" line="243"><TestCase name="good_foo" file="xxx/log-formatter-test.cpp" line="244"><Message file="boost.test framework" line="0"><![CDATA[Test case Timeout/good_foo did not check any assertions]]></Message><TestingTime>ZZZ</TestingTime></TestCase><TestCase name="timeout_foo" file="xxx/log-formatter-test.cpp" line="245"><Exception file="unknown location" line="0"><![CDATA[fake timeout]]></Exception><TestingTime>ZZZ</TestingTime></TestCase></TestSuite></TestLog>
|
||||
<TestLog><TestSuite name="Timeout" file="xxx/log-formatter-test.cpp" line="193"><TestCase name="good_foo" file="xxx/log-formatter-test.cpp" line="194"><Message file="boost.test framework" line="0"><![CDATA[Test case Timeout/good_foo did not check any assertions]]></Message><TestingTime>ZZZ</TestingTime></TestCase><TestCase name="timeout_foo" file="xxx/log-formatter-test.cpp" line="195"><Exception file="unknown location" line="0"><![CDATA[fake timeout]]></Exception><TestingTime>ZZZ</TestingTime></TestCase></TestSuite></TestLog>
|
||||
* 3-format *******************************************************************
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<testsuite tests="1" skipped="0" errors="0" failures="1" id="0" name="Timeout" time="0.1234">
|
||||
@@ -1255,7 +1255,7 @@ fake timeout
|
||||
-------------------------------------]]></error><system-err><![CDATA[Failures detected in:
|
||||
- test case: Timeout/timeout_foo
|
||||
- file: log-formatter-test.cpp
|
||||
- line: 245
|
||||
- line: 195
|
||||
]]></system-err>
|
||||
</testcase>
|
||||
</testsuite>
|
||||
@@ -1276,31 +1276,31 @@ fake timeout
|
||||
-------------------------------------]]></error><system-err><![CDATA[Failures detected in:
|
||||
- test case: Timeout/timeout_foo
|
||||
- file: log-formatter-test.cpp
|
||||
- line: 245
|
||||
- line: 195
|
||||
]]></system-err>
|
||||
</testcase>
|
||||
</testsuite>
|
||||
* 1-format *******************************************************************
|
||||
Running 4 test cases...
|
||||
xxx/log-formatter-test.cpp:248: Entering test suite "Timeout-nested"
|
||||
xxx/log-formatter-test.cpp:249: Entering test case "good_foo"
|
||||
xxx/log-formatter-test.cpp:198: Entering test suite "Timeout-nested"
|
||||
xxx/log-formatter-test.cpp:199: Entering test case "good_foo"
|
||||
Test case Timeout-nested/good_foo did not check any assertions
|
||||
xxx/log-formatter-test.cpp:249: Leaving test case "good_foo"
|
||||
xxx/log-formatter-test.cpp:250: Entering test suite "Timeout"
|
||||
xxx/log-formatter-test.cpp:251: Entering test case "good_foo"
|
||||
xxx/log-formatter-test.cpp:199: Leaving test case "good_foo"
|
||||
xxx/log-formatter-test.cpp:200: Entering test suite "Timeout"
|
||||
xxx/log-formatter-test.cpp:201: Entering test case "good_foo"
|
||||
Test case Timeout-nested/Timeout/good_foo did not check any assertions
|
||||
xxx/log-formatter-test.cpp:251: Leaving test case "good_foo"
|
||||
xxx/log-formatter-test.cpp:252: Entering test case "timeout_foo"
|
||||
xxx/log-formatter-test.cpp:201: Leaving test case "good_foo"
|
||||
xxx/log-formatter-test.cpp:202: Entering test case "timeout_foo"
|
||||
unknown location:0: fatal error: in "Timeout-nested/Timeout/timeout_foo": fake timeout
|
||||
xxx/log-formatter-test.cpp:252: Leaving test case "timeout_foo"
|
||||
xxx/log-formatter-test.cpp:250: Leaving test suite "Timeout"
|
||||
xxx/log-formatter-test.cpp:255: Entering test case "good_foo2"
|
||||
xxx/log-formatter-test.cpp:202: Leaving test case "timeout_foo"
|
||||
xxx/log-formatter-test.cpp:200: Leaving test suite "Timeout"
|
||||
xxx/log-formatter-test.cpp:205: Entering test case "good_foo2"
|
||||
Test case Timeout-nested/good_foo2 did not check any assertions
|
||||
xxx/log-formatter-test.cpp:255: Leaving test case "good_foo2"
|
||||
xxx/log-formatter-test.cpp:248: Leaving test suite "Timeout-nested"
|
||||
xxx/log-formatter-test.cpp:205: Leaving test case "good_foo2"
|
||||
xxx/log-formatter-test.cpp:198: Leaving test suite "Timeout-nested"
|
||||
|
||||
* 2-format *******************************************************************
|
||||
<TestLog><TestSuite name="Timeout-nested" file="xxx/log-formatter-test.cpp" line="248"><TestCase name="good_foo" file="xxx/log-formatter-test.cpp" line="249"><Message file="boost.test framework" line="0"><![CDATA[Test case Timeout-nested/good_foo did not check any assertions]]></Message><TestingTime>ZZZ</TestingTime></TestCase><TestSuite name="Timeout" file="xxx/log-formatter-test.cpp" line="250"><TestCase name="good_foo" file="xxx/log-formatter-test.cpp" line="251"><Message file="boost.test framework" line="0"><![CDATA[Test case Timeout-nested/Timeout/good_foo did not check any assertions]]></Message><TestingTime>ZZZ</TestingTime></TestCase><TestCase name="timeout_foo" file="xxx/log-formatter-test.cpp" line="252"><Exception file="unknown location" line="0"><![CDATA[fake timeout]]></Exception><TestingTime>ZZZ</TestingTime></TestCase></TestSuite><TestCase name="good_foo2" file="xxx/log-formatter-test.cpp" line="255"><Message file="boost.test framework" line="0"><![CDATA[Test case Timeout-nested/good_foo2 did not check any assertions]]></Message><TestingTime>ZZZ</TestingTime></TestCase></TestSuite></TestLog>
|
||||
<TestLog><TestSuite name="Timeout-nested" file="xxx/log-formatter-test.cpp" line="198"><TestCase name="good_foo" file="xxx/log-formatter-test.cpp" line="199"><Message file="boost.test framework" line="0"><![CDATA[Test case Timeout-nested/good_foo did not check any assertions]]></Message><TestingTime>ZZZ</TestingTime></TestCase><TestSuite name="Timeout" file="xxx/log-formatter-test.cpp" line="200"><TestCase name="good_foo" file="xxx/log-formatter-test.cpp" line="201"><Message file="boost.test framework" line="0"><![CDATA[Test case Timeout-nested/Timeout/good_foo did not check any assertions]]></Message><TestingTime>ZZZ</TestingTime></TestCase><TestCase name="timeout_foo" file="xxx/log-formatter-test.cpp" line="202"><Exception file="unknown location" line="0"><![CDATA[fake timeout]]></Exception><TestingTime>ZZZ</TestingTime></TestCase></TestSuite><TestCase name="good_foo2" file="xxx/log-formatter-test.cpp" line="205"><Message file="boost.test framework" line="0"><![CDATA[Test case Timeout-nested/good_foo2 did not check any assertions]]></Message><TestingTime>ZZZ</TestingTime></TestCase></TestSuite></TestLog>
|
||||
* 3-format *******************************************************************
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<testsuite tests="3" skipped="0" errors="0" failures="1" id="0" name="Timeout-nested" time="0.1234">
|
||||
@@ -1332,7 +1332,7 @@ fake timeout
|
||||
-------------------------------------]]></error><system-err><![CDATA[Failures detected in:
|
||||
- test case: Timeout-nested/Timeout/timeout_foo
|
||||
- file: log-formatter-test.cpp
|
||||
- line: 252
|
||||
- line: 202
|
||||
]]></system-err>
|
||||
</testcase>
|
||||
<testcase assertions="0" name="good_foo2" time="0.1234">
|
||||
@@ -1363,7 +1363,7 @@ fake timeout
|
||||
-------------------------------------]]></error><system-err><![CDATA[Failures detected in:
|
||||
- test case: Timeout-nested/Timeout/timeout_foo
|
||||
- file: log-formatter-test.cpp
|
||||
- line: 252
|
||||
- line: 202
|
||||
]]></system-err>
|
||||
</testcase>
|
||||
<testcase assertions="0" name="good_foo2" time="0.1234">
|
||||
|
||||
@@ -50,7 +50,7 @@ fake timeout
|
||||
-------------------------------------]]></error><system-err><![CDATA[Failures detected in:
|
||||
- test case: Timeout/timeout_foo
|
||||
- file: log-formatter-test.cpp
|
||||
- line: 231
|
||||
- line: 262
|
||||
]]></system-err>
|
||||
</testcase>
|
||||
</testsuite>
|
||||
@@ -89,7 +89,7 @@ ASSERTION FAILURE:
|
||||
<system-err><![CDATA[Failures detected in:
|
||||
- test case: 1 junit failure is not error/bad_foo
|
||||
- file: log-formatter-test.cpp
|
||||
- line: 238
|
||||
- line: 269
|
||||
]]></system-err>
|
||||
</testcase>
|
||||
<testcase assertions="1" name="very_bad_foo" time="0.1234">
|
||||
@@ -105,7 +105,7 @@ ASSERTION FAILURE:
|
||||
]]></failure><system-err><![CDATA[Failures detected in:
|
||||
- test case: 1 junit failure is not error/very_bad_foo
|
||||
- file: log-formatter-test.cpp
|
||||
- line: 239
|
||||
- line: 270
|
||||
]]></system-err>
|
||||
</testcase>
|
||||
<testcase assertions="0" name="good_foo" time="0.1234">
|
||||
@@ -148,7 +148,7 @@ ASSERTION FAILURE:
|
||||
<system-err><![CDATA[Failures detected in:
|
||||
- test case: 1 junit failure is not error/bad_foo2
|
||||
- file: log-formatter-test.cpp
|
||||
- line: 241
|
||||
- line: 272
|
||||
]]></system-err>
|
||||
</testcase>
|
||||
</testsuite>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
* 1-format *******************************************************************
|
||||
Running 2 test cases...
|
||||
xxx/message-in-datatestcase-test.cpp:131: Entering test suite "fake_datatest_case"
|
||||
xxx/message-in-datatestcase-test.cpp:126: Entering test suite "fake_datatest_case"
|
||||
xxx/message-in-datatestcase-test.cpp:200: Entering test case "_0"
|
||||
Testing update :
|
||||
[context:
|
||||
@@ -19,17 +19,17 @@ Update Volume with 100
|
||||
sample = util/test_image2.jpg; ]
|
||||
Test case fake_datatest_case/_1 did not check any assertions
|
||||
xxx/message-in-datatestcase-test.cpp:200: Leaving test case "_1"
|
||||
xxx/message-in-datatestcase-test.cpp:131: Leaving test suite "fake_datatest_case"
|
||||
xxx/message-in-datatestcase-test.cpp:126: Leaving test suite "fake_datatest_case"
|
||||
|
||||
* 2-format *******************************************************************
|
||||
<TestLog><TestSuite name="fake_datatest_case" file="xxx/message-in-datatestcase-test.cpp" line="131"><TestCase name="_0" file="xxx/message-in-datatestcase-test.cpp" line="200"><Message file="xxx/message-in-datatestcase-test.cpp" line="42"><![CDATA[Testing update :]]><Context><Frame><![CDATA[sample = util/test_image1.jpg; ]]></Frame></Context></Message><Message file="xxx/message-in-datatestcase-test.cpp" line="43"><![CDATA[Update Volume with 100]]><Context><Frame><![CDATA[sample = util/test_image1.jpg; ]]></Frame></Context></Message><Message file="boost.test framework" line="212"><![CDATA[Test case fake_datatest_case/_0 did not check any assertions]]></Message><TestingTime>ZZZ</TestingTime></TestCase><TestCase name="_1" file="xxx/message-in-datatestcase-test.cpp" line="200"><Message file="xxx/message-in-datatestcase-test.cpp" line="42"><![CDATA[Testing update :]]><Context><Frame><![CDATA[sample = util/test_image2.jpg; ]]></Frame></Context></Message><Message file="xxx/message-in-datatestcase-test.cpp" line="43"><![CDATA[Update Volume with 100]]><Context><Frame><![CDATA[sample = util/test_image2.jpg; ]]></Frame></Context></Message><Message file="boost.test framework" line="212"><![CDATA[Test case fake_datatest_case/_1 did not check any assertions]]></Message><TestingTime>ZZZ</TestingTime></TestCase></TestSuite></TestLog>
|
||||
<TestLog><TestSuite name="fake_datatest_case" file="xxx/message-in-datatestcase-test.cpp" line="126"><TestCase name="_0" file="xxx/message-in-datatestcase-test.cpp" line="200"><Message file="xxx/message-in-datatestcase-test.cpp" line="41"><![CDATA[Testing update :]]><Context><Frame><![CDATA[sample = util/test_image1.jpg; ]]></Frame></Context></Message><Message file="xxx/message-in-datatestcase-test.cpp" line="42"><![CDATA[Update Volume with 100]]><Context><Frame><![CDATA[sample = util/test_image1.jpg; ]]></Frame></Context></Message><Message file="boost.test framework" line="0"><![CDATA[Test case fake_datatest_case/_0 did not check any assertions]]></Message><TestingTime>ZZZ</TestingTime></TestCase><TestCase name="_1" file="xxx/message-in-datatestcase-test.cpp" line="200"><Message file="xxx/message-in-datatestcase-test.cpp" line="41"><![CDATA[Testing update :]]><Context><Frame><![CDATA[sample = util/test_image2.jpg; ]]></Frame></Context></Message><Message file="xxx/message-in-datatestcase-test.cpp" line="42"><![CDATA[Update Volume with 100]]><Context><Frame><![CDATA[sample = util/test_image2.jpg; ]]></Frame></Context></Message><Message file="boost.test framework" line="0"><![CDATA[Test case fake_datatest_case/_1 did not check any assertions]]></Message><TestingTime>ZZZ</TestingTime></TestCase></TestSuite></TestLog>
|
||||
* 3-format *******************************************************************
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<testsuite tests="2" skipped="0" errors="0" failures="0" id="0" name="fake_datatest_case" time="0.1234">
|
||||
<testcase assertions="0" name="_0" time="0.1234">
|
||||
<system-out><![CDATA[MESSAGE:
|
||||
- file : message-in-datatestcase-test.cpp
|
||||
- line : 42
|
||||
- line : 41
|
||||
- message: Testing update :
|
||||
- context:
|
||||
- 'sample = util/test_image1.jpg; '
|
||||
@@ -37,7 +37,7 @@ xxx/message-in-datatestcase-test.cpp:131: Leaving test suite "fake_datatest_case
|
||||
|
||||
MESSAGE:
|
||||
- file : message-in-datatestcase-test.cpp
|
||||
- line : 43
|
||||
- line : 42
|
||||
- message: Update Volume with 100
|
||||
- context:
|
||||
- 'sample = util/test_image1.jpg; '
|
||||
@@ -45,7 +45,7 @@ MESSAGE:
|
||||
|
||||
MESSAGE:
|
||||
- file : boost.test framework
|
||||
- line : 212
|
||||
- line : 0
|
||||
- message: Test case fake_datatest_case/_0 did not check any assertions
|
||||
|
||||
]]></system-out>
|
||||
@@ -53,7 +53,7 @@ MESSAGE:
|
||||
<testcase assertions="0" name="_1" time="0.1234">
|
||||
<system-out><![CDATA[MESSAGE:
|
||||
- file : message-in-datatestcase-test.cpp
|
||||
- line : 42
|
||||
- line : 41
|
||||
- message: Testing update :
|
||||
- context:
|
||||
- 'sample = util/test_image2.jpg; '
|
||||
@@ -61,7 +61,7 @@ MESSAGE:
|
||||
|
||||
MESSAGE:
|
||||
- file : message-in-datatestcase-test.cpp
|
||||
- line : 43
|
||||
- line : 42
|
||||
- message: Update Volume with 100
|
||||
- context:
|
||||
- 'sample = util/test_image2.jpg; '
|
||||
@@ -69,7 +69,7 @@ MESSAGE:
|
||||
|
||||
MESSAGE:
|
||||
- file : boost.test framework
|
||||
- line : 212
|
||||
- line : 0
|
||||
- message: Test case fake_datatest_case/_1 did not check any assertions
|
||||
|
||||
]]></system-out>
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <boost/test/unit_test_parameters.hpp>
|
||||
#include <boost/test/output/compiler_log_formatter.hpp>
|
||||
#include <boost/test/results_reporter.hpp>
|
||||
#include "../framework-ts/logger-for-tests.hpp"
|
||||
// STL
|
||||
#include <iostream>
|
||||
#include <stdexcept>
|
||||
@@ -38,7 +39,6 @@ using namespace boost::test_tools;
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
|
||||
struct this_test_log_formatter : public boost::unit_test::output::compiler_log_formatter
|
||||
{
|
||||
void print_prefix( std::ostream& output, boost::unit_test::const_string, std::size_t line )
|
||||
@@ -178,18 +178,13 @@ BOOST_AUTO_TEST_CASE( test_errors_handling )
|
||||
test_output << "\n===========================\n"
|
||||
<< "log level: " << log_level_name[level] << ';'
|
||||
<< " error type: " << error_type_name[error_type] << ";\n" << std::endl;
|
||||
{
|
||||
unit_test_log.set_formatter( new this_test_log_formatter );
|
||||
log_setup_teardown holder(test_output, OF_CUSTOM_LOGGER, level);
|
||||
|
||||
unit_test_log.set_stream( test_output );
|
||||
unit_test_log.set_threshold_level( level );
|
||||
unit_test_log.set_formatter( new this_test_log_formatter );
|
||||
framework::run( test );
|
||||
|
||||
unit_test_log.set_stream( std::cout );
|
||||
unit_test_log.set_format( runtime_config::get<output_format>( runtime_config::btrt_log_format ) );
|
||||
|
||||
log_level ll = runtime_config::get<log_level>( runtime_config::btrt_log_level );
|
||||
unit_test_log.set_threshold_level( ll != invalid_log_level? ll : log_all_errors );
|
||||
framework::run( test );
|
||||
|
||||
}
|
||||
BOOST_CHECK( test_output.match_pattern() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,10 +62,6 @@ void check( output_test_stream& output,
|
||||
test_unit_id id,
|
||||
log_level ll = log_successful_tests )
|
||||
{
|
||||
boost::unit_test::unit_test_log.set_format(log_format);
|
||||
boost::unit_test::unit_test_log.set_stream(output);
|
||||
boost::unit_test::unit_test_log.set_threshold_level(ll);
|
||||
|
||||
class reset_status : public test_tree_visitor {
|
||||
private:
|
||||
virtual bool visit( test_unit const& tu )
|
||||
@@ -75,21 +71,22 @@ void check( output_test_stream& output,
|
||||
return true;
|
||||
}
|
||||
} rstatus;
|
||||
|
||||
// reinit the default/run status otherwise we cannot apply the decorators
|
||||
// after the first run
|
||||
traverse_test_tree( id, rstatus, true );
|
||||
framework::get<test_suite>(id).p_default_status.value = test_unit::RS_ENABLED;
|
||||
|
||||
output << "* " << log_format << "-format *******************************************************************";
|
||||
output << std::endl;
|
||||
|
||||
framework::finalize_setup_phase( id );
|
||||
framework::run( id, false ); // do not continue the test tree to have the test_log_start/end
|
||||
output << std::endl;
|
||||
{
|
||||
log_setup_teardown holder(output, log_format, ll);
|
||||
|
||||
boost::unit_test::unit_test_log.set_format(OF_CLF);
|
||||
boost::unit_test::unit_test_log.set_stream(std::cout);
|
||||
// reinit the default/run status otherwise we cannot apply the decorators
|
||||
// after the first run
|
||||
traverse_test_tree( id, rstatus, true );
|
||||
framework::get<test_suite>(id).p_default_status.value = test_unit::RS_ENABLED;
|
||||
|
||||
output << "* " << log_format << "-format *******************************************************************";
|
||||
output << std::endl;
|
||||
|
||||
framework::finalize_setup_phase( id );
|
||||
framework::run( id, false ); // do not continue the test tree to have the test_log_start/end
|
||||
output << std::endl;
|
||||
}
|
||||
|
||||
BOOST_TEST( output.match_pattern(true) ); // flushes the stream at the end of the comparison.
|
||||
}
|
||||
|
||||
@@ -95,18 +95,14 @@ void check( output_test_stream& output,
|
||||
test_unit_id id,
|
||||
log_level ll = log_successful_tests )
|
||||
{
|
||||
boost::unit_test::unit_test_log.set_format(log_format);
|
||||
boost::unit_test::unit_test_log.set_stream(output);
|
||||
boost::unit_test::unit_test_log.set_threshold_level(ll);
|
||||
|
||||
output << "* " << log_format << "-format *******************************************************************";
|
||||
output << std::endl;
|
||||
framework::finalize_setup_phase( id );
|
||||
framework::run( id, false ); // do not continue the test tree to have the test_log_start/end
|
||||
output << std::endl;
|
||||
|
||||
boost::unit_test::unit_test_log.set_format(OF_CLF);
|
||||
boost::unit_test::unit_test_log.set_stream(std::cout);
|
||||
{
|
||||
log_setup_teardown holder(output, log_format, ll);
|
||||
output << "* " << log_format << "-format *******************************************************************";
|
||||
output << std::endl;
|
||||
framework::finalize_setup_phase( id );
|
||||
framework::run( id, false ); // do not continue the test tree to have the test_log_start/end
|
||||
output << std::endl;
|
||||
}
|
||||
|
||||
BOOST_TEST( output.match_pattern(true) ); // flushes the stream at the end of the comparison.
|
||||
}
|
||||
@@ -153,7 +149,7 @@ BOOST_AUTO_TEST_CASE( test_logs )
|
||||
true,
|
||||
__FILE__ );
|
||||
|
||||
#line 207
|
||||
#line 157
|
||||
test_suite* ts_0 = BOOST_TEST_SUITE( "0 test cases inside" );
|
||||
|
||||
test_suite* ts_1 = BOOST_TEST_SUITE( "1 test cases inside" );
|
||||
@@ -245,7 +241,7 @@ BOOST_AUTO_TEST_CASE( test_logs_junit_info_closing_tags )
|
||||
true,
|
||||
__FILE__ );
|
||||
|
||||
#line 218
|
||||
#line 249
|
||||
test_suite* ts_main = BOOST_TEST_SUITE( "1 test cases inside" );
|
||||
ts_main->add( BOOST_TEST_CASE( almost_good_foo ) );
|
||||
|
||||
|
||||
@@ -59,8 +59,8 @@ public:
|
||||
|
||||
std::string pathname_fixes;
|
||||
{
|
||||
const std::string to_look_for[] = {normalize_path(source_filename)};
|
||||
const std::string to_replace[] = {"xxx/" + basename };
|
||||
const std::string to_look_for[] = { source_filename, normalize_path(source_filename)};
|
||||
const std::string to_replace[] = {"xxx/" + basename, "xxx/" + basename };
|
||||
pathname_fixes = utils::replace_all_occurrences_of(
|
||||
current_string,
|
||||
to_look_for, to_look_for + sizeof(to_look_for)/sizeof(to_look_for[0]),
|
||||
@@ -113,4 +113,31 @@ public:
|
||||
|
||||
};
|
||||
|
||||
|
||||
// helper for tests
|
||||
struct log_setup_teardown {
|
||||
log_setup_teardown(
|
||||
output_test_stream& output,
|
||||
output_format log_format,
|
||||
log_level ll,
|
||||
log_level level_to_restore = invalid_log_level)
|
||||
: m_previous_ll(level_to_restore)
|
||||
{
|
||||
boost::unit_test::unit_test_log.set_format(log_format);
|
||||
boost::unit_test::unit_test_log.set_stream(output);
|
||||
if(level_to_restore == invalid_log_level) {
|
||||
m_previous_ll = boost::unit_test::unit_test_log.set_threshold_level(ll);
|
||||
}
|
||||
}
|
||||
|
||||
~log_setup_teardown() {
|
||||
boost::unit_test::unit_test_log.set_format(OF_CLF);
|
||||
boost::unit_test::unit_test_log.set_stream(std::cout);
|
||||
boost::unit_test::unit_test_log.set_threshold_level( m_previous_ll );
|
||||
boost::unit_test::unit_test_log.configure(); // forces reconfiguration
|
||||
}
|
||||
|
||||
log_level m_previous_ll;
|
||||
};
|
||||
|
||||
#endif /* BOOST_TEST_TESTS_LOGGER_FOR_TESTS_HPP__ */
|
||||
|
||||
@@ -50,30 +50,26 @@ void check_pattern_loggers(
|
||||
bool bt_module_failed = false,
|
||||
log_level ll = log_successful_tests )
|
||||
{
|
||||
boost::unit_test::unit_test_log.set_format(log_format);
|
||||
boost::unit_test::unit_test_log.set_stream(output);
|
||||
boost::unit_test::unit_test_log.set_threshold_level(ll);
|
||||
{
|
||||
log_setup_teardown holder(output, log_format, ll);
|
||||
|
||||
// output before fixture registration
|
||||
output << "* " << log_format << "-format *******************************************************************";
|
||||
output << std::endl;
|
||||
// output before fixture registration
|
||||
output << "* " << log_format << "-format *******************************************************************";
|
||||
output << std::endl;
|
||||
|
||||
framework::finalize_setup_phase( id );
|
||||
framework::finalize_setup_phase( id );
|
||||
|
||||
bool setup_error_caught = false;
|
||||
try {
|
||||
framework::run( id, false ); // do not continue the test tree to have the test_log_start/end
|
||||
bool setup_error_caught = false;
|
||||
try {
|
||||
framework::run( id, false ); // do not continue the test tree to have the test_log_start/end
|
||||
}
|
||||
catch (framework::setup_error&) {
|
||||
BOOST_TEST_MESSAGE("Framework setup_error caught");
|
||||
setup_error_caught = true;
|
||||
}
|
||||
|
||||
output << std::endl;
|
||||
}
|
||||
catch (framework::setup_error&) {
|
||||
BOOST_TEST_MESSAGE("Framework setup_error caught");
|
||||
setup_error_caught = true;
|
||||
}
|
||||
|
||||
output << std::endl;
|
||||
|
||||
// we do not want the result of the comparison go to the "output" stream
|
||||
boost::unit_test::unit_test_log.set_format(OF_CLF);
|
||||
boost::unit_test::unit_test_log.set_stream(std::cout);
|
||||
|
||||
BOOST_TEST( bt_module_failed == (( results_collector.results( id ).result_code() != 0 ) ));
|
||||
BOOST_TEST( output.match_pattern(true) ); // flushes the stream at the end of the comparison.
|
||||
|
||||
@@ -87,32 +87,29 @@ void check_global_fixture(
|
||||
bool has_setup_error = false,
|
||||
log_level ll = log_successful_tests )
|
||||
{
|
||||
boost::unit_test::unit_test_log.set_format(log_format);
|
||||
boost::unit_test::unit_test_log.set_stream(output);
|
||||
boost::unit_test::unit_test_log.set_threshold_level(ll);
|
||||
|
||||
// output before fixture registration
|
||||
output << "* " << log_format << "-format *******************************************************************";
|
||||
output << std::endl;
|
||||
|
||||
// register this as a global fixture
|
||||
boost::unit_test::ut_detail::global_fixture_impl<global_fixture_t> fixture_stack_element;
|
||||
framework::finalize_setup_phase( id );
|
||||
|
||||
bool setup_error_caught = false;
|
||||
try {
|
||||
framework::run( id, false ); // do not continue the test tree to have the test_log_start/end
|
||||
}
|
||||
catch (framework::setup_error&) {
|
||||
BOOST_TEST_MESSAGE("Framework setup_error caught");
|
||||
setup_error_caught = true;
|
||||
}
|
||||
|
||||
{
|
||||
log_setup_teardown holder(output, log_format, ll);
|
||||
|
||||
output << std::endl;
|
||||
// output before fixture registration
|
||||
output << "* " << log_format << "-format *******************************************************************";
|
||||
output << std::endl;
|
||||
|
||||
// we do not want the result of the comparison go to the "output" stream
|
||||
boost::unit_test::unit_test_log.set_format(OF_CLF);
|
||||
boost::unit_test::unit_test_log.set_stream(std::cout);
|
||||
// register this as a global fixture
|
||||
boost::unit_test::ut_detail::global_fixture_impl<global_fixture_t> fixture_stack_element;
|
||||
framework::finalize_setup_phase( id );
|
||||
|
||||
try {
|
||||
framework::run( id, false ); // do not continue the test tree to have the test_log_start/end
|
||||
}
|
||||
catch (framework::setup_error&) {
|
||||
BOOST_TEST_MESSAGE("Framework setup_error caught");
|
||||
setup_error_caught = true;
|
||||
}
|
||||
|
||||
output << std::endl;
|
||||
}
|
||||
|
||||
BOOST_TEST( setup_error_caught == has_setup_error );
|
||||
BOOST_TEST( bt_module_failed == (( results_collector.results( id ).result_code() != 0 ) || setup_error_caught ));
|
||||
|
||||
@@ -37,6 +37,8 @@
|
||||
# pragma warning(disable: 4702) // unreachable code
|
||||
#endif
|
||||
|
||||
#include "../framework-ts/logger-for-tests.hpp"
|
||||
|
||||
namespace ut=boost::unit_test;
|
||||
namespace tt=boost::test_tools;
|
||||
|
||||
@@ -122,22 +124,27 @@ BOOST_AUTO_TEST_CASE( name ) \
|
||||
__LINE__ ); \
|
||||
impl->p_default_status.value = ut::test_unit::RS_ENABLED; \
|
||||
\
|
||||
ut::unit_test_log.set_stream( ots() ); \
|
||||
ut::unit_test_log.set_threshold_level( ut::log_nothing ); \
|
||||
ut::unit_test_log.set_formatter( new shorten_lf ); \
|
||||
ut::framework::finalize_setup_phase( impl->p_id ); \
|
||||
ut::framework::run( impl ); \
|
||||
/* to detect for issues concerning the file pattern, we take
|
||||
the stream now */ \
|
||||
tt::output_test_stream& stream = ots(); \
|
||||
\
|
||||
ut::log_level ll = ut::runtime_config::get<ut::log_level>( \
|
||||
ut::runtime_config::btrt_log_level ); \
|
||||
ut::output_format lf = ut::runtime_config::get<ut::output_format>( \
|
||||
ut::runtime_config::btrt_log_format ); \
|
||||
{ \
|
||||
ut::log_level ll = ut::runtime_config::get<ut::log_level>( \
|
||||
ut::runtime_config::btrt_log_level ); \
|
||||
ut::unit_test_log.set_formatter( new shorten_lf ); \
|
||||
log_setup_teardown holder(stream, \
|
||||
OF_CUSTOM_LOGGER, \
|
||||
ut::log_nothing, \
|
||||
ll != ut::invalid_log_level ? \
|
||||
ll \
|
||||
: ut::log_all_errors ); \
|
||||
\
|
||||
ut::unit_test_log.set_threshold_level( \
|
||||
ll != ut::invalid_log_level ? ll : ut::log_all_errors ); \
|
||||
ut::unit_test_log.set_format( lf ); \
|
||||
ut::unit_test_log.set_stream( std::cout ); \
|
||||
BOOST_CHECK( ots().match_pattern() ); \
|
||||
ut::framework::finalize_setup_phase( impl->p_id ); \
|
||||
ut::framework::run( impl ); \
|
||||
\
|
||||
} \
|
||||
\
|
||||
BOOST_CHECK( stream.match_pattern() ); \
|
||||
} \
|
||||
\
|
||||
void name ## _impl() \
|
||||
|
||||
Reference in New Issue
Block a user