From 2cb84412a6d68b28c4297ad5ed1c780f36065d19 Mon Sep 17 00:00:00 2001 From: jamie Date: Sat, 18 Oct 2014 00:43:06 +0100 Subject: [PATCH 1/8] Fixes for #7397 --- .../test/impl/compiler_log_formatter.ipp | 10 +- include/boost/test/impl/framework.ipp | 14 ++- include/boost/test/impl/progress_monitor.ipp | 5 +- include/boost/test/impl/results_collector.ipp | 3 +- include/boost/test/impl/test_tree.ipp | 3 +- include/boost/test/impl/unit_test_log.ipp | 4 +- include/boost/test/impl/xml_log_formatter.ipp | 8 +- .../test/output/compiler_log_formatter.hpp | 4 +- .../boost/test/output/xml_log_formatter.hpp | 4 +- include/boost/test/progress_monitor.hpp | 3 +- include/boost/test/results_collector.hpp | 2 +- include/boost/test/tree/observer.hpp | 4 +- include/boost/test/unit_test_log.hpp | 3 +- .../boost/test/unit_test_log_formatter.hpp | 4 +- include/boost/test/utils/progress.hpp | 107 ++++++++++++++++++ include/boost/test/utils/timer.hpp | 94 +++++++++++++++ test/Jamfile.v2 | 7 ++ 17 files changed, 253 insertions(+), 26 deletions(-) create mode 100644 include/boost/test/utils/progress.hpp create mode 100644 include/boost/test/utils/timer.hpp diff --git a/include/boost/test/impl/compiler_log_formatter.ipp b/include/boost/test/impl/compiler_log_formatter.ipp index 84e8eadac4..4db24faf39 100644 --- a/include/boost/test/impl/compiler_log_formatter.ipp +++ b/include/boost/test/impl/compiler_log_formatter.ipp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -101,18 +102,15 @@ compiler_log_formatter::test_unit_start( std::ostream& output, test_unit const& //____________________________________________________________________________// void -compiler_log_formatter::test_unit_finish( std::ostream& output, test_unit const& tu, unsigned long elapsed ) +compiler_log_formatter::test_unit_finish( std::ostream& output, test_unit const& tu, elapsed_t elapsed ) { BOOST_TEST_SCOPE_SETCOLOR( output, term_attr::BRIGHT, term_color::BLUE ); output << "Leaving test " << tu.p_type_name << " \"" << tu.p_name << "\""; - if( elapsed > 0 ) { + if( has_time( elapsed ) ) { output << "; testing time: "; - if( elapsed % 1000 == 0 ) - output << elapsed/1000 << "ms"; - else - output << elapsed << "mks"; + output << to_string( elapsed ); } output << std::endl; diff --git a/include/boost/test/impl/framework.ipp b/include/boost/test/impl/framework.ipp index 517395ae5d..72622a54db 100644 --- a/include/boost/test/impl/framework.ipp +++ b/include/boost/test/impl/framework.ipp @@ -41,8 +41,9 @@ #include #include +#include + // Boost -#include #include // STL @@ -372,7 +373,7 @@ public: return true; } - void test_unit_finish( test_unit const& tu, unit_test_monitor_t::error_level run_result, unsigned long elapsed ) + void test_unit_finish( test_unit const& tu, unit_test_monitor_t::error_level run_result, elapsed_t elapsed ) { // if run error is critical skip teardown, who knows what the state of the program at this point if( !unit_test_monitor.is_critical_error( run_result ) ) { @@ -412,9 +413,12 @@ public: m_curr_test_case = tc.p_id; // execute the test case body - boost::timer tc_timer; + timer_t tc_timer; unit_test_monitor_t::error_level run_result = unit_test_monitor.execute_and_translate( tc.p_test_func, tc.p_timeout ); - unsigned long elapsed = static_cast( tc_timer.elapsed() * 1e6 ); + + tc_timer.stop(); + elapsed_t elapsed = tc_timer.elapsed(); + // cleanup leftover context m_context.clear(); @@ -433,7 +437,7 @@ public: void test_suite_finish( test_suite const& ts ) { - test_unit_finish( ts, unit_test_monitor_t::test_ok, 0 ); + test_unit_finish( ts, unit_test_monitor_t::test_ok, elapsed_t() ); } ////////////////////////////////////////////////////////////////// diff --git a/include/boost/test/impl/progress_monitor.ipp b/include/boost/test/impl/progress_monitor.ipp index 2ebe8f0259..05ff577a42 100644 --- a/include/boost/test/impl/progress_monitor.ipp +++ b/include/boost/test/impl/progress_monitor.ipp @@ -20,13 +20,14 @@ #include #include +#include +#include #include #include #include // Boost -#include #include #include @@ -79,7 +80,7 @@ progress_monitor_t::test_aborted() //____________________________________________________________________________// void -progress_monitor_t::test_unit_finish( test_unit const& tu, unsigned long ) +progress_monitor_t::test_unit_finish( test_unit const& tu, elapsed_t ) { BOOST_TEST_SCOPE_SETCOLOR( *s_pm_impl().m_stream, term_attr::BRIGHT, term_color::MAGENTA ); diff --git a/include/boost/test/impl/results_collector.ipp b/include/boost/test/impl/results_collector.ipp index d75446ae6c..289024f47a 100644 --- a/include/boost/test/impl/results_collector.ipp +++ b/include/boost/test/impl/results_collector.ipp @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -184,7 +185,7 @@ private: //____________________________________________________________________________// void -results_collector_t::test_unit_finish( test_unit const& tu, unsigned long ) +results_collector_t::test_unit_finish( test_unit const& tu, elapsed_t ) { if( tu.p_type == TUT_SUITE ) { results_collect_helper ch( s_rc_impl().m_results_store[tu.p_id], tu ); diff --git a/include/boost/test/impl/test_tree.ipp b/include/boost/test/impl/test_tree.ipp index b54282f68c..67c6820388 100644 --- a/include/boost/test/impl/test_tree.ipp +++ b/include/boost/test/impl/test_tree.ipp @@ -31,9 +31,10 @@ #include #include +#include // Boost -#include +// none // STL #include diff --git a/include/boost/test/impl/unit_test_log.ipp b/include/boost/test/impl/unit_test_log.ipp index 254d107f48..366f134df7 100644 --- a/include/boost/test/impl/unit_test_log.ipp +++ b/include/boost/test/impl/unit_test_log.ipp @@ -28,6 +28,8 @@ #include #include +#include + // Boost #include #include @@ -177,7 +179,7 @@ unit_test_log_t::test_unit_start( test_unit const& tu ) //____________________________________________________________________________// void -unit_test_log_t::test_unit_finish( test_unit const& tu, unsigned long elapsed ) +unit_test_log_t::test_unit_finish( test_unit const& tu, elapsed_t elapsed ) { if( s_log_impl().m_threshold_level > log_test_units ) return; diff --git a/include/boost/test/impl/xml_log_formatter.ipp b/include/boost/test/impl/xml_log_formatter.ipp index 65898d9e4a..fb1a2f4f89 100644 --- a/include/boost/test/impl/xml_log_formatter.ipp +++ b/include/boost/test/impl/xml_log_formatter.ipp @@ -23,6 +23,8 @@ #include #include +#include + // Boost #include @@ -92,11 +94,11 @@ xml_log_formatter::test_unit_start( std::ostream& ostr, test_unit const& tu ) //____________________________________________________________________________// void -xml_log_formatter::test_unit_finish( std::ostream& ostr, test_unit const& tu, unsigned long elapsed ) +xml_log_formatter::test_unit_finish( std::ostream& ostr, test_unit const& tu, elapsed_t elapsed ) { if( tu.p_type == TUT_CASE ) - ostr << "" << elapsed << ""; - + ostr << to_xml( elapsed ); + ostr << ""; } diff --git a/include/boost/test/output/compiler_log_formatter.hpp b/include/boost/test/output/compiler_log_formatter.hpp index a367940291..037eccdedd 100644 --- a/include/boost/test/output/compiler_log_formatter.hpp +++ b/include/boost/test/output/compiler_log_formatter.hpp @@ -21,6 +21,8 @@ #include +#include + //____________________________________________________________________________// namespace boost { @@ -39,7 +41,7 @@ class BOOST_TEST_DECL compiler_log_formatter : public unit_test_log_formatter { void log_build_info( std::ostream& ); void test_unit_start( std::ostream&, test_unit const& tu ); - void test_unit_finish( std::ostream&, test_unit const& tu, unsigned long elapsed ); + void test_unit_finish( std::ostream&, test_unit const& tu, elapsed_t elapsed ); void test_unit_skipped( std::ostream&, test_unit const& tu ); void log_exception_start( std::ostream&, log_checkpoint_data const&, execution_exception const& ex ); diff --git a/include/boost/test/output/xml_log_formatter.hpp b/include/boost/test/output/xml_log_formatter.hpp index 55e87b9561..e1bd3d198b 100644 --- a/include/boost/test/output/xml_log_formatter.hpp +++ b/include/boost/test/output/xml_log_formatter.hpp @@ -19,6 +19,8 @@ #include #include +#include + // STL #include // std::size_t @@ -42,7 +44,7 @@ class xml_log_formatter : public unit_test_log_formatter { void log_build_info( std::ostream& ); void test_unit_start( std::ostream&, test_unit const& tu ); - void test_unit_finish( std::ostream&, test_unit const& tu, unsigned long elapsed ); + void test_unit_finish( std::ostream&, test_unit const& tu, elapsed_t elapsed ); void test_unit_skipped( std::ostream&, test_unit const& tu ); void log_exception_start( std::ostream&, log_checkpoint_data const&, execution_exception const& ex ); diff --git a/include/boost/test/progress_monitor.hpp b/include/boost/test/progress_monitor.hpp index 71ee94f981..2aeab5936b 100644 --- a/include/boost/test/progress_monitor.hpp +++ b/include/boost/test/progress_monitor.hpp @@ -18,6 +18,7 @@ // Boost.Test #include #include +#include // STL #include // for std::ostream& @@ -39,7 +40,7 @@ class BOOST_TEST_DECL progress_monitor_t : public test_observer, public singleto virtual void test_start( counter_t test_cases_amount ); virtual void test_aborted(); - virtual void test_unit_finish( test_unit const&, unsigned long ); + virtual void test_unit_finish( test_unit const&, elapsed_t ); virtual void test_unit_skipped( test_unit const& ); virtual int priority() { return 3; } diff --git a/include/boost/test/results_collector.hpp b/include/boost/test/results_collector.hpp index ba345674d0..0be984d62d 100644 --- a/include/boost/test/results_collector.hpp +++ b/include/boost/test/results_collector.hpp @@ -83,7 +83,7 @@ class BOOST_TEST_DECL results_collector_t : public test_observer, public singlet virtual void test_start( counter_t test_cases_amount ); virtual void test_unit_start( test_unit const& ); - virtual void test_unit_finish( test_unit const&, unsigned long ); + virtual void test_unit_finish( test_unit const&, elapsed_t ); virtual void test_unit_skipped( test_unit const& ); virtual void test_unit_aborted( test_unit const& ); diff --git a/include/boost/test/tree/observer.hpp b/include/boost/test/tree/observer.hpp index 207b3a283d..3b226ab58a 100644 --- a/include/boost/test/tree/observer.hpp +++ b/include/boost/test/tree/observer.hpp @@ -20,6 +20,8 @@ #include #include +#include + #include //____________________________________________________________________________// @@ -39,7 +41,7 @@ class BOOST_TEST_DECL test_observer { virtual void test_aborted() {} virtual void test_unit_start( test_unit const& ) {} - virtual void test_unit_finish( test_unit const&, unsigned long /* elapsed */ ) {} + virtual void test_unit_finish( test_unit const&, elapsed_t /* elapsed */ ) {} virtual void test_unit_skipped( test_unit const& ) {} virtual void test_unit_aborted( test_unit const& ) {} diff --git a/include/boost/test/unit_test_log.hpp b/include/boost/test/unit_test_log.hpp index 13019528be..ce0f7d2aaa 100644 --- a/include/boost/test/unit_test_log.hpp +++ b/include/boost/test/unit_test_log.hpp @@ -27,6 +27,7 @@ #include #include #include +#include // Boost @@ -96,7 +97,7 @@ class BOOST_TEST_DECL unit_test_log_t : public test_observer, public singleton #include +#include + // STL #include #include // for std::string @@ -92,7 +94,7 @@ class BOOST_TEST_DECL unit_test_log_formatter { virtual void log_build_info( std::ostream& ) = 0; virtual void test_unit_start( std::ostream&, test_unit const& tu ) = 0; - virtual void test_unit_finish( std::ostream&, test_unit const& tu, unsigned long elapsed ) = 0; + virtual void test_unit_finish( std::ostream&, test_unit const& tu, elapsed_t elapsed ) = 0; virtual void test_unit_skipped( std::ostream&, test_unit const& ) = 0; virtual void log_exception_start( std::ostream&, log_checkpoint_data const&, execution_exception const& ex ) = 0; diff --git a/include/boost/test/utils/progress.hpp b/include/boost/test/utils/progress.hpp new file mode 100644 index 0000000000..d0b675dd88 --- /dev/null +++ b/include/boost/test/utils/progress.hpp @@ -0,0 +1,107 @@ +// boost progress.hpp header file ------------------------------------------// + +// Copyright Beman Dawes 1994-99. Distributed under the Boost +// Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// See http://www.boost.org/libs/timer for documentation. + +// Revision History +// 1 Dec 01 Add leading progress display strings (suggested by Toon Knapen) +// 20 May 01 Introduce several static_casts<> to eliminate warning messages +// (Fixed by Beman, reported by Herve Bronnimann) +// 12 Jan 01 Change to inline implementation to allow use without library +// builds. See docs for more rationale. (Beman Dawes) +// 22 Jul 99 Name changed to .hpp +// 16 Jul 99 Second beta +// 6 Jul 99 Initial boost version + +#ifndef BOOST_TEST_UTILS_PROGRESS_DISPLAY_HPP +#define BOOST_TEST_UTILS_PROGRESS_DISPLAY_HPP + +#include +#include // for ostream, cout, etc +#include // for string + +namespace boost { + +namespace unit_test { + +// progress_display --------------------------------------------------------// + +// progress_display displays an appropriate indication of +// progress at an appropriate place in an appropriate form. + +// NOTE: (Jan 12, 2001) Tried to change unsigned long to boost::uintmax_t, but +// found some compilers couldn't handle the required conversion to double. +// Reverted to unsigned long until the compilers catch up. + +class progress_display : private noncopyable +{ + public: + explicit progress_display( unsigned long expected_count, + std::ostream & os = std::cout, + const std::string & s1 = "\n", //leading strings + const std::string & s2 = "", + const std::string & s3 = "" ) + // os is hint; implementation may ignore, particularly in embedded systems + : m_os(os), m_s1(s1), m_s2(s2), m_s3(s3) { restart(expected_count); } + + void restart( unsigned long expected_count ) + // Effects: display appropriate scale + // Postconditions: count()==0, expected_count()==expected_count + { + _count = _next_tic_count = _tic = 0; + _expected_count = expected_count; + + m_os << m_s1 << "0% 10 20 30 40 50 60 70 80 90 100%\n" + << m_s2 << "|----|----|----|----|----|----|----|----|----|----|" + << std::endl // endl implies flush, which ensures display + << m_s3; + if ( !_expected_count ) _expected_count = 1; // prevent divide by zero + } // restart + + unsigned long operator+=( unsigned long increment ) + // Effects: Display appropriate progress tic if needed. + // Postconditions: count()== original count() + increment + // Returns: count(). + { + if ( (_count += increment) >= _next_tic_count ) { display_tic(); } + return _count; + } + + unsigned long operator++() { return operator+=( 1 ); } + unsigned long count() const { return _count; } + unsigned long expected_count() const { return _expected_count; } + + private: + std::ostream & m_os; // may not be present in all imps + const std::string m_s1; // string is more general, safer than + const std::string m_s2; // const char *, and efficiency or size are + const std::string m_s3; // not issues + + unsigned long _count, _expected_count, _next_tic_count; + unsigned int _tic; + void display_tic() + { + // use of floating point ensures that both large and small counts + // work correctly. static_cast<>() is also used several places + // to suppress spurious compiler warnings. + unsigned int tics_needed = + static_cast( + (static_cast(_count)/_expected_count)*50.0 ); + do { m_os << '*' << std::flush; } while ( ++_tic < tics_needed ); + _next_tic_count = + static_cast((_tic/50.0)*_expected_count); + if ( _count == _expected_count ) { + if ( _tic < 51 ) m_os << '*'; + m_os << std::endl; + } + } // display_tic +}; + +} // namespace unit_test + +} // namespace boost + +#endif // BOOST_TEST_UTILS_PROGRESS_DISPLAY_HPP diff --git a/include/boost/test/utils/timer.hpp b/include/boost/test/utils/timer.hpp new file mode 100644 index 0000000000..f9aa2b96e2 --- /dev/null +++ b/include/boost/test/utils/timer.hpp @@ -0,0 +1,94 @@ +// (C) Copyright Jamie Allsop 2012. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// See http://www.boost.org/libs/test for the library home page. +// +// Description : timer and elapsed types +// *************************************************************************** + +#ifndef BOOST_TEST_UTILS_TIMER_HPP +#define BOOST_TEST_UTILS_TIMER_HPP + +#ifdef BOOST_TEST_USE_DEPRECATED_TIMER +#include +#else +#include +#endif +#include + +namespace boost { + +namespace unit_test { + +// ************************************************************************** // +// ************** opaque timer and elapsed types ************** // +// ************************************************************************** // + +#ifdef BOOST_TEST_USE_DEPRECATED_TIMER + +typedef boost::timer timer_t; +typedef unsigned long elapsed_t; + +inline std::string to_string( elapsed_t elapsed ) +{ + std::ostringstream output; + if( elapsed % 1000 == 0 ) + { + output << elapsed/1000 << "ms"; + } + else + { + output << elapsed << "mks"; + } + return output.str(); +} + +inline std::string to_xml( elapsed_t elapsed ) +{ + std::ostringstream output; + output << "" << elapsed << ""; + return output.str(); +} + +inline bool has_time( const elapsed_t& elapsed ) +{ + return elapsed; +} + +#else + +typedef boost::timer::cpu_timer timer_t; +typedef boost::timer::cpu_times elapsed_t; + +inline std::string to_string( elapsed_t elapsed ) +{ + return boost::timer::format( elapsed, 9, "%ws wall, %us user + %ss system = %ts CPU (%p%)" ); +} + +inline std::string to_xml( elapsed_t elapsed ) +{ + std::ostringstream output; + output << "" << ( elapsed.user + elapsed.system ) << "" + << "" << elapsed.wall << "" + << "" << elapsed.user << "" + << "" << elapsed.system << ""; + return output.str(); +} + +inline bool has_time( const elapsed_t& elapsed ) +{ + return elapsed.wall != 0 || elapsed.user != 0 || elapsed.system != 0; +} + +#endif + +//____________________________________________________________________________// + +} // namespace unit_test + +} // namespace boost + +#endif // BOOST_TEST_UTILS_TIMER_HPP + diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 57dc98aaa1..f838f7ba83 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -6,6 +6,13 @@ # See http://www.boost.org/libs/test for the library home page. +project + : requirements + /boost/system//boost_system + /boost/timer//boost_timer + ; + + rule test-btl-lib ( test-rule : test-name : lib-name ? : pattern_file * : source_files * : extra-libs ? : extra-options ? ) { source_files ?= $(test-name).cpp ; From 729e346cbd69698d5b5cf2144ae7a61680cb67d7 Mon Sep 17 00:00:00 2001 From: jamie Date: Wed, 7 Jan 2015 18:10:32 +0000 Subject: [PATCH 2/8] Replace BOOST_TEST_USE_DEPRECATED_TIMER macro with --deprecated_timer_format Remove the macro BOOST_TEST_USE_DEPRECATED_TIMER and replace it with a runtime cla --deprecated_timer_format. Additionally change to write the testing time in microseconds and add giving the time in nanoseconds. Existing scripts and parsers that handle the XML output should not be affected by this change. --- .../user-guide/runtime-config/reference.html | 39 +++++++ doc/src/utf.user-guide.runtime-config.xml | 18 ++++ .../boost/test/impl/unit_test_parameters.ipp | 101 ++++++++++-------- include/boost/test/unit_test_parameters.hpp | 1 + include/boost/test/utils/timer.hpp | 58 ++++------ 5 files changed, 138 insertions(+), 79 deletions(-) diff --git a/doc/html/utf/user-guide/runtime-config/reference.html b/doc/html/utf/user-guide/runtime-config/reference.html index d10c434886..807976b95e 100755 --- a/doc/html/utf/user-guide/runtime-config/reference.html +++ b/doc/html/utf/user-guide/runtime-config/reference.html @@ -45,6 +45,7 @@
  • color_output
  • detect_fp_exceptions
  • detect_memory_leaks
  • +
  • deprecated_timer_format
  • log_format
  • log_level
  • log_sink
  • @@ -317,6 +318,44 @@
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Parameter Name: Force the timer output format to match the deprecated Boost.Timer
    Environment variable name: BOOST_TEST_DEPRECATED_TIMER_FORMAT
    Command line argument name: deprecated_timer_format
    Acceptable Values: + + +
    no
    yes
    Description:

    + Specifying this option forces any timer output to match that provided by the deprecated Boost.Timer + class. If you use scripts that parse either the HRF or XML output for Boost.Test and find you are no + longer able to parse the output correctly then enabling this feature should allow your scripts to + work as before. Disabled by default. +

    +
    +
    diff --git a/doc/src/utf.user-guide.runtime-config.xml b/doc/src/utf.user-guide.runtime-config.xml index d8f2cd9963..649b9b436c 100644 --- a/doc/src/utf.user-guide.runtime-config.xml +++ b/doc/src/utf.user-guide.runtime-config.xml @@ -377,6 +377,24 @@ Leaving test suite "example" + + Use the deprecated timer format for output + BOOST_TEST_DEPRECATED_TIMER_FORMAT + deprecated_timer_format + + + no + yes + + + + + This ensures timer test output matches the format produced for the deprecated Boost.Timer class. Otherwise + updated output will be displayed that provides Wall, User and System times. + + + + The log format BOOST_TEST_LOG_FORMAT diff --git a/include/boost/test/impl/unit_test_parameters.ipp b/include/boost/test/impl/unit_test_parameters.ipp index 8127278af5..328740787c 100644 --- a/include/boost/test/impl/unit_test_parameters.ipp +++ b/include/boost/test/impl/unit_test_parameters.ipp @@ -152,28 +152,29 @@ namespace runtime_config { namespace { // framework parameters and corresponding command-line arguments -std::string AUTO_START_DBG = "auto_start_dbg"; -std::string BREAK_EXEC_PATH = "break_exec_path"; -std::string BUILD_INFO = "build_info"; -std::string CATCH_SYS_ERRORS = "catch_system_errors"; -std::string COLOR_OUTPUT = "color_output"; -std::string DETECT_FP_EXCEPT = "detect_fp_exceptions"; -std::string DETECT_MEM_LEAKS = "detect_memory_leaks"; -std::string LIST_CONTENT = "list_content"; -std::string LOG_FORMAT = "log_format"; -std::string LOG_LEVEL = "log_level"; -std::string LOG_SINK = "log_sink"; -std::string OUTPUT_FORMAT = "output_format"; -std::string RANDOM_SEED = "random"; -std::string REPORT_FORMAT = "report_format"; -std::string REPORT_LEVEL = "report_level"; -std::string REPORT_SINK = "report_sink"; -std::string RESULT_CODE = "result_code"; -std::string TESTS_TO_RUN = "run_test"; -std::string SAVE_TEST_PATTERN = "save_pattern"; -std::string SHOW_PROGRESS = "show_progress"; -std::string USE_ALT_STACK = "use_alt_stack"; -std::string WAIT_FOR_DEBUGGER = "wait_for_debugger"; +std::string AUTO_START_DBG = "auto_start_dbg"; +std::string BREAK_EXEC_PATH = "break_exec_path"; +std::string BUILD_INFO = "build_info"; +std::string CATCH_SYS_ERRORS = "catch_system_errors"; +std::string COLOR_OUTPUT = "color_output"; +std::string DETECT_FP_EXCEPT = "detect_fp_exceptions"; +std::string DETECT_MEM_LEAKS = "detect_memory_leaks"; +std::string DEPRECATED_TIMER_FORMAT = "deprecated_timer_format"; +std::string LIST_CONTENT = "list_content"; +std::string LOG_FORMAT = "log_format"; +std::string LOG_LEVEL = "log_level"; +std::string LOG_SINK = "log_sink"; +std::string OUTPUT_FORMAT = "output_format"; +std::string RANDOM_SEED = "random"; +std::string REPORT_FORMAT = "report_format"; +std::string REPORT_LEVEL = "report_level"; +std::string REPORT_SINK = "report_sink"; +std::string RESULT_CODE = "result_code"; +std::string TESTS_TO_RUN = "run_test"; +std::string SAVE_TEST_PATTERN = "save_pattern"; +std::string SHOW_PROGRESS = "show_progress"; +std::string USE_ALT_STACK = "use_alt_stack"; +std::string WAIT_FOR_DEBUGGER = "wait_for_debugger"; static const_string parameter_2_env_var( const_string param_name ) @@ -182,28 +183,29 @@ parameter_2_env_var( const_string param_name ) static mtype s_mapping; if( s_mapping.empty() ) { - s_mapping[AUTO_START_DBG] = "BOOST_TEST_AUTO_START_DBG"; - s_mapping[BREAK_EXEC_PATH] = "BOOST_TEST_BREAK_EXEC_PATH"; - s_mapping[BUILD_INFO] = "BOOST_TEST_BUILD_INFO"; - s_mapping[CATCH_SYS_ERRORS] = "BOOST_TEST_CATCH_SYSTEM_ERRORS"; - s_mapping[COLOR_OUTPUT] = "BOOST_TEST_COLOR_OUTPUT"; - s_mapping[DETECT_FP_EXCEPT] = "BOOST_TEST_DETECT_FP_EXCEPTIONS"; - s_mapping[DETECT_MEM_LEAKS] = "BOOST_TEST_DETECT_MEMORY_LEAK"; - s_mapping[LIST_CONTENT] = "BOOST_TEST_LIST_CONTENT"; - s_mapping[LOG_FORMAT] = "BOOST_TEST_LOG_FORMAT"; - s_mapping[LOG_LEVEL] = "BOOST_TEST_LOG_LEVEL"; - s_mapping[LOG_SINK] = "BOOST_TEST_LOG_SINK"; - s_mapping[OUTPUT_FORMAT] = "BOOST_TEST_OUTPUT_FORMAT"; - s_mapping[RANDOM_SEED] = "BOOST_TEST_RANDOM"; - s_mapping[REPORT_FORMAT] = "BOOST_TEST_REPORT_FORMAT"; - s_mapping[REPORT_LEVEL] = "BOOST_TEST_REPORT_LEVEL"; - s_mapping[REPORT_SINK] = "BOOST_TEST_REPORT_SINK"; - s_mapping[RESULT_CODE] = "BOOST_TEST_RESULT_CODE"; - s_mapping[TESTS_TO_RUN] = "BOOST_TESTS_TO_RUN"; - s_mapping[SAVE_TEST_PATTERN] = "BOOST_TEST_SAVE_PATTERN"; - s_mapping[SHOW_PROGRESS] = "BOOST_TEST_SHOW_PROGRESS"; - s_mapping[USE_ALT_STACK] = "BOOST_TEST_USE_ALT_STACK"; - s_mapping[WAIT_FOR_DEBUGGER] = "BOOST_TEST_WAIT_FOR_DEBUGGER"; + s_mapping[AUTO_START_DBG] = "BOOST_TEST_AUTO_START_DBG"; + s_mapping[BREAK_EXEC_PATH] = "BOOST_TEST_BREAK_EXEC_PATH"; + s_mapping[BUILD_INFO] = "BOOST_TEST_BUILD_INFO"; + s_mapping[CATCH_SYS_ERRORS] = "BOOST_TEST_CATCH_SYSTEM_ERRORS"; + s_mapping[COLOR_OUTPUT] = "BOOST_TEST_COLOR_OUTPUT"; + s_mapping[DETECT_FP_EXCEPT] = "BOOST_TEST_DETECT_FP_EXCEPTIONS"; + s_mapping[DETECT_MEM_LEAKS] = "BOOST_TEST_DETECT_MEMORY_LEAK"; + s_mapping[DEPRECATED_TIMER_FORMAT] = "BOOST_TEST_DEPRECATED_TIMER_FORMAT"; + s_mapping[LIST_CONTENT] = "BOOST_TEST_LIST_CONTENT"; + s_mapping[LOG_FORMAT] = "BOOST_TEST_LOG_FORMAT"; + s_mapping[LOG_LEVEL] = "BOOST_TEST_LOG_LEVEL"; + s_mapping[LOG_SINK] = "BOOST_TEST_LOG_SINK"; + s_mapping[OUTPUT_FORMAT] = "BOOST_TEST_OUTPUT_FORMAT"; + s_mapping[RANDOM_SEED] = "BOOST_TEST_RANDOM"; + s_mapping[REPORT_FORMAT] = "BOOST_TEST_REPORT_FORMAT"; + s_mapping[REPORT_LEVEL] = "BOOST_TEST_REPORT_LEVEL"; + s_mapping[REPORT_SINK] = "BOOST_TEST_REPORT_SINK"; + s_mapping[RESULT_CODE] = "BOOST_TEST_RESULT_CODE"; + s_mapping[TESTS_TO_RUN] = "BOOST_TESTS_TO_RUN"; + s_mapping[SAVE_TEST_PATTERN] = "BOOST_TEST_SAVE_PATTERN"; + s_mapping[SHOW_PROGRESS] = "BOOST_TEST_SHOW_PROGRESS"; + s_mapping[USE_ALT_STACK] = "BOOST_TEST_USE_ALT_STACK"; + s_mapping[WAIT_FOR_DEBUGGER] = "BOOST_TEST_WAIT_FOR_DEBUGGER"; } mtype::const_iterator it = s_mapping.find( param_name ); @@ -288,6 +290,9 @@ init( int& argc, char** argv ) << cla::named_parameter( DETECT_MEM_LEAKS ) - (cla::prefix = "--",cla::separator = "=",cla::guess_name,cla::optional,cla::optional_value, cla::description = "Allows to switch between catching and ignoring memory leaks") + << cla::named_parameter( DEPRECATED_TIMER_FORMAT ) + - (cla::prefix = "--",cla::separator = "=",cla::guess_name,cla::optional,cla::optional_value, + cla::description = "Forces HRF output for timing information to mimic the deprecated boost timer output") << cla::dual_name_parameter( LOG_FORMAT + "|f" ) - (cla::prefix = "--|-",cla::separator = "=| ",cla::guess_name,cla::optional, cla::description = "Specifies log format") @@ -499,6 +504,14 @@ detect_fp_exceptions() //____________________________________________________________________________// +bool +deprecated_timer_format() +{ + return retrieve_parameter( DEPRECATED_TIMER_FORMAT, s_cla_parser, false ); +} + +//____________________________________________________________________________// + output_format report_format() { diff --git a/include/boost/test/unit_test_parameters.hpp b/include/boost/test/unit_test_parameters.hpp index b366e87ad7..ef1e10a6bd 100644 --- a/include/boost/test/unit_test_parameters.hpp +++ b/include/boost/test/unit_test_parameters.hpp @@ -42,6 +42,7 @@ BOOST_TEST_DECL bool catch_sys_errors(); BOOST_TEST_DECL bool color_output(); BOOST_TEST_DECL bool detect_fp_exceptions(); BOOST_TEST_DECL long detect_memory_leaks(); +BOOST_TEST_DECL bool deprecated_timer_format(); BOOST_TEST_DECL bool list_content(); BOOST_TEST_DECL output_format log_format(); BOOST_TEST_DECL unit_test::log_level log_level(); diff --git a/include/boost/test/utils/timer.hpp b/include/boost/test/utils/timer.hpp index f9aa2b96e2..4e8e68878f 100644 --- a/include/boost/test/utils/timer.hpp +++ b/include/boost/test/utils/timer.hpp @@ -1,4 +1,4 @@ -// (C) Copyright Jamie Allsop 2012. +// (C) Copyright Jamie Allsop 2015. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -11,11 +11,8 @@ #ifndef BOOST_TEST_UTILS_TIMER_HPP #define BOOST_TEST_UTILS_TIMER_HPP -#ifdef BOOST_TEST_USE_DEPRECATED_TIMER -#include -#else +#include #include -#endif #include namespace boost { @@ -26,54 +23,47 @@ namespace unit_test { // ************** opaque timer and elapsed types ************** // // ************************************************************************** // -#ifdef BOOST_TEST_USE_DEPRECATED_TIMER +typedef boost::timer::cpu_timer timer_t; +typedef boost::timer::cpu_times elapsed_t; +typedef boost::timer::nanosecond_type nanoseconds_t; -typedef boost::timer timer_t; -typedef unsigned long elapsed_t; +inline long microsecond_cpu_time( elapsed_t elapsed ) +{ + return ( elapsed.user + elapsed.system )/1000; +} -inline std::string to_string( elapsed_t elapsed ) +inline std::string deprecated_hrf_format( elapsed_t elapsed ) { std::ostringstream output; - if( elapsed % 1000 == 0 ) + long duration = microsecond_cpu_time( elapsed ); + if( duration % 1000 == 0 ) { - output << elapsed/1000 << "ms"; + output << duration/1000 << "ms"; } else { - output << elapsed << "mks"; + output << duration << "mks"; } return output.str(); } -inline std::string to_xml( elapsed_t elapsed ) -{ - std::ostringstream output; - output << "" << elapsed << ""; - return output.str(); -} - -inline bool has_time( const elapsed_t& elapsed ) -{ - return elapsed; -} - -#else - -typedef boost::timer::cpu_timer timer_t; -typedef boost::timer::cpu_times elapsed_t; - inline std::string to_string( elapsed_t elapsed ) { + if( runtime_config::deprecated_timer_format() ) + { + return deprecated_hrf_format( elapsed ); + } return boost::timer::format( elapsed, 9, "%ws wall, %us user + %ss system = %ts CPU (%p%)" ); } inline std::string to_xml( elapsed_t elapsed ) { std::ostringstream output; - output << "" << ( elapsed.user + elapsed.system ) << "" - << "" << elapsed.wall << "" - << "" << elapsed.user << "" - << "" << elapsed.system << ""; + output << "" << microsecond_cpu_time( elapsed ) << "" + << "" << ( elapsed.user + elapsed.system ) << "" + << "" << elapsed.wall << "" + << "" << elapsed.user << "" + << "" << elapsed.system << ""; return output.str(); } @@ -82,8 +72,6 @@ inline bool has_time( const elapsed_t& elapsed ) return elapsed.wall != 0 || elapsed.user != 0 || elapsed.system != 0; } -#endif - //____________________________________________________________________________// } // namespace unit_test From c84cab1f059adbdaf12104de6700203d02077c44 Mon Sep 17 00:00:00 2001 From: jamie Date: Wed, 7 Jan 2015 19:27:37 +0000 Subject: [PATCH 3/8] Add quickbook entries for deprecated_timer_format --- .../runtime_config_reference.qbk | 31 +++++++++++-- doc/test.qbk | 43 ++++++++++--------- 2 files changed, 50 insertions(+), 24 deletions(-) diff --git a/doc/runtime_configuration/runtime_config_reference.qbk b/doc/runtime_configuration/runtime_config_reference.qbk index 38b3da61b0..1180647e94 100644 --- a/doc/runtime_configuration/runtime_config_reference.qbk +++ b/doc/runtime_configuration/runtime_config_reference.qbk @@ -136,8 +136,15 @@ acceptable values list. All values are case sensitive and are required to exactl [__param_detect_fp_exceptions__] [Traps floating point exceptions (on supported platforms).] ] - - + + + [/ ###############################################################################################] + [ + [__param_deprecated_timer_format__] + [Enables output of the deprecated timer format.] + ] + + [/ ###############################################################################################] [ [__param_log_sink__] @@ -548,7 +555,25 @@ Dnables/disable hardware traps for the floating point exception (if supported). BOOST_TEST_DETECT_FP_EXCEPTIONS -[endsect] [/detect_fp_exceptions] +[endsect] [/detect_fp_exceptions] + +[/ ###############################################################################################] +[#ref_param_deprecated_timer_format][section `deprecated_timer_format`] + +Enables the deprecated timer format + +Enables/disables the output of the deprecated timer format for times when using the HRF format. + +[h4 Acceptable values] + +* [*no] (default) +* yes + +[h4 Environment variable] + + BOOST_TEST_DEPRECATED_TIMER_FORMAT + +[endsect] [/deprecated_timer_format] [/ ###############################################################################################] [#ref_param_log_sink][section `log_sink`] diff --git a/doc/test.qbk b/doc/test.qbk index 76cfb1a0cc..7057a29158 100644 --- a/doc/test.qbk +++ b/doc/test.qbk @@ -120,27 +120,28 @@ [/ runtime/cla parameters] -[def __param_show_progress__ [link ref_param_show_progress `show_progress`]] -[def __param_log_level__ [link ref_param_log_level `log_level`]] -[def __param_output_format__ [link ref_param_output_format `output_format`]] -[def __param_log_format__ [link ref_param_log_format `log_format`]] -[def __param_run_test__ [link ref_param_run_test `run_test`]] -[def __param_report_level__ [link ref_param_report_level `report_level`]] -[def __param_report_format__ [link ref_param_report_format `report_format`]] -[def __param_catch_system__ [link ref_param_catch_system `catch_system_error`]] -[def __param_result_code__ [link ref_param_result_code `result_code`]] -[def __param_build_info__ [link ref_param_build_info `build_info`]] -[def __param_auto_start_dbg__ [link ref_param_auto_dbg `auto_start_dbg`]] -[def __param_break_exec_path__ [link ref_param_break_exe_path `break_exec_path`]] -[def __param_color_output__ [link ref_param_color_output `color_output`]] -[def __param_random__ [link ref_param_random `random`]] -[def __param_detect_memory_leaks__ [link ref_param_detect_memory_leaks `detect_memory_leaks`]] -[def __param_use_alt_stack__ [link ref_param_use_alt_stack `use_alt_stack`]] -[def __param_detect_fp_exceptions__ [link ref_param_detect_fp_exceptions `detect_fp_exceptions`]] -[def __param_log_sink__ [link ref_param_log_sink `log_sink`]] -[def __param_report_sink__ [link ref_param_report_sink `report_sink`]] -[def __param_save_pattern__ [link ref_param_save_patterm `save_patterm`]] -[def __param_list_content__ [link boost_test.users_guide.runtime_config.rt_param_reference.param_list_content `list_content`]] +[def __param_show_progress__ [link ref_param_show_progress `show_progress`]] +[def __param_log_level__ [link ref_param_log_level `log_level`]] +[def __param_output_format__ [link ref_param_output_format `output_format`]] +[def __param_log_format__ [link ref_param_log_format `log_format`]] +[def __param_run_test__ [link ref_param_run_test `run_test`]] +[def __param_report_level__ [link ref_param_report_level `report_level`]] +[def __param_report_format__ [link ref_param_report_format `report_format`]] +[def __param_catch_system__ [link ref_param_catch_system `catch_system_error`]] +[def __param_result_code__ [link ref_param_result_code `result_code`]] +[def __param_build_info__ [link ref_param_build_info `build_info`]] +[def __param_auto_start_dbg__ [link ref_param_auto_dbg `auto_start_dbg`]] +[def __param_break_exec_path__ [link ref_param_break_exe_path `break_exec_path`]] +[def __param_color_output__ [link ref_param_color_output `color_output`]] +[def __param_random__ [link ref_param_random `random`]] +[def __param_detect_memory_leaks__ [link ref_param_detect_memory_leaks `detect_memory_leaks`]] +[def __param_use_alt_stack__ [link ref_param_use_alt_stack `use_alt_stack`]] +[def __param_detect_fp_exceptions__ [link ref_param_detect_fp_exceptions `detect_fp_exceptions`]] +[def __param_deprecated_timer_format__ [link ref_param_deprecated_timer_format `deprecated_timer_format`]] +[def __param_log_sink__ [link ref_param_log_sink `log_sink`]] +[def __param_report_sink__ [link ref_param_report_sink `report_sink`]] +[def __param_save_pattern__ [link ref_param_save_patterm `save_patterm`]] +[def __param_list_content__ [link boost_test.users_guide.runtime_config.rt_param_reference.param_list_content `list_content`]] [/=============================================================================] [/ templates ] From fa6f4f34bed04e938b4020df51918c776b77402a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Hunold?= Date: Sat, 10 Jan 2015 11:44:45 +0100 Subject: [PATCH 4/8] correct dependencies Boost.Timer and Boost.System --- build/Jamfile.v2 | 2 +- test/Jamfile.v2 | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 index d1a8c37cdd..359b7446c8 100644 --- a/build/Jamfile.v2 +++ b/build/Jamfile.v2 @@ -29,7 +29,7 @@ project boost/test # Adding a dependency on boost/timer as the headers need to be there in case of the # header-only usage variant - /boost/timer//boost_timer + /boost/timer//boost_timer ; PRG_EXEC_MON_SOURCES = diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index fb69221709..dc69ccc3a5 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -8,8 +8,6 @@ project : requirements - /boost/system//boost_system - /boost/timer//boost_timer ; From 61f9c789676e2de7c124f78c3146e2afd0179262 Mon Sep 17 00:00:00 2001 From: jamie Date: Sat, 10 Jan 2015 22:50:50 +0000 Subject: [PATCH 5/8] Add Boost.Timer as a dependent library for the single_header_test --- test/Jamfile.v2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index dc69ccc3a5..002fcb22dc 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -107,7 +107,7 @@ test-suite "prg_exec_monitor_test" test-suite "unit_test_framework_test" : [ test-btl-lib run : errors_handling_test : boost_unit_test_framework : test_files/errors_handling_test.pattern ] - [ test-btl-lib run : single_header_test ] + [ test-btl-lib run : single_header_test : : : single_header_test.cpp : /boost/timer//boost_timer/static ] [ test-btl-lib run-fail : minimal_test ] [ test-btl-lib run : foreach_test ] [ test-btl-lib run : output_test_stream_test : boost_unit_test_framework ] From c53deefca889787eb21472c838b69d67e6b00264 Mon Sep 17 00:00:00 2001 From: jamie Date: Sun, 11 Jan 2015 15:49:04 +0000 Subject: [PATCH 6/8] Add suppress_timer_output option to allow pattern matching of test output --- .../runtime_config_reference.qbk | 31 +++++- .../boost/test/impl/unit_test_parameters.ipp | 23 ++++- include/boost/test/unit_test_parameters.hpp | 6 +- include/boost/test/utils/timer.hpp | 3 +- .../user-guide/runtime-config/reference.html | 96 +++++++++++++------ old_doc/src/utf.user-guide.runtime-config.xml | 57 +++++++---- test/Jamfile.v2 | 8 +- 7 files changed, 161 insertions(+), 63 deletions(-) diff --git a/doc/runtime_configuration/runtime_config_reference.qbk b/doc/runtime_configuration/runtime_config_reference.qbk index 1180647e94..302a0a2cc6 100644 --- a/doc/runtime_configuration/runtime_config_reference.qbk +++ b/doc/runtime_configuration/runtime_config_reference.qbk @@ -163,8 +163,14 @@ acceptable values list. All values are case sensitive and are required to exactl [__param_save_pattern__] [Provides parameters for testing output streams.] ] - - + + + [/ ###############################################################################################] + [ + [__param_suppress_timer_output__] + [Suppress test time output.] + ] + [/ ###############################################################################################] [ [__param_list_content__] @@ -639,7 +645,26 @@ You can use this parameter to switch between these modes, by passing the paramet BOOST_TEST_SAVE_PATTERN -[endsect] [/save_patterm] +[endsect] [/save_patterm] + +[/ ###############################################################################################] +[#ref_param_suppress_timer_output][section `suppress_timer_output`] + +Suppresses writing of test time output. + +Suppresses the output testing times. This is useful if you want to pattern match on test output but +the test times make that difficult. + +[h4 Acceptable values] + +* [*no] (default) +* yes + +[h4 Environment variable] + + BOOST_TEST_SUPPRESS_TIMER_OUTPUT + +[endsect] [/suppress_timer_output] [/ ###############################################################################################] [section:param_list_content `list_content`] diff --git a/include/boost/test/impl/unit_test_parameters.ipp b/include/boost/test/impl/unit_test_parameters.ipp index 0369442e67..463cc6ef2b 100644 --- a/include/boost/test/impl/unit_test_parameters.ipp +++ b/include/boost/test/impl/unit_test_parameters.ipp @@ -157,9 +157,9 @@ std::string BREAK_EXEC_PATH = "break_exec_path"; std::string BUILD_INFO = "build_info"; std::string CATCH_SYS_ERRORS = "catch_system_errors"; std::string COLOR_OUTPUT = "color_output"; +std::string DEPRECATED_TIMER_FORMAT = "deprecated_timer_format"; std::string DETECT_FP_EXCEPT = "detect_fp_exceptions"; std::string DETECT_MEM_LEAKS = "detect_memory_leaks"; -std::string DEPRECATED_TIMER_FORMAT = "deprecated_timer_format"; std::string LIST_CONTENT = "list_content"; std::string LOG_FORMAT = "log_format"; std::string LOG_LEVEL = "log_level"; @@ -173,6 +173,7 @@ std::string RESULT_CODE = "result_code"; std::string TESTS_TO_RUN = "run_test"; std::string SAVE_TEST_PATTERN = "save_pattern"; std::string SHOW_PROGRESS = "show_progress"; +std::string SUPPRESS_TIMER_OUTPUT = "suppress_timer_output"; std::string USE_ALT_STACK = "use_alt_stack"; std::string WAIT_FOR_DEBUGGER = "wait_for_debugger"; @@ -188,9 +189,9 @@ parameter_2_env_var( const_string param_name ) s_mapping[BUILD_INFO] = "BOOST_TEST_BUILD_INFO"; s_mapping[CATCH_SYS_ERRORS] = "BOOST_TEST_CATCH_SYSTEM_ERRORS"; s_mapping[COLOR_OUTPUT] = "BOOST_TEST_COLOR_OUTPUT"; + s_mapping[DEPRECATED_TIMER_FORMAT] = "BOOST_TEST_DEPRECATED_TIMER_FORMAT"; s_mapping[DETECT_FP_EXCEPT] = "BOOST_TEST_DETECT_FP_EXCEPTIONS"; s_mapping[DETECT_MEM_LEAKS] = "BOOST_TEST_DETECT_MEMORY_LEAK"; - s_mapping[DEPRECATED_TIMER_FORMAT] = "BOOST_TEST_DEPRECATED_TIMER_FORMAT"; s_mapping[LIST_CONTENT] = "BOOST_TEST_LIST_CONTENT"; s_mapping[LOG_FORMAT] = "BOOST_TEST_LOG_FORMAT"; s_mapping[LOG_LEVEL] = "BOOST_TEST_LOG_LEVEL"; @@ -204,6 +205,7 @@ parameter_2_env_var( const_string param_name ) s_mapping[TESTS_TO_RUN] = "BOOST_TESTS_TO_RUN"; s_mapping[SAVE_TEST_PATTERN] = "BOOST_TEST_SAVE_PATTERN"; s_mapping[SHOW_PROGRESS] = "BOOST_TEST_SHOW_PROGRESS"; + s_mapping[SUPPRESS_TIMER_OUTPUT] = "BOOST_TEST_SUPPRESS_TIMER_OUTPUT"; s_mapping[USE_ALT_STACK] = "BOOST_TEST_USE_ALT_STACK"; s_mapping[WAIT_FOR_DEBUGGER] = "BOOST_TEST_WAIT_FOR_DEBUGGER"; } @@ -284,15 +286,15 @@ init( int& argc, char** argv ) << cla::dual_name_parameter( COLOR_OUTPUT + "|x" ) - (cla::prefix = "--|-",cla::separator = "=| ",cla::guess_name,cla::optional, cla::description = "Allows to switch between catching and ignoring system errors (signals)") + << cla::named_parameter( DEPRECATED_TIMER_FORMAT ) + - (cla::prefix = "--",cla::separator = "=",cla::guess_name,cla::optional, + cla::description = "Forces HRF output for timing information to mimic the deprecated boost timer output") << cla::named_parameter( DETECT_FP_EXCEPT ) - (cla::prefix = "--",cla::separator = "=",cla::guess_name,cla::optional, cla::description = "Allows to switch between catching and ignoring floating point exceptions") << cla::named_parameter( DETECT_MEM_LEAKS ) - (cla::prefix = "--",cla::separator = "=",cla::guess_name,cla::optional,cla::optional_value, cla::description = "Allows to switch between catching and ignoring memory leaks") - << cla::named_parameter( DEPRECATED_TIMER_FORMAT ) - - (cla::prefix = "--",cla::separator = "=",cla::guess_name,cla::optional,cla::optional_value, - cla::description = "Forces HRF output for timing information to mimic the deprecated boost timer output") << cla::dual_name_parameter( LOG_FORMAT + "|f" ) - (cla::prefix = "--|-",cla::separator = "=| ",cla::guess_name,cla::optional, cla::description = "Specifies log format") @@ -330,6 +332,9 @@ init( int& argc, char** argv ) << cla::dual_name_parameter( SHOW_PROGRESS + "|p" ) - (cla::prefix = "--|-",cla::separator = "=| ",cla::guess_name,cla::optional, cla::description = "Turns on progress display") + << cla::named_parameter( SUPPRESS_TIMER_OUTPUT ) + - (cla::prefix = "--",cla::separator = "=",cla::guess_name,cla::optional, + cla::description = "Suppresses the display of timer output when a test completes") << cla::dual_name_parameter( LIST_CONTENT + "|j" ) - (cla::prefix = "--|-",cla::separator = "=| ",cla::guess_name,cla::optional,cla::optional_value, cla::description = "Lists the content of test tree - names of all test suites and test cases") @@ -512,6 +517,14 @@ deprecated_timer_format() //____________________________________________________________________________// +bool +suppress_timer_output() +{ + return retrieve_parameter( SUPPRESS_TIMER_OUTPUT, s_cla_parser, false ); +} + +//____________________________________________________________________________// + output_format report_format() { diff --git a/include/boost/test/unit_test_parameters.hpp b/include/boost/test/unit_test_parameters.hpp index a21fa1b5de..e516d86ea5 100644 --- a/include/boost/test/unit_test_parameters.hpp +++ b/include/boost/test/unit_test_parameters.hpp @@ -42,12 +42,12 @@ BOOST_TEST_DECL const_string break_exec_path(); BOOST_TEST_DECL bool catch_sys_errors(); /// Should we try to produce color output? BOOST_TEST_DECL bool color_output(); +/// Enable output of deprecated timer format? +BOOST_TEST_DECL bool deprecated_timer_format(); /// Should we detect floating point exceptions? BOOST_TEST_DECL bool detect_fp_exceptions(); /// Should we detect memory leaks (>0)? And if yes, which specific memory allocation should we break. BOOST_TEST_DECL long detect_memory_leaks(); -/// Enable output of deprecated timer format? -BOOST_TEST_DECL bool deprecated_timer_format(); /// Print content of test tree? BOOST_TEST_DECL bool list_content(); /// Which output format to use @@ -74,6 +74,8 @@ BOOST_TEST_DECL bool save_pattern(); BOOST_TEST_DECL bool show_build_info(); /// Tells Unit Test Framework to show test progress (forces specific log level) BOOST_TEST_DECL bool show_progress(); +/// Suppress test time output +BOOST_TEST_DECL bool suppress_timer_output(); /// Specific test units to run/exclude BOOST_TEST_DECL std::list const& test_to_run(); /// Should execution monitor use alternative stack for signal handling diff --git a/include/boost/test/utils/timer.hpp b/include/boost/test/utils/timer.hpp index 4e8e68878f..02b7c06be7 100644 --- a/include/boost/test/utils/timer.hpp +++ b/include/boost/test/utils/timer.hpp @@ -69,7 +69,8 @@ inline std::string to_xml( elapsed_t elapsed ) inline bool has_time( const elapsed_t& elapsed ) { - return elapsed.wall != 0 || elapsed.user != 0 || elapsed.system != 0; + return !runtime_config::suppress_timer_output() + && ( elapsed.wall != 0 || elapsed.user != 0 || elapsed.system != 0 ); } //____________________________________________________________________________// diff --git a/old_doc/html/utf/user-guide/runtime-config/reference.html b/old_doc/html/utf/user-guide/runtime-config/reference.html index 807976b95e..4e8c232527 100755 --- a/old_doc/html/utf/user-guide/runtime-config/reference.html +++ b/old_doc/html/utf/user-guide/runtime-config/reference.html @@ -43,9 +43,9 @@
  • build_info
  • catch_system_errors
  • color_output
  • +
  • deprecated_timer_format
  • detect_fp_exceptions
  • detect_memory_leaks
  • -
  • deprecated_timer_format
  • log_format
  • log_level
  • log_sink
  • @@ -58,6 +58,7 @@
  • run_test
  • save_patterm
  • show_progress
  • +
  • suppress_timer_output
  • use_alt_stack
  • @@ -242,22 +243,22 @@

    -
    +
    - + - + - + @@ -271,86 +272,86 @@
    Parameter Name : [Do not] trap floating point exceptionsForce the timer output format to match the deprecated Boost.Timer
    Environment variable name : BOOST_TEST_DETECT_FP_EXCEPTIONSBOOST_TEST_DEPRECATED_TIMER_FORMAT
    Command line argument name : detect_fp_exceptionsdeprecated_timer_format
    Acceptable ValuesDescription :

    - enables/disable hardware traps for the floating point exception if they are supported. By default is disabled. + Specifying this option forces any timer output to match that provided by the deprecated Boost.Timer + class. If you use scripts that parse either the HRF or XML output for Boost.Test and find you are no + longer able to parse the output correctly then enabling this feature should allow your scripts to + work as before. Disabled by default.


    -
    +
    - + - + - +
    Parameter Name : Detect memory leaks[Do not] trap floating point exceptions
    Environment variable name : BOOST_TEST_DETECT_MEMORY_LEAKBOOST_TEST_DETECT_FP_EXCEPTIONS
    Command line argument name : detect_memory_leaksdetect_fp_exceptions
    Acceptable Values : - - - + +
    0
    1
    integer value > 1
    no
    yes
    Description :

    - Positive value tells the framework to detect the memory leaks (if any). In addition any value greater than 1 - is treated as leak allocation number and setups runtime breakpoint. In other words setting this parameter to - the positive value N greater than 1 causes the framework to set a breakpoint at Nth memory allocation (don't - do that from the command line - only when you are under debugger). Note: if your test program produces memory - leaks notifications, they are combined with allocation number values you could use to set a breakpoint. - Currently only applies to MS family of compilers in debug builds. + enables/disable hardware traps for the floating point exception if they are supported. By default is disabled.


    -
    +
    - + - + - +
    Parameter Name : Force the timer output format to match the deprecated Boost.TimerDetect memory leaks
    Environment variable name : BOOST_TEST_DEPRECATED_TIMER_FORMATBOOST_TEST_DETECT_MEMORY_LEAK
    Command line argument name : deprecated_timer_formatdetect_memory_leaks
    Acceptable Values : - - + + +
    no
    yes
    0
    1
    integer value > 1
    Description :

    - Specifying this option forces any timer output to match that provided by the deprecated Boost.Timer - class. If you use scripts that parse either the HRF or XML output for Boost.Test and find you are no - longer able to parse the output correctly then enabling this feature should allow your scripts to - work as before. Disabled by default. + Positive value tells the framework to detect the memory leaks (if any). In addition any value greater than 1 + is treated as leak allocation number and setups runtime breakpoint. In other words setting this parameter to + the positive value N greater than 1 causes the framework to set a breakpoint at Nth memory allocation (don't + do that from the command line - only when you are under debugger). Note: if your test program produces memory + leaks notifications, they are combined with allocation number values you could use to set a breakpoint. + Currently only applies to MS family of compilers in debug builds.

    @@ -842,6 +843,43 @@
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Parameter Name: Suppress test time output
    Environment variable name: BOOST_TEST_SUPPRESS_TIMER_OUTPUT
    Command line argument name: suppress_timer_output
    Acceptable Values: + + +
    no
    yes
    Description:

    + Specifying this argument suppresses the display of test times. This can be useful + if you want to pattern match on the raw test output as test times will not add + any variations to different test runs. +

    +
    +
    diff --git a/old_doc/src/utf.user-guide.runtime-config.xml b/old_doc/src/utf.user-guide.runtime-config.xml index 649b9b436c..cc3e7ca0e0 100644 --- a/old_doc/src/utf.user-guide.runtime-config.xml +++ b/old_doc/src/utf.user-guide.runtime-config.xml @@ -337,6 +337,24 @@ Leaving test suite "example" + + Use the deprecated timer format for output + BOOST_TEST_DEPRECATED_TIMER_FORMAT + deprecated_timer_format + + + no + yes + + + + + This ensures timer test output matches the format produced for the deprecated Boost.Timer class. Otherwise + updated output will be displayed that provides Wall, User and System times. + + + + [Do not] trap floating point exceptions BOOST_TEST_DETECT_FP_EXCEPTIONS @@ -377,24 +395,6 @@ Leaving test suite "example" - - Use the deprecated timer format for output - BOOST_TEST_DEPRECATED_TIMER_FORMAT - deprecated_timer_format - - - no - yes - - - - - This ensures timer test output matches the format produced for the deprecated Boost.Timer class. Otherwise - updated output will be displayed that provides Wall, User and System times. - - - - The log format BOOST_TEST_LOG_FORMAT @@ -662,7 +662,26 @@ Leaving test suite "example" makes the framework to print progress information. - + + + Suppress test time output + BOOST_TEST_SUPPRESS_TIMER_OUTPUT + suppress_timer_output + + + no + yes + + + + + Specifying this argument suppresses the display of test times. This can be useful + if you want to pattern match on the raw test output as test times will not add + any variations to different test runs. + + + + Use alternative stack BOOST_TEST_USE_ALT_STACK diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 002fcb22dc..30623739c0 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -15,7 +15,7 @@ rule test-btl-lib ( test-rule : test-name : lib-name ? : pattern_file * : source { source_files ?= $(test-name).cpp ; return [ $(test-rule) $(source_files) ../build//$(lib-name) $(extra-libs) - : #args + : --suppress_timer_output : $(pattern_file) : #on # Activating -pedantic finds more gotchas @@ -39,7 +39,7 @@ rule test-btl-lib-c11 ( test-rule : test-name : lib-name ? : pattern_file * : so { source_files ?= $(test-name).cpp ; return [ $(test-rule) $(source_files) ../build//$(lib-name) $(extra-libs) - : #args + : --suppress_timer_output : $(pattern_file) : #on # Activating -pedantic finds more gotchas @@ -68,7 +68,7 @@ rule test-btl-lib-mt ( test-rule : test-name : lib-name ? : pattern_file * : sou source_files ?= $(test-name).cpp ; return [ $(test-rule) $(source_files) ../build//$(lib-name) $(extra-libs) - : #args + : --suppress_timer_output : $(pattern_file) : #on # Activating -pedantic finds more gotchas @@ -107,7 +107,7 @@ test-suite "prg_exec_monitor_test" test-suite "unit_test_framework_test" : [ test-btl-lib run : errors_handling_test : boost_unit_test_framework : test_files/errors_handling_test.pattern ] - [ test-btl-lib run : single_header_test : : : single_header_test.cpp : /boost/timer//boost_timer/static ] + [ test-btl-lib run : single_header_test : : : single_header_test.cpp : /boost/timer//boost_timer/static ] [ test-btl-lib run-fail : minimal_test ] [ test-btl-lib run : foreach_test ] [ test-btl-lib run : output_test_stream_test : boost_unit_test_framework ] From 6d5fdb93a21a74be5b279f445ff0998ded642fe1 Mon Sep 17 00:00:00 2001 From: jamie Date: Mon, 12 Jan 2015 11:57:37 +0000 Subject: [PATCH 7/8] Update has_time() to take into consideration --deprecated_timer_format --- include/boost/test/utils/timer.hpp | 6 ++++++ test/Jamfile.v2 | 26 +++++++++++++------------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/include/boost/test/utils/timer.hpp b/include/boost/test/utils/timer.hpp index 02b7c06be7..fde7f6c746 100644 --- a/include/boost/test/utils/timer.hpp +++ b/include/boost/test/utils/timer.hpp @@ -69,8 +69,14 @@ inline std::string to_xml( elapsed_t elapsed ) inline bool has_time( const elapsed_t& elapsed ) { + if( runtime_config::deprecated_timer_format() ) + { + return !runtime_config::suppress_timer_output() + && ( elapsed.user != 0 || elapsed.system != 0 ); + } return !runtime_config::suppress_timer_output() && ( elapsed.wall != 0 || elapsed.user != 0 || elapsed.system != 0 ); + } //____________________________________________________________________________// diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 30623739c0..ae6374ed5c 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -1,6 +1,6 @@ # (C) Copyright Gennadiy Rozental 2001-2014. -# Use, modification, and distribution are subject to the -# Boost Software License, Version 1.0. (See accompanying file +# Use, modification, and distribution are subject to the +# Boost Software License, Version 1.0. (See accompanying file # LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) # # See http://www.boost.org/libs/test for the library home page. @@ -15,9 +15,9 @@ rule test-btl-lib ( test-rule : test-name : lib-name ? : pattern_file * : source { source_files ?= $(test-name).cpp ; return [ $(test-rule) $(source_files) ../build//$(lib-name) $(extra-libs) - : --suppress_timer_output + : --deprecated_timer_format : $(pattern_file) - : #on + : #on # Activating -pedantic finds more gotchas # Unfortunately, this warns about the use of "long long" in gcc's own stdlib # So deactivate those warnings again @@ -39,9 +39,9 @@ rule test-btl-lib-c11 ( test-rule : test-name : lib-name ? : pattern_file * : so { source_files ?= $(test-name).cpp ; return [ $(test-rule) $(source_files) ../build//$(lib-name) $(extra-libs) - : --suppress_timer_output + : --deprecated_timer_format : $(pattern_file) - : #on + : #on # Activating -pedantic finds more gotchas # Unfortunately, this warns about the use of "long long" in gcc's own stdlib # So deactivate those warnings again @@ -68,9 +68,9 @@ rule test-btl-lib-mt ( test-rule : test-name : lib-name ? : pattern_file * : sou source_files ?= $(test-name).cpp ; return [ $(test-rule) $(source_files) ../build//$(lib-name) $(extra-libs) - : --suppress_timer_output + : --deprecated_timer_format : $(pattern_file) - : #on + : #on # Activating -pedantic finds more gotchas # Unfortunately, this warns about the use of "long long" in gcc's own stdlib # So deactivate those warnings again @@ -83,7 +83,7 @@ rule test-btl-lib-mt ( test-rule : test-name : lib-name ? : pattern_file * : sou gcc-4.5:-std=gnu++0x gcc-4.7:-std=gnu++11 clang:-Wno-c99-extensions - clang:-Wno-variadic-macros + clang:-Wno-variadic-macros BOOST_TEST_NO_AUTO_LINK=1 # requirements multi all @@ -138,8 +138,8 @@ test-suite "multithreaded_test" [ test-btl-lib-mt run : sync_access_test : boost_unit_test_framework/static : : : /boost/thread//boost_thread/static ] ; -# A target that runs all the tests -alias test : basics_test prg_exec_monitor_test unit_test_framework_test ; - -# Only run tests when explicitly requested +# A target that runs all the tests +alias test : basics_test prg_exec_monitor_test unit_test_framework_test ; + +# Only run tests when explicitly requested # explicit test basics_test prg_exec_monitor_test unit_test_framework_test ; From d442454b2108e67917867359625f6a044e9d473f Mon Sep 17 00:00:00 2001 From: jamie Date: Mon, 12 Jan 2015 12:19:38 +0000 Subject: [PATCH 8/8] Remove --suppress_timer_output. Update test rules to allow passing arguments --- .../runtime_config_reference.qbk | 26 ------- .../boost/test/impl/unit_test_parameters.ipp | 13 ---- include/boost/test/unit_test_parameters.hpp | 2 - include/boost/test/utils/timer.hpp | 6 +- .../user-guide/runtime-config/reference.html | 38 --------- old_doc/src/utf.user-guide.runtime-config.xml | 19 ----- test/Jamfile.v2 | 77 +++++++++---------- 7 files changed, 38 insertions(+), 143 deletions(-) diff --git a/doc/runtime_configuration/runtime_config_reference.qbk b/doc/runtime_configuration/runtime_config_reference.qbk index 302a0a2cc6..d3ba622e40 100644 --- a/doc/runtime_configuration/runtime_config_reference.qbk +++ b/doc/runtime_configuration/runtime_config_reference.qbk @@ -164,13 +164,6 @@ acceptable values list. All values are case sensitive and are required to exactl [Provides parameters for testing output streams.] ] - - [/ ###############################################################################################] - [ - [__param_suppress_timer_output__] - [Suppress test time output.] - ] - [/ ###############################################################################################] [ [__param_list_content__] @@ -647,25 +640,6 @@ You can use this parameter to switch between these modes, by passing the paramet [endsect] [/save_patterm] -[/ ###############################################################################################] -[#ref_param_suppress_timer_output][section `suppress_timer_output`] - -Suppresses writing of test time output. - -Suppresses the output testing times. This is useful if you want to pattern match on test output but -the test times make that difficult. - -[h4 Acceptable values] - -* [*no] (default) -* yes - -[h4 Environment variable] - - BOOST_TEST_SUPPRESS_TIMER_OUTPUT - -[endsect] [/suppress_timer_output] - [/ ###############################################################################################] [section:param_list_content `list_content`] diff --git a/include/boost/test/impl/unit_test_parameters.ipp b/include/boost/test/impl/unit_test_parameters.ipp index 463cc6ef2b..b16d477561 100644 --- a/include/boost/test/impl/unit_test_parameters.ipp +++ b/include/boost/test/impl/unit_test_parameters.ipp @@ -173,7 +173,6 @@ std::string RESULT_CODE = "result_code"; std::string TESTS_TO_RUN = "run_test"; std::string SAVE_TEST_PATTERN = "save_pattern"; std::string SHOW_PROGRESS = "show_progress"; -std::string SUPPRESS_TIMER_OUTPUT = "suppress_timer_output"; std::string USE_ALT_STACK = "use_alt_stack"; std::string WAIT_FOR_DEBUGGER = "wait_for_debugger"; @@ -205,7 +204,6 @@ parameter_2_env_var( const_string param_name ) s_mapping[TESTS_TO_RUN] = "BOOST_TESTS_TO_RUN"; s_mapping[SAVE_TEST_PATTERN] = "BOOST_TEST_SAVE_PATTERN"; s_mapping[SHOW_PROGRESS] = "BOOST_TEST_SHOW_PROGRESS"; - s_mapping[SUPPRESS_TIMER_OUTPUT] = "BOOST_TEST_SUPPRESS_TIMER_OUTPUT"; s_mapping[USE_ALT_STACK] = "BOOST_TEST_USE_ALT_STACK"; s_mapping[WAIT_FOR_DEBUGGER] = "BOOST_TEST_WAIT_FOR_DEBUGGER"; } @@ -332,9 +330,6 @@ init( int& argc, char** argv ) << cla::dual_name_parameter( SHOW_PROGRESS + "|p" ) - (cla::prefix = "--|-",cla::separator = "=| ",cla::guess_name,cla::optional, cla::description = "Turns on progress display") - << cla::named_parameter( SUPPRESS_TIMER_OUTPUT ) - - (cla::prefix = "--",cla::separator = "=",cla::guess_name,cla::optional, - cla::description = "Suppresses the display of timer output when a test completes") << cla::dual_name_parameter( LIST_CONTENT + "|j" ) - (cla::prefix = "--|-",cla::separator = "=| ",cla::guess_name,cla::optional,cla::optional_value, cla::description = "Lists the content of test tree - names of all test suites and test cases") @@ -517,14 +512,6 @@ deprecated_timer_format() //____________________________________________________________________________// -bool -suppress_timer_output() -{ - return retrieve_parameter( SUPPRESS_TIMER_OUTPUT, s_cla_parser, false ); -} - -//____________________________________________________________________________// - output_format report_format() { diff --git a/include/boost/test/unit_test_parameters.hpp b/include/boost/test/unit_test_parameters.hpp index e516d86ea5..c26c53737c 100644 --- a/include/boost/test/unit_test_parameters.hpp +++ b/include/boost/test/unit_test_parameters.hpp @@ -74,8 +74,6 @@ BOOST_TEST_DECL bool save_pattern(); BOOST_TEST_DECL bool show_build_info(); /// Tells Unit Test Framework to show test progress (forces specific log level) BOOST_TEST_DECL bool show_progress(); -/// Suppress test time output -BOOST_TEST_DECL bool suppress_timer_output(); /// Specific test units to run/exclude BOOST_TEST_DECL std::list const& test_to_run(); /// Should execution monitor use alternative stack for signal handling diff --git a/include/boost/test/utils/timer.hpp b/include/boost/test/utils/timer.hpp index fde7f6c746..53b7a3f94a 100644 --- a/include/boost/test/utils/timer.hpp +++ b/include/boost/test/utils/timer.hpp @@ -71,11 +71,9 @@ inline bool has_time( const elapsed_t& elapsed ) { if( runtime_config::deprecated_timer_format() ) { - return !runtime_config::suppress_timer_output() - && ( elapsed.user != 0 || elapsed.system != 0 ); + return elapsed.user != 0 || elapsed.system != 0 ; } - return !runtime_config::suppress_timer_output() - && ( elapsed.wall != 0 || elapsed.user != 0 || elapsed.system != 0 ); + return elapsed.wall != 0 || elapsed.user != 0 || elapsed.system != 0; } diff --git a/old_doc/html/utf/user-guide/runtime-config/reference.html b/old_doc/html/utf/user-guide/runtime-config/reference.html index 4e8c232527..0b1023c5a2 100755 --- a/old_doc/html/utf/user-guide/runtime-config/reference.html +++ b/old_doc/html/utf/user-guide/runtime-config/reference.html @@ -58,7 +58,6 @@
  • run_test
  • save_patterm
  • show_progress
  • -
  • suppress_timer_output
  • use_alt_stack
  • @@ -843,43 +842,6 @@

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Parameter Name: Suppress test time output
    Environment variable name: BOOST_TEST_SUPPRESS_TIMER_OUTPUT
    Command line argument name: suppress_timer_output
    Acceptable Values: - - -
    no
    yes
    Description:

    - Specifying this argument suppresses the display of test times. This can be useful - if you want to pattern match on the raw test output as test times will not add - any variations to different test runs. -

    -
    -
    diff --git a/old_doc/src/utf.user-guide.runtime-config.xml b/old_doc/src/utf.user-guide.runtime-config.xml index cc3e7ca0e0..ece88fd68e 100644 --- a/old_doc/src/utf.user-guide.runtime-config.xml +++ b/old_doc/src/utf.user-guide.runtime-config.xml @@ -663,25 +663,6 @@ Leaving test suite "example" - - Suppress test time output - BOOST_TEST_SUPPRESS_TIMER_OUTPUT - suppress_timer_output - - - no - yes - - - - - Specifying this argument suppresses the display of test times. This can be useful - if you want to pattern match on the raw test output as test times will not add - any variations to different test runs. - - - - Use alternative stack BOOST_TEST_USE_ALT_STACK diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index ae6374ed5c..b3aeeca597 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -6,16 +6,11 @@ # See http://www.boost.org/libs/test for the library home page. -project - : requirements - ; - - -rule test-btl-lib ( test-rule : test-name : lib-name ? : pattern_file * : source_files * : extra-libs ? : extra-options ? ) +rule test-btl-lib ( test-rule : test-name : args * : lib-name ? : pattern_file * : source_files * : extra-libs ? : extra-options ? ) { source_files ?= $(test-name).cpp ; return [ $(test-rule) $(source_files) ../build//$(lib-name) $(extra-libs) - : --deprecated_timer_format + : $(args) : $(pattern_file) : #on # Activating -pedantic finds more gotchas @@ -35,11 +30,11 @@ rule test-btl-lib ( test-rule : test-name : lib-name ? : pattern_file * : source ] ; } -rule test-btl-lib-c11 ( test-rule : test-name : lib-name ? : pattern_file * : source_files * : extra-libs ? : extra-options ? ) +rule test-btl-lib-c11 ( test-rule : test-name : args * : lib-name ? : pattern_file * : source_files * : extra-libs ? : extra-options ? ) { source_files ?= $(test-name).cpp ; return [ $(test-rule) $(source_files) ../build//$(lib-name) $(extra-libs) - : --deprecated_timer_format + : $(args) : $(pattern_file) : #on # Activating -pedantic finds more gotchas @@ -63,12 +58,12 @@ rule test-btl-lib-c11 ( test-rule : test-name : lib-name ? : pattern_file * : so ] ; } -rule test-btl-lib-mt ( test-rule : test-name : lib-name ? : pattern_file * : source_files * : extra-libs ? ) +rule test-btl-lib-mt ( test-rule : test-name : args * : lib-name ? : pattern_file * : source_files * : extra-libs ? ) { source_files ?= $(test-name).cpp ; return [ $(test-rule) $(source_files) ../build//$(lib-name) $(extra-libs) - : --deprecated_timer_format + : $(args) : $(pattern_file) : #on # Activating -pedantic finds more gotchas @@ -93,49 +88,49 @@ rule test-btl-lib-mt ( test-rule : test-name : lib-name ? : pattern_file * : sou test-suite "basics_test" : - [ test-btl-lib run : class_properties_test : boost_unit_test_framework ] - [ test-btl-lib run : basic_cstring_test : boost_unit_test_framework/static ] + [ test-btl-lib run : class_properties_test : : boost_unit_test_framework ] + [ test-btl-lib run : basic_cstring_test : : boost_unit_test_framework/static ] ; test-suite "prg_exec_monitor_test" - : [ test-btl-lib run-fail : prg_exec_fail1 : included ] - [ test-btl-lib run-fail : prg_exec_fail2 : boost_prg_exec_monitor/static ] - [ test-btl-lib run-fail : prg_exec_fail3 : boost_prg_exec_monitor/static ] - [ test-btl-lib run-fail : prg_exec_fail4 : boost_prg_exec_monitor/static ] + : [ test-btl-lib run-fail : prg_exec_fail1 : : included ] + [ test-btl-lib run-fail : prg_exec_fail2 : : boost_prg_exec_monitor/static ] + [ test-btl-lib run-fail : prg_exec_fail3 : : boost_prg_exec_monitor/static ] + [ test-btl-lib run-fail : prg_exec_fail4 : : boost_prg_exec_monitor/static ] ; test-suite "unit_test_framework_test" : - [ test-btl-lib run : errors_handling_test : boost_unit_test_framework : test_files/errors_handling_test.pattern ] - [ test-btl-lib run : single_header_test : : : single_header_test.cpp : /boost/timer//boost_timer/static ] + [ test-btl-lib run : errors_handling_test : --deprecated_timer_format : boost_unit_test_framework : test_files/errors_handling_test.pattern ] + [ test-btl-lib run : single_header_test : : : : single_header_test.cpp : /boost/timer//boost_timer/static ] [ test-btl-lib run-fail : minimal_test ] [ test-btl-lib run : foreach_test ] - [ test-btl-lib run : output_test_stream_test : boost_unit_test_framework ] - [ test-btl-lib run : result_report_test : boost_unit_test_framework : test_files/result_report_test.pattern ] - [ test-btl-lib run : parameterized_test_test : boost_unit_test_framework ] - [ test-btl-lib run : test_fp_comparisons : boost_unit_test_framework ] - [ test-btl-lib run : test_tools_test : boost_unit_test_framework : test_files/test_tools_test.pattern ] - [ test-btl-lib run : test_case_template_test : boost_unit_test_framework ] - [ test-btl-lib run : custom_exception_test : boost_unit_test_framework/static ] - [ test-btl-lib run : fixed_mapping_test : boost_unit_test_framework ] - [ test-btl-lib run : ifstream_line_iterator_test : boost_unit_test_framework : test_files/ifstream_line_iterator.tst1 test_files/ifstream_line_iterator.tst2 ] - [ test-btl-lib run : algorithms_test : boost_unit_test_framework/static ] - [ test-btl-lib run : token_iterator_test : boost_unit_test_framework ] - [ test-btl-lib run : boost_check_equal_str : boost_unit_test_framework ] - [ test-btl-lib run : test_tree_management_test : boost_unit_test_framework ] - [ test-btl-lib run : run_by_name_label_test : boost_unit_test_framework/static ] - [ test-btl-lib run : test_assertion_construction : boost_unit_test_framework/static ] - [ test-btl-lib run : test_datasets : boost_unit_test_framework : : [ glob test_datasets_src/*.cpp ] : ] - # test-rule : test-name : lib-name ? : pattern_file * : source_files * : extra-libs ? : extra-options ? - [ test-btl-lib-c11 run : test_datasets_cxx11 : boost_unit_test_framework : : [ glob test_datasets_src/*.cpp ] : ] - # [ test-btl-lib run : config_file_iterator_test : boost_unit_test_framework/static ] - # [ test-btl-lib run : config_file_test : boost_unit_test_framework/static ] - [ test-btl-lib run : test_dont_print_log_value : boost_unit_test_framework ] + [ test-btl-lib run : output_test_stream_test : : boost_unit_test_framework ] + [ test-btl-lib run : result_report_test : : boost_unit_test_framework : test_files/result_report_test.pattern ] + [ test-btl-lib run : parameterized_test_test : : boost_unit_test_framework ] + [ test-btl-lib run : test_fp_comparisons : : boost_unit_test_framework ] + [ test-btl-lib run : test_tools_test : : boost_unit_test_framework : test_files/test_tools_test.pattern ] + [ test-btl-lib run : test_case_template_test : : boost_unit_test_framework ] + [ test-btl-lib run : custom_exception_test : : boost_unit_test_framework/static ] + [ test-btl-lib run : fixed_mapping_test : : boost_unit_test_framework ] + [ test-btl-lib run : ifstream_line_iterator_test : : boost_unit_test_framework : test_files/ifstream_line_iterator.tst1 test_files/ifstream_line_iterator.tst2 ] + [ test-btl-lib run : algorithms_test : : boost_unit_test_framework/static ] + [ test-btl-lib run : token_iterator_test : : boost_unit_test_framework ] + [ test-btl-lib run : boost_check_equal_str : : boost_unit_test_framework ] + [ test-btl-lib run : test_tree_management_test : : boost_unit_test_framework ] + [ test-btl-lib run : run_by_name_label_test : : boost_unit_test_framework/static ] + [ test-btl-lib run : test_assertion_construction : : boost_unit_test_framework/static ] + [ test-btl-lib run : test_datasets : : boost_unit_test_framework : : [ glob test_datasets_src/*.cpp ] : ] + # test-rule : test-name : args * : lib-name ? : pattern_file * : source_files * : extra-libs ? : extra-options ? + [ test-btl-lib-c11 run : test_datasets_cxx11 : : boost_unit_test_framework : : [ glob test_datasets_src/*.cpp ] : ] + # [ test-btl-lib run : config_file_iterator_test : : boost_unit_test_framework/static ] + # [ test-btl-lib run : config_file_test : : boost_unit_test_framework/static ] + [ test-btl-lib run : test_dont_print_log_value : : boost_unit_test_framework ] ; test-suite "multithreaded_test" : - [ test-btl-lib-mt run : sync_access_test : boost_unit_test_framework/static : : : /boost/thread//boost_thread/static ] + [ test-btl-lib-mt run : sync_access_test : : boost_unit_test_framework/static : : : /boost/thread//boost_thread/static ] ; # A target that runs all the tests