mirror of
https://github.com/boostorg/test.git
synced 2026-01-26 19:12:10 +00:00
after review
This commit is contained in:
@@ -41,11 +41,6 @@ doxygen autodoc_execution_monitor
|
||||
|
||||
# execution monitor source files
|
||||
$(BOOST_ROOT)/libs/test/include/boost/test/execution_monitor.hpp
|
||||
#$(BOOST_ROOT)/libs/test/include/boost/test/impl/execution_monitor.ipp
|
||||
$(BOOST_ROOT)/libs/test/example/exec_mon_example.cpp
|
||||
|
||||
|
||||
|
||||
|
||||
# datasets
|
||||
$(BOOST_ROOT)/libs/test/include/boost/test/data/monomorphic/dataset.hpp
|
||||
@@ -62,7 +57,7 @@ doxygen autodoc_execution_monitor
|
||||
$(BOOST_ROOT)/libs/test/include/boost/test/data/monomorphic/zip.hpp
|
||||
|
||||
# datasets generators
|
||||
$(BOOST_ROOT)/libs/test/include/boost/test/data/monomorphic/generators.hpp
|
||||
$(BOOST_ROOT)/libs/test/include/boost/test/data/monomorphic/generators.hpp
|
||||
$(BOOST_ROOT)/libs/test/include/boost/test/data/monomorphic/generators/keywords.hpp
|
||||
$(BOOST_ROOT)/libs/test/include/boost/test/data/monomorphic/generators/random.hpp
|
||||
$(BOOST_ROOT)/libs/test/include/boost/test/data/monomorphic/generators/xrange.hpp
|
||||
@@ -89,12 +84,9 @@ doxygen autodoc_execution_monitor
|
||||
<doxygen:param>INTERNAL_DOCS=NO
|
||||
;
|
||||
|
||||
|
||||
|
||||
|
||||
doxygen examples
|
||||
:
|
||||
[ glob $(BOOST_ROOT)/libs/test/example/*.cpp ]
|
||||
[ glob $(BOOST_ROOT)/libs/test/example/*.cpp ]
|
||||
:
|
||||
<doxygen:param>EXTRACT_ALL=YES
|
||||
<doxygen:param>"PREDEFINED=\"BOOST_TEST_DECL=\" \\
|
||||
@@ -116,39 +108,6 @@ doxygen examples
|
||||
;
|
||||
|
||||
|
||||
|
||||
xml standalone_doc
|
||||
:
|
||||
test.qbk
|
||||
;
|
||||
|
||||
install images
|
||||
:
|
||||
img/boost.test.logo.png
|
||||
img/class-hier.jpg
|
||||
img/post_build_event.jpg
|
||||
img/post_build_out.jpg
|
||||
img/run_args.jpg
|
||||
:
|
||||
<location>html/boost_test
|
||||
;
|
||||
|
||||
|
||||
boostbook standalone
|
||||
:
|
||||
standalone_doc
|
||||
:
|
||||
<xsl:param>boost.root=../../../../..
|
||||
<xsl:param>chapter.autolabel=0
|
||||
<xsl:param>chunk.section.depth=8
|
||||
<xsl:param>chunk.first.sections=1
|
||||
<xsl:param>toc.section.depth=5
|
||||
<xsl:param>toc.max.depth=3
|
||||
<xsl:param>generate.section.toc.level=10
|
||||
<dependency>autodoc_execution_monitor
|
||||
<format>pdf:<xsl:param>boost.url.prefix=http://www.boost.org/doc/libs/release/libs/test/doc/html
|
||||
;
|
||||
|
||||
########################################################################
|
||||
# HTML documentation for $(BOOST_ROOT)/doc/html
|
||||
|
||||
@@ -159,37 +118,23 @@ xml test_doc
|
||||
|
||||
explicit test_doc ;
|
||||
|
||||
install test_doc_images
|
||||
:
|
||||
img/boost.test.logo.png
|
||||
img/class-hier.jpg
|
||||
img/post_build_event.jpg
|
||||
img/post_build_out.jpg
|
||||
img/run_args.jpg
|
||||
:
|
||||
<location>$(BOOST_ROOT)/doc/html/boost_test
|
||||
;
|
||||
path-constant images_location : html ;
|
||||
|
||||
explicit test_doc_images ;
|
||||
|
||||
path-constant images_location : ../../../../../doc/html ;
|
||||
|
||||
boostbook test
|
||||
boostbook standalone
|
||||
:
|
||||
test_doc
|
||||
:
|
||||
<xsl:param>boost.root=../../../../..
|
||||
<xsl:param>html.stylesheet=boostbook.css
|
||||
<xsl:param>chapter.autolabel=0
|
||||
<xsl:param>chunk.section.depth=8
|
||||
<xsl:param>toc.max.depth=10
|
||||
<xsl:param>toc.section.depth=10
|
||||
<xsl:param>chunk.section.depth=2
|
||||
<xsl:param>chunk.first.sections=1
|
||||
<xsl:param>toc.section.depth=2
|
||||
<xsl:param>toc.max.depth=1
|
||||
<xsl:param>generate.section.toc.level=10
|
||||
<xsl:param>root.filename=boost_test
|
||||
<dependency>autodoc_execution_monitor
|
||||
<xsl:param>generate.section.toc.level=0
|
||||
<format>pdf:<xsl:param>img.src.path=$(images_location)/
|
||||
<format>pdf:<xsl:param>boost.url.prefix=http://www.boost.org/doc/libs/release/libs/test/doc/html
|
||||
:
|
||||
<dependency>test_doc_images
|
||||
<dependency>autodoc_execution_monitor
|
||||
;
|
||||
|
||||
explicit test ;
|
||||
|
||||
163
doc/v2/autodoc_execution_monitor.xml
Normal file → Executable file
163
doc/v2/autodoc_execution_monitor.xml
Normal file → Executable file
@@ -1,16 +1,5 @@
|
||||
<?xml version="1.0" standalone="yes"?>
|
||||
<library-reference><header name="/Users/raffi/Personnel/boost_github/libs/test/example/exec_mon_example.cpp">
|
||||
<struct name="my_exception1"><data-member name="m_res_code"><type>int</type></data-member>
|
||||
<method-group name="public member functions">
|
||||
</method-group>
|
||||
<constructor specifiers="explicit"><parameter name="res_code"><paramtype>int</paramtype></parameter></constructor>
|
||||
</struct><struct name="my_exception2"><data-member name="m_res_code"><type>int</type></data-member>
|
||||
<method-group name="public member functions">
|
||||
</method-group>
|
||||
<constructor specifiers="explicit"><parameter name="res_code"><paramtype>int</paramtype></parameter></constructor>
|
||||
</struct><function name="cpp_main"><type>int</type><parameter name="argc"><paramtype>int</paramtype></parameter><parameter name=""><paramtype>char *</paramtype></parameter></function>
|
||||
</header>
|
||||
<header name="boost/test/data/monomorphic/array.hpp">
|
||||
<library-reference><header name="boost/test/data/monomorphic/array.hpp">
|
||||
<para>Defines monomorphic dataset based on C type arrays. </para><namespace name="boost">
|
||||
<namespace name="unit_test">
|
||||
<namespace name="data">
|
||||
@@ -182,7 +171,21 @@
|
||||
<namespace name="unit_test">
|
||||
<namespace name="data">
|
||||
<namespace name="monomorphic">
|
||||
<struct name="traits"><template>
|
||||
<class name="dataset"><template>
|
||||
<template-type-parameter name="T"/>
|
||||
</template><class name="iterator"><typedef name="ref_type"><type><classname>monomorphic::traits</classname>< T >::ref_type</type></typedef>
|
||||
<method-group name="public member functions">
|
||||
<method name="operator*" cv="= 0" specifiers="virtual"><type>ref_type</type></method>
|
||||
<method name="operator++" cv="= 0" specifiers="virtual"><type>void</type></method>
|
||||
</method-group>
|
||||
<destructor/>
|
||||
</class><typedef name="data_type"><type>T</type></typedef>
|
||||
<typedef name="iter_ptr"><type>boost::shared_ptr< <classname>iterator</classname> ></type></typedef>
|
||||
<method-group name="public member functions">
|
||||
<method name="size" cv="const = 0" specifiers="virtual"><type><classname>data::size_t</classname></type></method>
|
||||
<method name="begin" cv="const = 0" specifiers="virtual"><type>iter_ptr</type></method>
|
||||
</method-group>
|
||||
</class><struct name="traits"><template>
|
||||
<template-type-parameter name="T"/>
|
||||
</template><typedef name="ref_type"><type>T const &</type></typedef>
|
||||
<method-group name="public static functions">
|
||||
@@ -209,21 +212,7 @@
|
||||
<template-type-parameter name="Action"/>
|
||||
</template><parameter name="arg"><paramtype>ref_type</paramtype></parameter><parameter name="action"><paramtype>Action const &</paramtype></parameter></method>
|
||||
</method-group>
|
||||
</struct-specialization><class name="dataset"><template>
|
||||
<template-type-parameter name="T"/>
|
||||
</template><class name="iterator"><typedef name="ref_type"><type><classname>monomorphic::traits</classname>< T >::ref_type</type></typedef>
|
||||
<method-group name="public member functions">
|
||||
<method name="operator*" cv="= 0" specifiers="virtual"><type>ref_type</type></method>
|
||||
<method name="operator++" cv="= 0" specifiers="virtual"><type>void</type></method>
|
||||
</method-group>
|
||||
<destructor/>
|
||||
</class><typedef name="data_type"><type>T</type></typedef>
|
||||
<typedef name="iter_ptr"><type>boost::shared_ptr< <classname>iterator</classname> ></type></typedef>
|
||||
<method-group name="public member functions">
|
||||
<method name="size" cv="const = 0" specifiers="virtual"><type><classname>data::size_t</classname></type></method>
|
||||
<method name="begin" cv="const = 0" specifiers="virtual"><type>iter_ptr</type></method>
|
||||
</method-group>
|
||||
</class>
|
||||
</struct-specialization>
|
||||
|
||||
|
||||
|
||||
@@ -706,7 +695,10 @@
|
||||
<namespace name="unit_test">
|
||||
<namespace name="data">
|
||||
<namespace name="monomorphic">
|
||||
<class name="join"><template>
|
||||
<struct-specialization name="is_dataset"><template>
|
||||
<template-type-parameter name="DS1"/>
|
||||
<template-type-parameter name="DS2"/>
|
||||
</template><specialization><template-arg>join< DS1</template-arg><template-arg>DS2 ></template-arg></specialization><inherit access="public">true_</inherit></struct-specialization><class name="join"><template>
|
||||
<template-type-parameter name="DS1"/>
|
||||
<template-type-parameter name="DS2"/>
|
||||
</template><inherit access="public">boost::unit_test::data::monomorphic::dataset< boost::decay< DS1 >::type::data_type ></inherit><purpose>Defines a new dataset from the concatenation of two datasets. </purpose><description><para>The size of the resulting dataset is the sum of the two underlying datasets. </para></description><struct name="iterator"><inherit access="public">boost::unit_test::data::monomorphic::dataset< T >::iterator</inherit><method-group name="public member functions">
|
||||
@@ -721,10 +713,7 @@
|
||||
</method-group>
|
||||
<constructor><parameter name="ds1"><paramtype>DS1 &&</paramtype></parameter><parameter name="ds2"><paramtype>DS2 &&</paramtype></parameter></constructor>
|
||||
<constructor><parameter name="j"><paramtype><classname>join</classname> &&</paramtype></parameter></constructor>
|
||||
</class><struct-specialization name="is_dataset"><template>
|
||||
<template-type-parameter name="DS1"/>
|
||||
<template-type-parameter name="DS2"/>
|
||||
</template><specialization><template-arg>join< DS1</template-arg><template-arg>DS2 ></template-arg></specialization><inherit access="public">true_</inherit></struct-specialization><namespace name="result_of">
|
||||
</class><namespace name="result_of">
|
||||
<struct name="join"><template>
|
||||
<template-type-parameter name="DS1Gen"/>
|
||||
<template-type-parameter name="DS2Gen"/>
|
||||
@@ -804,7 +793,9 @@
|
||||
<namespace name="unit_test">
|
||||
<namespace name="data">
|
||||
<namespace name="monomorphic">
|
||||
<class name="singleton"><template>
|
||||
<struct-specialization name="is_dataset"><template>
|
||||
<template-type-parameter name="T"/>
|
||||
</template><specialization><template-arg>singleton< T ></template-arg></specialization><inherit access="public">true_</inherit></struct-specialization><class name="singleton"><template>
|
||||
<template-type-parameter name="T"/>
|
||||
</template><inherit access="public">boost::unit_test::data::monomorphic::dataset< boost::decay< T >::type ></inherit><purpose>Models a single element data set. </purpose><struct name="iterator"><inherit access="public">boost::unit_test::data::monomorphic::dataset< T >::iterator</inherit><method-group name="public member functions">
|
||||
<method name="operator*" specifiers="virtual"><type>base::data_type const &</type></method>
|
||||
@@ -819,9 +810,7 @@
|
||||
</method-group>
|
||||
<constructor specifiers="explicit"><parameter name="value"><paramtype>T &&</paramtype></parameter></constructor>
|
||||
<constructor><parameter name="s"><paramtype><classname>singleton</classname> &&</paramtype></parameter></constructor>
|
||||
</class><struct-specialization name="is_dataset"><template>
|
||||
<template-type-parameter name="T"/>
|
||||
</template><specialization><template-arg>singleton< T ></template-arg></specialization><inherit access="public">true_</inherit></struct-specialization>
|
||||
</class>
|
||||
|
||||
|
||||
|
||||
@@ -888,7 +877,10 @@
|
||||
<namespace name="unit_test">
|
||||
<namespace name="data">
|
||||
<namespace name="monomorphic">
|
||||
<class name="zip"><template>
|
||||
<struct-specialization name="is_dataset"><template>
|
||||
<template-type-parameter name="DS1"/>
|
||||
<template-type-parameter name="DS2"/>
|
||||
</template><specialization><template-arg>zip< DS1</template-arg><template-arg>DS2 ></template-arg></specialization><inherit access="public">true_</inherit></struct-specialization><class name="zip"><template>
|
||||
<template-type-parameter name="DS1"/>
|
||||
<template-type-parameter name="DS2"/>
|
||||
</template><purpose>Zip datasets. </purpose><struct name="iterator"><inherit access="public">boost::unit_test::data::monomorphic::dataset< T >::iterator</inherit><typedef name="ref_type"><type><classname>monomorphic::traits</classname>< T >::ref_type</type></typedef>
|
||||
@@ -904,10 +896,7 @@
|
||||
</method-group>
|
||||
<constructor><parameter name="ds1"><paramtype>DS1 &&</paramtype></parameter><parameter name="ds2"><paramtype>DS2 &&</paramtype></parameter><parameter name="size"><paramtype><classname>data::size_t</classname></paramtype></parameter></constructor>
|
||||
<constructor><parameter name="j"><paramtype><classname>zip</classname> &&</paramtype></parameter></constructor>
|
||||
</class><struct-specialization name="is_dataset"><template>
|
||||
<template-type-parameter name="DS1"/>
|
||||
<template-type-parameter name="DS2"/>
|
||||
</template><specialization><template-arg>zip< DS1</template-arg><template-arg>DS2 ></template-arg></specialization><inherit access="public">true_</inherit></struct-specialization><namespace name="result_of">
|
||||
</class><namespace name="result_of">
|
||||
<struct name="zip"><template>
|
||||
<template-type-parameter name="DS1Gen"/>
|
||||
<template-type-parameter name="DS2Gen"/>
|
||||
@@ -1153,7 +1142,7 @@
|
||||
<para>user's config for Boost.Test debugging support </para><para>This file is intended to be edited by end user to specify varios macros, which configure debugger interface Alterntively you can set these parameters in your own sources/makefiles </para></header>
|
||||
<header name="boost/test/execution_monitor.hpp">
|
||||
<para>Defines public interface of the Execution Monitor and related classes. </para><namespace name="boost">
|
||||
<class name="execution_exception"><purpose>This class is used to report any kind of an failure during execution of a monitored function inside of <classname alt="boost::execution_monitor">execution_monitor</classname>. </purpose><description><para>The instance of this class is thrown out of execution_monitor::execute invocation when failure is detected. Regardless of a kind of failure occured the instance will provide a uniform way to catch and report it.</para><para>One important design rationale for this class is that we should be ready to work after fatal memory corruptions or out of memory conditions. To facilitate this class never allocates any memory and assumes that strings it refers to are either some constants or live in a some kind of persistent (preallocated) memory. </para></description><struct name="location"><purpose>Simple model for the location of failure in a source code. </purpose><data-member name="m_file_name"><type>const_string</type><purpose>File name. </purpose></data-member>
|
||||
<class name="execution_aborted"><purpose>This is a trivial default constructible class. Use it to report graceful abortion of a monitored function execution. </purpose></class><class name="execution_exception"><purpose>This class is used to report any kind of an failure during execution of a monitored function inside of <classname alt="boost::execution_monitor">execution_monitor</classname>. </purpose><description><para>The instance of this class is thrown out of execution_monitor::execute invocation when failure is detected. Regardless of a kind of failure occured the instance will provide a uniform way to catch and report it.</para><para>One important design rationale for this class is that we should be ready to work after fatal memory corruptions or out of memory conditions. To facilitate this class never allocates any memory and assumes that strings it refers to are either some constants or live in a some kind of persistent (preallocated) memory. </para></description><struct name="location"><purpose>Simple model for the location of failure in a source code. </purpose><data-member name="m_file_name"><type>const_string</type><purpose>File name. </purpose></data-member>
|
||||
<data-member name="m_line_num"><type>size_t</type><purpose>Line number. </purpose></data-member>
|
||||
<data-member name="m_function"><type>const_string</type><purpose>Function name. </purpose></data-member>
|
||||
<method-group name="public member functions">
|
||||
@@ -1196,7 +1185,7 @@ em.register_exception_translator<MyException>( myExceptTr );
|
||||
<method-group name="private member functions">
|
||||
<method name="catch_signals"><type>int</type><parameter name="F"><paramtype>boost::function< int()> const &</paramtype></parameter></method>
|
||||
</method-group>
|
||||
</class><class name="execution_aborted"><purpose>This is a trivial default constructible class. Use it to report graceful abortion of a monitored function execution. </purpose></class><class name="system_error"><data-member name="p_errno"><type>unit_test::readonly_property< long ></type></data-member>
|
||||
</class><class name="system_error"><data-member name="p_errno"><type>unit_test::readonly_property< long ></type></data-member>
|
||||
<data-member name="p_failed_exp"><type>unit_test::readonly_property< char const * ></type></data-member>
|
||||
<method-group name="public member functions">
|
||||
</method-group>
|
||||
@@ -1221,10 +1210,10 @@ em.register_exception_translator<MyException>( myExceptTr );
|
||||
</struct><struct name="internal_error"><inherit access="public">runtime_error</inherit><purpose>This exception type is used to report internal Boost.Test framework errors. </purpose><method-group name="public member functions">
|
||||
</method-group>
|
||||
<constructor><parameter name="m"><paramtype>const_string</paramtype></parameter></constructor>
|
||||
</struct><struct name="setup_error"><inherit access="public">runtime_error</inherit><purpose>This exception type is used to report test module setup errors. </purpose><method-group name="public member functions">
|
||||
</struct><struct name="nothing_to_test"/><struct name="setup_error"><inherit access="public">runtime_error</inherit><purpose>This exception type is used to report test module setup errors. </purpose><method-group name="public member functions">
|
||||
</method-group>
|
||||
<constructor><parameter name="m"><paramtype>const_string</paramtype></parameter></constructor>
|
||||
</struct><struct name="test_being_aborted"/><struct name="nothing_to_test"/><namespace name="impl">
|
||||
</struct><struct name="test_being_aborted"/><namespace name="impl">
|
||||
<function name="apply_filters"><type>void</type><parameter name=""><paramtype>test_unit_id</paramtype></parameter></function>
|
||||
</namespace>
|
||||
<function name="init"><type>void</type><parameter name="init_func"><paramtype>init_unit_test_func</paramtype><description><para>test module initialization routine </para></description></parameter><parameter name="argc"><paramtype>int</paramtype><description><para>command line arguments collection </para></description></parameter><parameter name="argv"><paramtype>char *</paramtype><description><para>command line arguments collection </para></description></parameter><purpose>This funcion performs initialization of the framework monostate. </purpose><description><para>It needs to be called every time before the test is started.
|
||||
@@ -1486,7 +1475,11 @@ em.register_exception_translator<MyException>( myExceptTr );
|
||||
<header name="boost/test/results_collector.hpp">
|
||||
<para>defines testing result collector components </para><para>Defines class results_collector_t that is responsible for gathering test results and class test_results for presenting this information to end-user </para><namespace name="boost">
|
||||
<namespace name="unit_test">
|
||||
<class name="test_results"><purpose>Collection of attributes constituting test unit results. </purpose><description><para>This class is a collection of attributes describing testing results. The atributes presented as public properties on an instance of the class. In addition summary conclusion methods are presented to generate simple answer to pass/fail question </para></description><data-member name="p_assertions_passed"><type>counter_prop</type></data-member>
|
||||
<class name="results_collector_t"><inherit access="public">test_observer</inherit><inherit access="public">singleton< results_collector_t ></inherit><purpose>This class implements test observer interface to collect the result of test unit execution. </purpose><method-group name="public member functions">
|
||||
<method name="results" cv="const"><type><classname>test_results</classname> const &</type><parameter name="tu_id"><paramtype>test_unit_id</paramtype><description><para>id of a test unit </para></description></parameter><purpose>Results access per test unit. </purpose><description><para>
|
||||
</para></description></method>
|
||||
</method-group>
|
||||
</class><class name="test_results"><purpose>Collection of attributes constituting test unit results. </purpose><description><para>This class is a collection of attributes describing testing results. The atributes presented as public properties on an instance of the class. In addition summary conclusion methods are presented to generate simple answer to pass/fail question </para></description><data-member name="p_assertions_passed"><type>counter_prop</type></data-member>
|
||||
<data-member name="p_assertions_failed"><type>counter_prop</type></data-member>
|
||||
<data-member name="p_warnings_failed"><type>counter_prop</type></data-member>
|
||||
<data-member name="p_expected_failures"><type>counter_prop</type></data-member>
|
||||
@@ -1504,10 +1497,6 @@ em.register_exception_translator<MyException>( myExceptTr );
|
||||
<method name="clear"><type>void</type></method>
|
||||
</method-group>
|
||||
<constructor/>
|
||||
</class><class name="results_collector_t"><inherit access="public">test_observer</inherit><inherit access="public">singleton< results_collector_t ></inherit><purpose>This class implements test observer interface to collect the result of test unit execution. </purpose><method-group name="public member functions">
|
||||
<method name="results" cv="const"><type><classname>test_results</classname> const &</type><parameter name="tu_id"><paramtype>test_unit_id</paramtype><description><para>id of a test unit </para></description></parameter><purpose>Results access per test unit. </purpose><description><para>
|
||||
</para></description></method>
|
||||
</method-group>
|
||||
</class>
|
||||
|
||||
|
||||
@@ -1581,10 +1570,8 @@ em.register_exception_translator<MyException>( myExceptTr );
|
||||
<header name="boost/test/tree/test_unit.hpp">
|
||||
<namespace name="boost">
|
||||
<namespace name="unit_test">
|
||||
<class name="test_unit"><enum name="@0"><enumvalue name="type"><default>= TUT_ANY</default></enumvalue></enum>
|
||||
<typedef name="id_list"><type>std::list< test_unit_id ></type></typedef>
|
||||
<typedef name="fixture_list"><type>std::list< test_unit_fixture_ptr ></type></typedef>
|
||||
<typedef name="decorator_base"><type>decorator::for_test_unit_ptr</type></typedef>
|
||||
<class name="master_test_suite_t"><inherit access="public">boost::unit_test::test_suite</inherit><data-member name="argc"><type>int</type></data-member>
|
||||
<data-member name="argv"><type>char **</type></data-member>
|
||||
<data-member name="p_type"><type>readonly_property< test_unit_type ></type></data-member>
|
||||
<data-member name="p_type_name"><type>readonly_property< const_string ></type></data-member>
|
||||
<data-member name="p_file_name"><type>readonly_property< const_string ></type></data-member>
|
||||
@@ -1600,6 +1587,11 @@ em.register_exception_translator<MyException>( myExceptTr );
|
||||
<data-member name="p_decorators"><type>readwrite_property< decorator_base ></type></data-member>
|
||||
<data-member name="p_fixtures"><type>readwrite_property< fixture_list ></type></data-member>
|
||||
<method-group name="public member functions">
|
||||
<method name="add"><type>void</type><parameter name="tu"><paramtype><classname>test_unit</classname> *</paramtype></parameter><parameter name="expected_failures"><paramtype>counter_t</paramtype><default>0</default></parameter><parameter name="timeout"><paramtype>unsigned</paramtype><default>0</default></parameter><purpose>Adds a test unit to a test suite, with possibility to specify the timeout and the expected failures. </purpose></method>
|
||||
<method name="add"><type>void</type><parameter name="gen"><paramtype><classname>test_unit_generator</classname> const &</paramtype></parameter><parameter name="timeout"><paramtype>unsigned</paramtype><default>0</default></parameter></method>
|
||||
<method name="remove"><type>void</type><parameter name="id"><paramtype>test_unit_id</paramtype></parameter><purpose>Removes a test from the test suite. </purpose></method>
|
||||
<method name="get" cv="const"><type>test_unit_id</type><parameter name="tu_name"><paramtype>const_string</paramtype></parameter></method>
|
||||
<method name="size" cv="const"><type>std::size_t</type></method>
|
||||
<method name="depends_on"><type>void</type><parameter name="tu"><paramtype><classname>test_unit</classname> *</paramtype></parameter></method>
|
||||
<method name="check_dependencies" cv="const"><type>bool</type></method>
|
||||
<method name="add_label"><type>void</type><parameter name="l"><paramtype>const_string</paramtype></parameter></method>
|
||||
@@ -1609,17 +1601,12 @@ em.register_exception_translator<MyException>( myExceptTr );
|
||||
<method name="BOOST_READONLY_PROPERTY"><type>typedef</type><parameter name=""><paramtype>test_unit_id</paramtype></parameter><parameter name=""><paramtype>(<classname>test_suite</classname>)</paramtype></parameter></method>
|
||||
<method name="BOOST_READONLY_PROPERTY"><type>typedef</type><parameter name=""><paramtype>id_list</paramtype></parameter><parameter name=""><paramtype>(<classname>test_unit</classname>)</paramtype></parameter></method>
|
||||
</method-group>
|
||||
<method-group name="protected member functions">
|
||||
</method-group>
|
||||
<destructor/>
|
||||
<constructor><parameter name="tu_name"><paramtype>const_string</paramtype></parameter><parameter name="tc_file"><paramtype>const_string</paramtype></parameter><parameter name="tc_line"><paramtype>std::size_t</paramtype></parameter><parameter name="t"><paramtype>test_unit_type</paramtype></parameter></constructor>
|
||||
<constructor specifiers="explicit"><parameter name="module_name"><paramtype>const_string</paramtype></parameter></constructor>
|
||||
</class><class name="test_unit_generator"><method-group name="public member functions">
|
||||
<method name="next" cv="const = 0" specifiers="virtual"><type><classname>test_unit</classname> *</type></method>
|
||||
</method-group>
|
||||
<method-group name="protected member functions">
|
||||
</method-group>
|
||||
<destructor/>
|
||||
<constructor/>
|
||||
<enum name="@2"><enumvalue name="type"><default>= TUT_SUITE</default></enumvalue></enum>
|
||||
<enum name="@0"><enumvalue name="type"><default>= TUT_ANY</default></enumvalue></enum>
|
||||
<typedef name="id_list"><type>std::list< test_unit_id ></type></typedef>
|
||||
<typedef name="fixture_list"><type>std::list< test_unit_fixture_ptr ></type></typedef>
|
||||
<typedef name="decorator_base"><type>decorator::for_test_unit_ptr</type></typedef>
|
||||
</class><class name="test_case"><inherit access="public">boost::unit_test::test_unit</inherit><enum name="@1"><enumvalue name="type"><default>= TUT_CASE</default></enumvalue></enum>
|
||||
<enum name="@0"><enumvalue name="type"><default>= TUT_ANY</default></enumvalue></enum>
|
||||
<typedef name="id_list"><type>std::list< test_unit_id ></type></typedef>
|
||||
@@ -1695,8 +1682,10 @@ em.register_exception_translator<MyException>( myExceptTr );
|
||||
<data-member name="p_enabled" specifiers="mutable"><type>readwrite_property< bool ></type></data-member>
|
||||
<data-member name="p_decorators"><type>readwrite_property< decorator_base ></type></data-member>
|
||||
<data-member name="p_fixtures"><type>readwrite_property< fixture_list ></type></data-member>
|
||||
</class><class name="master_test_suite_t"><inherit access="public">boost::unit_test::test_suite</inherit><data-member name="argc"><type>int</type></data-member>
|
||||
<data-member name="argv"><type>char **</type></data-member>
|
||||
</class><class name="test_unit"><enum name="@0"><enumvalue name="type"><default>= TUT_ANY</default></enumvalue></enum>
|
||||
<typedef name="id_list"><type>std::list< test_unit_id ></type></typedef>
|
||||
<typedef name="fixture_list"><type>std::list< test_unit_fixture_ptr ></type></typedef>
|
||||
<typedef name="decorator_base"><type>decorator::for_test_unit_ptr</type></typedef>
|
||||
<data-member name="p_type"><type>readonly_property< test_unit_type ></type></data-member>
|
||||
<data-member name="p_type_name"><type>readonly_property< const_string ></type></data-member>
|
||||
<data-member name="p_file_name"><type>readonly_property< const_string ></type></data-member>
|
||||
@@ -1712,11 +1701,6 @@ em.register_exception_translator<MyException>( myExceptTr );
|
||||
<data-member name="p_decorators"><type>readwrite_property< decorator_base ></type></data-member>
|
||||
<data-member name="p_fixtures"><type>readwrite_property< fixture_list ></type></data-member>
|
||||
<method-group name="public member functions">
|
||||
<method name="add"><type>void</type><parameter name="tu"><paramtype><classname>test_unit</classname> *</paramtype></parameter><parameter name="expected_failures"><paramtype>counter_t</paramtype><default>0</default></parameter><parameter name="timeout"><paramtype>unsigned</paramtype><default>0</default></parameter><purpose>Adds a test unit to a test suite, with possibility to specify the timeout and the expected failures. </purpose></method>
|
||||
<method name="add"><type>void</type><parameter name="gen"><paramtype><classname>test_unit_generator</classname> const &</paramtype></parameter><parameter name="timeout"><paramtype>unsigned</paramtype><default>0</default></parameter></method>
|
||||
<method name="remove"><type>void</type><parameter name="id"><paramtype>test_unit_id</paramtype></parameter><purpose>Removes a test from the test suite. </purpose></method>
|
||||
<method name="get" cv="const"><type>test_unit_id</type><parameter name="tu_name"><paramtype>const_string</paramtype></parameter></method>
|
||||
<method name="size" cv="const"><type>std::size_t</type></method>
|
||||
<method name="depends_on"><type>void</type><parameter name="tu"><paramtype><classname>test_unit</classname> *</paramtype></parameter></method>
|
||||
<method name="check_dependencies" cv="const"><type>bool</type></method>
|
||||
<method name="add_label"><type>void</type><parameter name="l"><paramtype>const_string</paramtype></parameter></method>
|
||||
@@ -1726,12 +1710,17 @@ em.register_exception_translator<MyException>( myExceptTr );
|
||||
<method name="BOOST_READONLY_PROPERTY"><type>typedef</type><parameter name=""><paramtype>test_unit_id</paramtype></parameter><parameter name=""><paramtype>(<classname>test_suite</classname>)</paramtype></parameter></method>
|
||||
<method name="BOOST_READONLY_PROPERTY"><type>typedef</type><parameter name=""><paramtype>id_list</paramtype></parameter><parameter name=""><paramtype>(<classname>test_unit</classname>)</paramtype></parameter></method>
|
||||
</method-group>
|
||||
<constructor/>
|
||||
<enum name="@2"><enumvalue name="type"><default>= TUT_SUITE</default></enumvalue></enum>
|
||||
<enum name="@0"><enumvalue name="type"><default>= TUT_ANY</default></enumvalue></enum>
|
||||
<typedef name="id_list"><type>std::list< test_unit_id ></type></typedef>
|
||||
<typedef name="fixture_list"><type>std::list< test_unit_fixture_ptr ></type></typedef>
|
||||
<typedef name="decorator_base"><type>decorator::for_test_unit_ptr</type></typedef>
|
||||
<method-group name="protected member functions">
|
||||
</method-group>
|
||||
<destructor/>
|
||||
<constructor><parameter name="tu_name"><paramtype>const_string</paramtype></parameter><parameter name="tc_file"><paramtype>const_string</paramtype></parameter><parameter name="tc_line"><paramtype>std::size_t</paramtype></parameter><parameter name="t"><paramtype>test_unit_type</paramtype></parameter></constructor>
|
||||
<constructor specifiers="explicit"><parameter name="module_name"><paramtype>const_string</paramtype></parameter></constructor>
|
||||
</class><class name="test_unit_generator"><method-group name="public member functions">
|
||||
<method name="next" cv="const = 0" specifiers="virtual"><type><classname>test_unit</classname> *</type></method>
|
||||
</method-group>
|
||||
<method-group name="protected member functions">
|
||||
</method-group>
|
||||
<destructor/>
|
||||
</class>
|
||||
<function name="make_test_case"><type><classname>test_case</classname> *</type><parameter name="test_func"><paramtype>boost::function< void()> const &</paramtype></parameter><parameter name="tc_name"><paramtype>const_string</paramtype></parameter><parameter name="tc_file"><paramtype>const_string</paramtype></parameter><parameter name="tc_line"><paramtype>std::size_t</paramtype></parameter></function>
|
||||
<function name="make_test_case"><type><classname>test_case</classname> *</type><template>
|
||||
@@ -1760,19 +1749,19 @@ em.register_exception_translator<MyException>( myExceptTr );
|
||||
<header name="boost/test/unit_test_log_formatter.hpp">
|
||||
<para>Defines unit test log formatter interface. </para><para>You can define a class with implements this interface and use an instance of it as a Unit Test Framework log formatter </para><namespace name="boost">
|
||||
<namespace name="unit_test">
|
||||
<struct name="log_entry_data"><purpose>Collection of log entry attributes. </purpose><data-member name="m_file_name"><type>std::string</type><purpose>log entry file name </purpose></data-member>
|
||||
<struct name="log_checkpoint_data"><purpose>Collection of log checkpoint attributes. </purpose><data-member name="m_file_name"><type>const_string</type><purpose>log checkpoint file name </purpose></data-member>
|
||||
<data-member name="m_line_num"><type>std::size_t</type><purpose>log checkpoint file name </purpose></data-member>
|
||||
<data-member name="m_message"><type>std::string</type><purpose>log checkpoint message </purpose></data-member>
|
||||
<method-group name="public member functions">
|
||||
<method name="clear"><type>void</type></method>
|
||||
</method-group>
|
||||
</struct><struct name="log_entry_data"><purpose>Collection of log entry attributes. </purpose><data-member name="m_file_name"><type>std::string</type><purpose>log entry file name </purpose></data-member>
|
||||
<data-member name="m_line_num"><type>std::size_t</type><purpose>log entry line number </purpose></data-member>
|
||||
<data-member name="m_level"><type>log_level</type><purpose>log entry level </purpose></data-member>
|
||||
<method-group name="public member functions">
|
||||
<method name="clear"><type>void</type></method>
|
||||
</method-group>
|
||||
<constructor/>
|
||||
</struct><struct name="log_checkpoint_data"><purpose>Collection of log checkpoint attributes. </purpose><data-member name="m_file_name"><type>const_string</type><purpose>log checkpoint file name </purpose></data-member>
|
||||
<data-member name="m_line_num"><type>std::size_t</type><purpose>log checkpoint file name </purpose></data-member>
|
||||
<data-member name="m_message"><type>std::string</type><purpose>log checkpoint message </purpose></data-member>
|
||||
<method-group name="public member functions">
|
||||
<method name="clear"><type>void</type></method>
|
||||
</method-group>
|
||||
</struct><class name="unit_test_log_formatter"><purpose>Abstract Unit Test Framework log formatter interface. </purpose><description><para>During the test module execution Unit Test Framework can report messages about success or failure of assertions, which test suites are being run and more (specifically which messages are reported depends on log level threashold selected by the user). All these messages constitute Unit Test Framework log. There are many ways (formats) to present these messages to the user. Boost.Test comes with two formats: "Compiler-like log format" and "XML based log format". Former is intended for human consumption and later is intended for processing by automated regression test systems. If you want to produce some other format you need to implement class with specific interface and use method unit_test_log_t::set_formatter during a test module initialization to set an active formatter. The class <classname alt="boost::unit_test::unit_test_log_formatter">unit_test_log_formatter</classname> defines this interface.</para><para>This interface requires you to format all possible messages being produced in the log. These includes error messages about failed assertions, messages about caught exceptions and information messages about test units being started/ended. All the methods in this interface takes a reference to standard stream as a first argument. This is where final messages needs to be directed to. Also you are givn all the informaion necessary to produce a message. </para></description><enum name="log_entry_types"><enumvalue name="BOOST_UTL_ET_INFO"><purpose>Information message from the framework. </purpose></enumvalue><enumvalue name="BOOST_UTL_ET_MESSAGE"><purpose>Information message from the user. </purpose></enumvalue><enumvalue name="BOOST_UTL_ET_WARNING"><purpose>Warning (non error) condition notification message. </purpose></enumvalue><enumvalue name="BOOST_UTL_ET_ERROR"><purpose>Non fatal error notification message. </purpose></enumvalue><enumvalue name="BOOST_UTL_ET_FATAL_ERROR"><purpose>Fatal error notification message. </purpose></enumvalue><purpose>Types of log entries (messages written into a log) </purpose></enum>
|
||||
<method-group name="public member functions">
|
||||
<method name="log_start" cv="= 0" specifiers="virtual"><type>void</type><parameter name="os"><paramtype>std::ostream &</paramtype><description><para>output stream to write a messages to </para></description></parameter><parameter name="test_cases_amount"><paramtype>counter_t</paramtype><description><para>total test case amount to be run </para></description></parameter><purpose>Invoked at the begining of test module execution. </purpose><description><para>
|
||||
@@ -1829,4 +1818,4 @@ em.register_exception_translator<MyException>( myExceptTr );
|
||||
</namespace>
|
||||
</namespace>
|
||||
</header>
|
||||
</library-reference>
|
||||
</library-reference>
|
||||
|
||||
@@ -22,14 +22,10 @@ of these variants are provided.
|
||||
[/ ######################################################## ]
|
||||
[include module_initialization.qbk]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[/ ######################################################## ]
|
||||
[section:usage_variants Linking with the __UTF__]
|
||||
|
||||
The __UTF__ presents you with 4 different variants:
|
||||
The __UTF__ supports four different usage variants:
|
||||
|
||||
# The static library variant
|
||||
# The dynamic library variant
|
||||
@@ -55,13 +51,8 @@ like the floating point comparison or the logged expectations testing, are defin
|
||||
|
||||
[endsect] [/section:usage_variants]
|
||||
|
||||
|
||||
|
||||
|
||||
[/ ######################################################## ]
|
||||
[/ reference of the macros]
|
||||
[include link_reference.qbk]
|
||||
|
||||
|
||||
|
||||
[endsect] [/section:users_guide]
|
||||
|
||||
@@ -1,164 +0,0 @@
|
||||
[#ref_execution_monitor][section:execution_monitor The Execution Monitor]
|
||||
|
||||
Sometimes we need to call a function and make sure that no user or system originated exceptions are being thrown
|
||||
by it. Uniform exception reporting is also may be convenient. That's the purpose of the Boost.Test's
|
||||
['Execution Monitor].
|
||||
|
||||
The Execution Monitor is a lower-level component of the Boost Test Library. It is the base for implementing all
|
||||
other Boost.Test components, but also can be used standalone to get controlled execution of error-prone functions
|
||||
with a uniform error notification. The Execution Monitor calls a user-supplied function in a controlled
|
||||
environment, relieving users from messy error detection.
|
||||
|
||||
The Execution Monitor usage is demonstrated in the example [@../../../example/exec_mon_example.cpp =exec_mon_example.cpp=]. Additional examples are
|
||||
in [link boost_test.components.section_pem Program Execution Monitor] or __UTF__.
|
||||
|
||||
[heading Design Rationale]
|
||||
The Execution Monitor design assumes that it can be used when no (or almost no) memory available. Also the
|
||||
Execution Monitor is intended to be portable to as many platforms as possible.
|
||||
|
||||
[section Compilation variants and procedures]
|
||||
|
||||
[heading Implementation]
|
||||
|
||||
The Execution Monitor is implemented in two modules: one header file and one source file.
|
||||
|
||||
* [headerref boost/test/execution_monitor.hpp]: defines abstract execution monitor
|
||||
interfaces and implements execution exception.
|
||||
* `boost/test/impl/execution_monitor.ipp`: provides the Execution Monitor implementation for all supported configurations,
|
||||
including Microsoft structured exception based, UNIX signals.
|
||||
|
||||
You may use this component in both debug and release modes, but in release mode the Execution Monitor won't
|
||||
catch Microsoft C runtime debug events.
|
||||
|
||||
|
||||
[heading Standalone library compilation]
|
||||
|
||||
To compile the Execution Monitor as standalone library compose it using only
|
||||
`execution_monitor.cpp` as a source file. Alternatively you can add this file directly to the
|
||||
list of source files for your project. Boost Test Library's components include this file as a part of their
|
||||
compilation procedure.
|
||||
|
||||
[heading Direct include]
|
||||
|
||||
In some cases you may want to include the source file along with header file into your sources. But be aware that
|
||||
to be able to catch all kinds of standard exceptions and to implement signal handling logic this file will bring
|
||||
a lot of dependencies.
|
||||
[endsect] [/compilation variants and procedures]
|
||||
|
||||
[/ ###########################################]
|
||||
[section:section_em_users_guide The Execution Monitor user's guide]
|
||||
|
||||
The Execution Monitor is designed to solve the problem of executing potentially dangerous function that may result
|
||||
in any number of error conditions, in monitored environment that should prevent any undesirable exceptions to
|
||||
propagate out of function call and produce consistent result report for all
|
||||
[link boost_test.components.execution_monitor.section_em_users_guide.section_em_monitored_functions outcomes]. The Execution Monitor is able to
|
||||
produce informative report for all standard C++ exceptions and intrinsic types. All other exceptions are reported as
|
||||
unknown. If you prefer different message for your exception class or need to perform any action, the Execution
|
||||
Monitor supports [link boost_test.components.execution_monitor.section_em_users_guide.section_em_error_reporting custom exception translators].
|
||||
There are several other [link boost_test.components.execution_monitor.section_em_users_guide.section_em_parameters parameters] of the
|
||||
monitored environment can be configured by setting appropriate properties of the Execution Monitor.
|
||||
|
||||
All symbols in the Execution Monitor implementation are located in the namespace boost. To use the Execution
|
||||
Monitor you need to:
|
||||
|
||||
* `#include <boost/test/execution_monitor.hpp>`
|
||||
* Make an instance of [classref boost::execution_monitor execution_monitor]
|
||||
* Optionally register custom exception translators for exception classes which require special processing.
|
||||
|
||||
[section:section_em_monitored_functions Monitored function execution]
|
||||
|
||||
To start the monitored function, invoke the method [memberref boost::execution_monitor::execute] and pass
|
||||
the monitored function as an argument. If the call succeeds, the method returns the result code produced by the
|
||||
monitored function. If any of the following conditions occur:
|
||||
|
||||
* Uncaught C++ exception
|
||||
* Hardware or software signal, trap, or other exception
|
||||
* Timeout reached
|
||||
* Debug assert event occurred (under Microsoft Visual C++ or compatible compiler)
|
||||
|
||||
then the method throws the [classref boost::execution_exception execution_exception]. The exception contains unique
|
||||
[enumref boost::execution_exception::error_code error_code] value identifying the error condition and the detailed message that can be used to report
|
||||
the error.
|
||||
|
||||
[endsect]
|
||||
|
||||
[/ ###########################################]
|
||||
[section:section_em_parameters The execution monitor parameters]
|
||||
|
||||
All parameters are implemented as public read-write properties of class [classref boost::execution_monitor].
|
||||
|
||||
The `p_catch_system_errors` property is a boolean flag (default value is true) specifying whether
|
||||
or not `execution_monitor` should trap system level exceptions (second category in above list).
|
||||
Set this property to false, for example, if you wish to force coredump file creation. The Unit Test Framework
|
||||
provides a runtime parameter `--catch_system_errors=yes` to alter the behavior in monitored test cases.
|
||||
|
||||
|
||||
The `p_auto_start_dbg` property is a boolean flag (default value is false) specifying whether or
|
||||
not `execution_monitor` should try to attach debugger in case system error is caught.
|
||||
|
||||
The `p_timeout` property is an integer timeout (in seconds) for monitored function execution. Use
|
||||
this parameter to monitor code with possible deadlocks or indefinite loops. This feature is only available for some
|
||||
operating systems (not yet Microsoft Windows).
|
||||
|
||||
The `p_use_alt_stack` property is a boolean flag (default value is false) specifying whether or
|
||||
not `execution_monitor` should use an alternative stack for the
|
||||
`sigaction` based signal catching. When enabled the signals are delivered to the
|
||||
`execution_monitor` on a stack different from current execution stack, which is safer in case
|
||||
if it is corrupted by monitored function. For more details on alternative stack handling see appropriate
|
||||
[@http://www.opengroup.org/onlinepubs/000095399/functions/sigaltstack.html manuals].
|
||||
|
||||
The `p_detect_fp_exceptions` property is a boolean flag (default value is false) specifying
|
||||
whether or not `execution_monitor` should install hardware traps for the floating point
|
||||
exception on platforms where it's supported.
|
||||
|
||||
[endsect]
|
||||
|
||||
[/ ###########################################]
|
||||
[section:section_em_error_reporting Errors reporting and translation]
|
||||
If you need to report an error inside monitored function execution you have to throw an exception. Do not use the
|
||||
[classref boost::execution_exception] - it's not intended to be used for this purpose. The simplest choice is
|
||||
to use one of the following C++ types as an exception:
|
||||
|
||||
* C string
|
||||
* `std:string`
|
||||
* any exception class in std::exception hierarchy
|
||||
|
||||
In case if you prefer to use your own exception classes or can't govern what exceptions are generated by monitored
|
||||
function and would like to see proper error message in a report, the Execution Monitor allows you to register the
|
||||
translator for any exception class. You can register as many independent translators as you like. See
|
||||
`execution_monitor` specification for requirements on translator function. Also see below
|
||||
for usage example.
|
||||
|
||||
Finally, if you need to abort the monitored function execution without reporting any errors, you can throw an
|
||||
exception [classref boost::execution_aborted execution_aborted]. As a result the execution is aborted and zero result code
|
||||
is produced by the method [memberref boost::execution_monitor::execute `execution_monitor::execute`].
|
||||
|
||||
[endsect]
|
||||
|
||||
|
||||
[/ ###########################################]
|
||||
[section Memory leaks detection]
|
||||
|
||||
The Execution Monitor provides a limited ability to detect memory leaks during program execution, and to
|
||||
break program execution on specific memory allocation order-number (1 - first allocation of memory in program, 2 -
|
||||
second and so on). Unfortunately this feature is, at the moment, implemented only for the Microsoft family of
|
||||
compilers (and Intel, if it employs Microsoft C Runtime Library). Also it can not be tuned per instance of the
|
||||
monitor and is only triggered globally and reported after the whole program execution is done. In a future this
|
||||
ought to be improved. An interface is composed from two free functions residing in namespace boost::debug:
|
||||
|
||||
``
|
||||
void detect_memory_leaks( bool on_off );
|
||||
void break_memory_alloc( long mem_alloc_order_num );
|
||||
``
|
||||
|
||||
Use function detect_memory_leaks to switch memory leaks detection on/off. Use break_memory_alloc to break a
|
||||
program execution at allocation specified by mem_alloc_order_num argument. The Unit Test Framework
|
||||
provides a runtime parameter (`--detect_memory_leaks=0` or `1` or `N>1`, where N is memory allocation number)
|
||||
allowing you to manage this feature during monitored unit tests.
|
||||
|
||||
[endsect]
|
||||
|
||||
[endsect] [/ user guide]
|
||||
|
||||
|
||||
[endsect]
|
||||
@@ -1,75 +0,0 @@
|
||||
[section:bt_minimal_testing Minimal testing facility]
|
||||
|
||||
['Boost.Test minimal testing facility] provides the functionality previously implemented by the
|
||||
original version of Boost.Test. As the name suggest, it provides only minimal basic facilities for test creation. It
|
||||
have no configuration parameters (either command line arguments or environment variables) and it supplies
|
||||
a limited set of [link ref_mtf_testing_tool testing tools] which behaves similarly to ones defined amount
|
||||
the [*Unit Test Framework Testing tools]. The __MTF__ supplies its own function
|
||||
`main()` (so can not be used for multi unit testing) and will execute the test program in a monitored environment.
|
||||
|
||||
|
||||
As it follows from the name this component provides only minimal set of the testing capabilities and as a general
|
||||
rule the Unit Test Framework should be preferred. In a majority of the cases it provides you with much wider set of
|
||||
testing tools (and other goods), while still being as easy to set up.
|
||||
|
||||
[warning The use of the Minial Testing Facility is deprecated. The documentation is left for reference
|
||||
and backward compatibility]
|
||||
|
||||
[section:bt_minimal_usage Usage]
|
||||
The __MTF__ is implemented inline in one header: ``#include <boost/test/minimal.hpp>``
|
||||
There are no special compilation instructions for this component.
|
||||
|
||||
The second and last change you need to make to integrate your test module with __MTF__ is
|
||||
the signature of your function `main()`. It should look like this:
|
||||
|
||||
``
|
||||
int test_main( int argc, char* argv[] )
|
||||
{
|
||||
//...
|
||||
}
|
||||
``
|
||||
|
||||
Once you apply the changes, the test automatically starts running in monitored environment. Also you can start using
|
||||
[link ref_mtf_testing_tool testing tools] provided by the __MTF__ and get uniform errors reporting.
|
||||
|
||||
|
||||
|
||||
[endsect] [/usage]
|
||||
|
||||
|
||||
[#ref_mtf_testing_tool][section:bt_minimal Testing tools]
|
||||
|
||||
The __MTF__ supplies following four assertions:
|
||||
|
||||
__BOOST_CHECK__(predicate)
|
||||
__BOOST_REQUIRE__(predicate)
|
||||
__BOOST_ERROR__(message)
|
||||
__BOOST_FAIL__(message)
|
||||
|
||||
Their behaviour is modelled after the similarly named tools supplied by the __UTF__.
|
||||
|
||||
There is a single unit test program that validates __MTF__ functionality: minimal_test <!-- TO FIX: link to test -->
|
||||
[warning what is this sentence for?]
|
||||
[endsect] [/ tools]
|
||||
|
||||
|
||||
[section Example]
|
||||
The following example illustrates different approaches you can employ to detect and report errors using different
|
||||
testing tools
|
||||
|
||||
[import examples/example27.cpp]
|
||||
[import examples/example27.output]
|
||||
[table:id_example27 Minimal testing facility application
|
||||
[
|
||||
[Code]
|
||||
[Output]
|
||||
]
|
||||
[
|
||||
[[example27]]
|
||||
[[example27o]]
|
||||
]
|
||||
]
|
||||
|
||||
[endsect] [/ Example]
|
||||
|
||||
[endsect]
|
||||
@@ -1,306 +0,0 @@
|
||||
[section:section_pem Program Execution Monitor]
|
||||
|
||||
The components of a C++ program may report user-detected errors in several ways, such as via a return value or
|
||||
throwing an exception. System-detected errors such as dereferencing an invalid pointer are reported in other ways,
|
||||
totally operating system and compiler dependent.
|
||||
|
||||
Yet many C++ programs, both production and test, must run in an environment where uniform reporting of errors is
|
||||
necessary. For example, converting otherwise uncaught exceptions to non-zero program return codes allows many
|
||||
command line, script, or batch environments to continue processing in a controlled manner. Even some
|
||||
['GUI] environments benefit from the unification of errors into program return codes.
|
||||
|
||||
|
||||
The Boost.Test Library's [*Program Execution Monitor] (__PEM__ for short) relieves users from messy error
|
||||
detection and reporting duties by providing a replacement function `main()` which calls a user-supplied `cpp_main()`
|
||||
function within a monitored environment. The supplied `main()` then uniformly detects and reports the occurrence of
|
||||
several types of errors, reducing them to a uniform return code which is returned to the host environment.
|
||||
|
||||
Uniform error reporting is particularly useful for programs running unattended under control of scripts or batch
|
||||
files. Some operating systems pop up message boxes if an uncaught exception occurs, and this requires manual
|
||||
intervention. By converting such exceptions into non-zero program return codes, the library makes the program a
|
||||
better citizen. More uniform reporting of errors isn't a benefit to some programs, particularly programs always
|
||||
run by hand of a knowledgeable person. So the __PEM__ wouldn't be worth using in that environment.
|
||||
|
||||
Uniform error reporting can be also useful in test environments such as the Boost regression tests. Be aware though
|
||||
in such case it might be preferable to use the __UTF__, because it allows one
|
||||
to use the __testing_tools__ and generate more detailed error information.
|
||||
|
||||
[section Usage]
|
||||
|
||||
|
||||
To facilitate uniform error reporting the __PEM__ supplies function `main()` as part if it's implementation. To use the
|
||||
__PEM__ instead of regular function `main` your program is required to supply a function `cpp_main()` with same signature.
|
||||
|
||||
Here is the traditional ['Hello World] program implemented using the __PEM__:
|
||||
|
||||
[import examples/example24.cpp]
|
||||
[import examples/example24.output]
|
||||
[table:id_example24 Hello World with the Program Execution Monitor
|
||||
[
|
||||
[Code]
|
||||
[Output]
|
||||
]
|
||||
[
|
||||
[[example24]]
|
||||
[[example24o]]
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
|
||||
It really is that simple - just change the name of your initial function from `main()` to `cpp_main()`. Do make sure
|
||||
the `argc` and `argv` parameters are specified (although you don't have to name them if you don't use them).
|
||||
|
||||
The __PEM__ treats as errors:
|
||||
|
||||
* Exceptions thrown from `cpp_main()`
|
||||
* Non-zero return from `cpp_main()`
|
||||
|
||||
So what if some function had thrown a `std::runtime_error` with the message "big trouble" and it is not trapped by any
|
||||
catch clause? Like in a following example:
|
||||
|
||||
|
||||
[import examples/example25.cpp]
|
||||
[import examples/example25.output]
|
||||
[table:id_example25 Standard exception detection within the Program Execution Monitor
|
||||
[
|
||||
[Code]
|
||||
[Output]
|
||||
]
|
||||
[
|
||||
[[example25]]
|
||||
[[example25o]]
|
||||
]
|
||||
]
|
||||
|
||||
[note Note that in both examples above we used [link boost_test.components.section_pem.section_pem_compilation.section_pem_full_include single-header variant]
|
||||
of the __PEM__. Alternatively the binaries may be built and linked with
|
||||
a [link boost_test.components.section_pem.section_pem_compilation.section_pem_standalone standalone library] (in case of static library we are not required to include any __PEM__ related headers).
|
||||
]
|
||||
|
||||
Let's consider an example where function `cpp_main()` had bubbled up a return code of 5:
|
||||
|
||||
[import examples/example26.cpp]
|
||||
[import examples/example26.output]
|
||||
[table:id_example26 Error return code detection of the __PEM__
|
||||
[
|
||||
[Code]
|
||||
[Output]
|
||||
]
|
||||
[
|
||||
[[example26]]
|
||||
[[example26o]]
|
||||
]
|
||||
]
|
||||
|
||||
The __PEM__ reports errors to both `std::cout` (details) and `std::cerr` (summary). Primary detailed error
|
||||
messages appear on standard output stream so that it is properly interlaced with other output, thus aiding error
|
||||
analysis. While the final error notification message appears on standard error stream. This increases the
|
||||
visibility of error notification if standard output and error streams are directed to different devices or files.
|
||||
|
||||
The __PEM__'s supplied `main()` will return following result codes:
|
||||
|
||||
* `boost::exit_success` - no errors
|
||||
* `boost::exit_failure` - non-zero and `non-boost::exit_success` return code from `cpp_main()`
|
||||
* `boost::exit_exception_failure` - `cpp_main()` throw an exception
|
||||
|
||||
[endsect] [/ Usage]
|
||||
|
||||
|
||||
|
||||
[/ #################################################################################### configuration]
|
||||
[section Runtime configuration]
|
||||
|
||||
There are two aspects of the __PEM__ behavior that you can customize at runtime. Customization is performed using
|
||||
environment variables.
|
||||
|
||||
[table:id_pem_env The __PEM__ configuration environment variables
|
||||
[
|
||||
[Flag]
|
||||
[Usage]
|
||||
]
|
||||
[
|
||||
[`BOOST_TEST_CATCH_SYSTEM_ERRORS`]
|
||||
[allows customizing behavior of the __PEM__ in regards of catching system errors. For more details about the
|
||||
meaning of this option see the [classref boost::execution_monitor execution_monitor] class. If you
|
||||
want to prevent the __PEM__ from catching system exception, set the value of this
|
||||
variable to "no". The default value is "yes".]
|
||||
]
|
||||
[
|
||||
[`BOOST_PRG_MON_CONFIRM`]
|
||||
[allows avoiding success confirmation message. Some users prefer to see a confirmation message in case if program
|
||||
successfully executed. While others don't like the clutter or any output is prohibited by organization standards.
|
||||
To avoid the message set the value of this variable to "no". The default value is "yes".]
|
||||
]
|
||||
|
||||
]
|
||||
|
||||
[note `BOOST_TEST_CATCH_SYSTEM_ERRORS` is similar to the __UTF__'s __param_catch_system__ command line parameter.]
|
||||
|
||||
[endsect] [/ configuration]
|
||||
|
||||
[/ #################################################################################### implementation]
|
||||
[#ref_pem_implementation][section Implementation]
|
||||
|
||||
To monitor execution of user supplied function `cpp_main()` the __PEM__ relies on the Boost.Test's
|
||||
[link boost_test.components.execution_monitor Execution Monitor]. Also the __PEM__ supplies the function `main()` to facilitate
|
||||
uniform error reporting. Following files constitute the __PEM__ implementation:
|
||||
|
||||
|
||||
[table:pem_implementation_file __PEM__ implementation files
|
||||
|
||||
[
|
||||
[File name]
|
||||
[Content]
|
||||
]
|
||||
[
|
||||
[`boost/test/impl/execution_monitor.ipp`]
|
||||
[provides __EM__ implementation for all supported configurations]
|
||||
]
|
||||
[
|
||||
[`boost/test/impl/cpp_main.ipp`]
|
||||
[supplies function `main()` for static library build]
|
||||
]
|
||||
[
|
||||
[`boost/test/included/prg_exec_monitor.hpp`]
|
||||
[combines all implementation files into single header to be use as inlined version of component]
|
||||
]
|
||||
[
|
||||
[`boost/test/prg_exec_monitor.hpp`]
|
||||
[contains definitions for `main()` function for dynamic library build and pragmas for auto-linking feature support]
|
||||
]
|
||||
]
|
||||
|
||||
The __PEM__ implementation wraps several system headers and is intended to be used as standalone library. While there
|
||||
exist an alternative variant to [link ref_pem_direct_include include the whole implementation
|
||||
directly] into your program, for the long term usage the preferable solution is to
|
||||
[link ref_pem_stanlone build library once] and reuse it.
|
||||
|
||||
|
||||
[endsect] [/implementation]
|
||||
|
||||
[section:section_pem_compilation Compilation]
|
||||
|
||||
In comparison with many other boost libraries, which are completely implemented in header files, compilation and
|
||||
linking with the __PEM__ may require additional steps. The __PEM__ presents you with options to either
|
||||
|
||||
# built and link with a [link ref_pem_stanlone standalone library] or
|
||||
# include the implementation [link ref_pem_direct_include directly] into your program.
|
||||
|
||||
If you opt to use the library the __PEM__ header implements the
|
||||
[*auto-linking support] and following flags can be used to configure
|
||||
compilation of the __PEM__ library and your program:
|
||||
|
||||
[table
|
||||
[
|
||||
[Variable]
|
||||
[Usage]
|
||||
]
|
||||
[
|
||||
[__BOOST_TEST_DYN_LINK__]
|
||||
[Define this flag to build/use dynamic library]
|
||||
]
|
||||
[
|
||||
[__BOOST_TEST_NO_LIB__]
|
||||
[Define this flag to prevent auto-linking]
|
||||
]
|
||||
]
|
||||
|
||||
[#ref_pem_stanlone][section:section_pem_standalone Standalone library compilation]
|
||||
|
||||
If you opted to link your program with the standalone library, you need to build it first. To build a standalone
|
||||
library all C++ files (.cpp), that constitute __PEM__ [link ref_pem_implementation implementation] need to be
|
||||
listed as source files in your makefile [footnote There are varieties of make systems that can be used. To name
|
||||
a few: ['GNU] make (and other make clones) and build systems integrated into ['IDE]s
|
||||
(for example ['Microsoft Visual Studio]). The Boost preferred solution is Boost.Build system that is based on top of
|
||||
`bjam` tool. Make systems require some kind of configuration file that lists all files that constitute the library
|
||||
and all build options. For example the makefile that is used by make, or the Microsoft Visual Studio project file,
|
||||
Jamfile is used by Boost.Build. For the sake of simplicity let's call this file the makefile.].
|
||||
|
||||
|
||||
The makefile for use with Boost.Build system is supplied in
|
||||
|
||||
``
|
||||
libs/test/build
|
||||
``
|
||||
|
||||
directory. The __PEM__ can be built as either [link ref_pem_static static] or [link ref_pem_dynamic dynamic] library.
|
||||
|
||||
|
||||
|
||||
[#ref_pem_static][section:section_pem_compilation_static Static library compilation]
|
||||
|
||||
There are no additional build defines or options required to build static library. Using Boost.Build system you
|
||||
can build the static library with a following command from `libs/test/build` directory:
|
||||
|
||||
``
|
||||
bjam -sTOOLS=<your-tool-name> -sBUILD=boost_prg_exec_monitor
|
||||
``
|
||||
|
||||
Also on Windows you can use the Microsoft Visual Studio .NET project file provided.
|
||||
|
||||
[endsect] [/ static compilation]
|
||||
|
||||
[#ref_pem_dynamic][section:section_pem_compilation_dynamic Dynamic library compilation]
|
||||
|
||||
To build the dynamic library [footnote What is meant by the term dynamic library is a ['dynamically
|
||||
loaded library], alternatively called a ['shared library].] you
|
||||
need to add __BOOST_TEST_DYN_LINK__ to the list of macro definitions in the
|
||||
``libs/test/build`` directory:
|
||||
|
||||
``
|
||||
bjam -sTOOLS=<your-tool-name> -sBUILD=boost_prg_exec_monitor
|
||||
``
|
||||
|
||||
Also on Windows you can use the Microsoft Visual Studio .NET project file provided.
|
||||
|
||||
[caution
|
||||
For your program to successfully link with the dynamic library the flag
|
||||
__BOOST_TEST_DYN_LINK__ needs to be defined both during dynamic library
|
||||
build and during your program compilation.
|
||||
]
|
||||
|
||||
|
||||
[endsect] [/ dynamic compilation]
|
||||
[endsect] [/ standalone lib compilation]
|
||||
|
||||
[#ref_pem_auto_link][section Support of the auto-linking feature]
|
||||
|
||||
|
||||
For the Microsoft family of compilers the __PEM__ provides an ability to automatically select proper library name
|
||||
and add it to the list of objects to be linked with. To employ this feature you required to include either header
|
||||
|
||||
``
|
||||
#include <boost/test/prg_exec_monitor.hpp>
|
||||
``
|
||||
or header
|
||||
|
||||
``
|
||||
#include <boost/test/included/prg_exec_monitor.hpp>
|
||||
``
|
||||
|
||||
By default the feature is enabled. To disable it you have to define the flag __BOOST_TEST_NO_LIB__.
|
||||
|
||||
|
||||
[endsect] [/ autolink]
|
||||
|
||||
[#ref_pem_direct_include][section:section_pem_full_include Including the __PEM__ directly into your program]
|
||||
|
||||
If you prefer to avoid the standalone library compilation you have two alternative usage variants: you can either
|
||||
include all files that constitute the static library in your program's makefile or include them as a part of
|
||||
your program's source file. To facilitate the later variant the __PEM__ implementation presents the header
|
||||
``
|
||||
#include <boost/test/included/prg_exec_monitor.hpp>
|
||||
``
|
||||
|
||||
In both variants neither __BOOST_TEST_DYN_LINK__ nor __BOOST_TEST_NO_LIB__ are applicable. This solution may not be the best choice
|
||||
in a long run, since it requires the __PEM__ sources recompilation for every program you use it with.
|
||||
|
||||
[endsect] [/ direct include]
|
||||
|
||||
|
||||
[endsect] [/compilation]
|
||||
|
||||
|
||||
|
||||
[endsect] [/program execution monitor]
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example01
|
||||
//[example_code
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
using namespace boost::unit_test;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example01o
|
||||
//[example_output
|
||||
> example
|
||||
Running 1 test case...
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example02
|
||||
//[example_code
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
#include <boost/bind.hpp>
|
||||
using namespace boost::unit_test;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example02o
|
||||
//[example_output
|
||||
> example
|
||||
Running 1 test case...
|
||||
test.cpp(11): error in "boost::bind( &test_class::test_method, &tester )": check false failed
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example03
|
||||
//[example_code
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
#include <boost/bind.hpp>
|
||||
using namespace boost::unit_test;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example03o
|
||||
//[example_output
|
||||
> example
|
||||
Running 2 test cases...
|
||||
test.cpp(15): error in "boost::bind( &test_class::test_method2, tester )": check false failed
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example04
|
||||
//[example_code
|
||||
#include<boost/test/included/unit_test.hpp>
|
||||
|
||||
using namespace boost::unit_test;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example04o
|
||||
//[example_output
|
||||
> example
|
||||
Running 1 test case...
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example05
|
||||
//[example_code
|
||||
#define BOOST_TEST_DYN_LINK
|
||||
#include <boost/test/unit_test.hpp>
|
||||
#include <boost/bind.hpp>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example05o
|
||||
//[example_output
|
||||
> example
|
||||
Running 3 test cases...
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example06
|
||||
//[example_code
|
||||
#define BOOST_TEST_MODULE example
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example06o
|
||||
//[example_output
|
||||
> example --log_level=test_suite
|
||||
Running 1 test case...
|
||||
Entering test suite "example"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example07
|
||||
//[example_code
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
#include <boost/test/parameterized_test.hpp>
|
||||
using namespace boost::unit_test;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example07o
|
||||
//[example_output
|
||||
> example
|
||||
Running 5 test cases...
|
||||
test.cpp(9): error in "free_test_function": check i < 4 failed
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example08
|
||||
//[example_code
|
||||
#define BOOST_TEST_ALTERNATIVE_INIT_API
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
#include <boost/test/floating_point_comparison.hpp>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example08o
|
||||
//[example_output
|
||||
> example
|
||||
Running 5 test cases...
|
||||
test.cpp(14): error in "tm": difference between d * 100{100.1} and (double)(int)(d*100){100} exceeds 0.01%
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example09
|
||||
//[example_code
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
#include <boost/mpl/list.hpp>
|
||||
using namespace boost::unit_test;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example09o
|
||||
//[example_output
|
||||
> example
|
||||
Running 3 test cases...
|
||||
test.cpp(10): error in "my_test<unsigned char>": check sizeof(T) == 4 failed [1 != 4]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example10
|
||||
//[example_code
|
||||
#define BOOST_TEST_MODULE example
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
#include <boost/mpl/list.hpp>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example10o
|
||||
//[example_output
|
||||
> example
|
||||
Running 3 test cases...
|
||||
test.cpp(12): error in "my_test<unsigned char>": check sizeof(T) == 4 failed [1 != 4]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example11
|
||||
//[example_code
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
using namespace boost::unit_test;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example11o
|
||||
//[example_output
|
||||
> example --log_level=test_suite
|
||||
Running 4 test cases...
|
||||
Entering test suite "Master Test Suite"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example12
|
||||
//[example_code
|
||||
#define BOOST_TEST_MODULE example
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example12o
|
||||
//[example_output
|
||||
> example
|
||||
Running 4 test cases...
|
||||
test.cpp(12): fatal error in "test_case2": critical check 1 == 2 failed [1 != 2]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example13
|
||||
//[example_code
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
using namespace boost::unit_test;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example13o
|
||||
//[example_output
|
||||
> example 1
|
||||
Test setup error: test tree is empty
|
||||
//]
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example14
|
||||
//[example_code
|
||||
#define BOOST_TEST_DYN_LINK
|
||||
#define BOOST_TEST_MODULE my master test suite name
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example14o
|
||||
//[example_output
|
||||
> example --log_level=test_suite
|
||||
Running 1 test case...
|
||||
Entering test suite "my master test suite name"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example15
|
||||
//[example_code
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
using namespace boost::unit_test;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example15o
|
||||
//[example_output
|
||||
> example --log_level=test_suite
|
||||
Running 1 test case...
|
||||
Entering test suite "my master test suite name"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example16
|
||||
//[example_code
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
using namespace boost::unit_test;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example16o
|
||||
//[example_output
|
||||
> example --log_level=message
|
||||
Running 1 test case...
|
||||
test.cpp(8): error in "free_test_function": check 2 == 1 failed
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example17
|
||||
//[example_code
|
||||
#define BOOST_TEST_MODULE example
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example17o
|
||||
//[example_output
|
||||
> example --report_level=short
|
||||
Running 2 test cases...
|
||||
test.cpp(10): error in "my_test1": check 2 == 1 failed
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example18
|
||||
//[example_code
|
||||
#define BOOST_TEST_MODULE example
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example18o
|
||||
//[example_output
|
||||
> example --log_level=message
|
||||
Running 3 test cases...
|
||||
setup fixture
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example19
|
||||
//[example_code
|
||||
#define BOOST_TEST_MODULE example
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example19o
|
||||
//[example_output
|
||||
> example
|
||||
Running 2 test cases...
|
||||
test.cpp(17): error in "test_case1": check i == 1 failed
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example20
|
||||
//[example_code
|
||||
#define BOOST_TEST_MODULE example
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
#include <iostream>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example20o
|
||||
//[example_output
|
||||
> example
|
||||
global setup
|
||||
Running 1 test case...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example21
|
||||
//[example_code
|
||||
#define BOOST_TEST_MODULE example
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example21o
|
||||
//[example_output
|
||||
> example --log_level=message
|
||||
Running 2 test cases...
|
||||
Testing initialization :
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example22
|
||||
//[example_code
|
||||
#define BOOST_TEST_MODULE example
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example22o
|
||||
//[example_output
|
||||
> example
|
||||
Running 1 test case...
|
||||
unknown location(0): fatal error in "test_external_interface": signal: integer divide by zero; address of failing instruction: 0x00048090
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example23
|
||||
//[example_code
|
||||
#define BOOST_TEST_MODULE example
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example23o
|
||||
//[example_output
|
||||
> example
|
||||
Running 1 test case...
|
||||
unknown location(0): fatal error in "test_case": memory access violation at address: 0x00000008: no mapping at fault address
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example24
|
||||
//[example_code
|
||||
#include <iostream>
|
||||
#include <boost/test/included/prg_exec_monitor.hpp>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example24o
|
||||
//[example_output
|
||||
Hello, world
|
||||
|
||||
no errors detected
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example25
|
||||
//[example_code
|
||||
#include <stdexcept>
|
||||
#include <boost/test/included/prg_exec_monitor.hpp>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example25o
|
||||
//[example_output
|
||||
**** exception(205): std::runtime_error: big trouble
|
||||
******** errors detected; see standard output for details ********
|
||||
//]
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example26
|
||||
//[example_code
|
||||
#include <boost/test/prg_exec_monitor.hpp> // this header is optional
|
||||
|
||||
int cpp_main( int, char* [] ) // note the name
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example26o
|
||||
//[example_output
|
||||
**** error return code: 5
|
||||
******** errors detected; see standard output for details ********
|
||||
//]
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example27
|
||||
//[example_code
|
||||
#include <boost/test/minimal.hpp>
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
//[example27o
|
||||
//[example_output
|
||||
**** no errors detected
|
||||
//]
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example28
|
||||
//[example_code
|
||||
#define BOOST_TEST_MODULE example
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
#include <boost/test/output_test_stream.hpp>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example28o
|
||||
//[example_output
|
||||
> example
|
||||
Running 1 test case...
|
||||
test.cpp(15): error in "test": check output.is_equal( "i=3" ) failed. Output content: "i=2"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example29
|
||||
//[example_code
|
||||
#define BOOST_TEST_MODULE example
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
#include <boost/test/output_test_stream.hpp>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example29o
|
||||
//[example_output
|
||||
> example
|
||||
Running 1 test case...
|
||||
test.cpp(16): error in "test": check output.match_pattern() failed. Mismatch at position 23
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example30
|
||||
//[example_code
|
||||
#define BOOST_TEST_MODULE example
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example30o
|
||||
//[example_output
|
||||
> example
|
||||
Running 1 test case...
|
||||
test.cpp(13): error in "test_is_even": check is_even( i ) failed for ( 17 )
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example31
|
||||
//[example_code
|
||||
#define BOOST_TEST_MODULE example
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example31o
|
||||
//[example_output
|
||||
Running 1 test case...
|
||||
test.cpp(28): error in "test_list_comparizon": check compare_lists( l1, l2 ) failed. Different sizes [2!=0]
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example32
|
||||
//[example_code
|
||||
#define BOOST_TEST_MODULE example
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
#include <utility>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example32o
|
||||
//[example_output
|
||||
Running 1 test case...
|
||||
test.cpp(16): error in "test_list": check p1 == p2 failed [ != ]
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example33
|
||||
//[example_code
|
||||
#define BOOST_TEST_MODULE example
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example33o
|
||||
//[example_output
|
||||
> example
|
||||
Running 1 test case...
|
||||
test.cpp(8): error in "test": check (char)0x26 =.= 0x04 failed.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example34
|
||||
//[example_code
|
||||
#define BOOST_TEST_MODULE example
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example34o
|
||||
//[example_output
|
||||
> example --log_level=warning
|
||||
Running 1 test case...
|
||||
test.cpp(9): warning in "test": condition sizeof(int) == sizeof(short) is not satisfied
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example35
|
||||
//[example_code
|
||||
#define BOOST_TEST_MODULE example
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example35o
|
||||
//[example_output
|
||||
> example
|
||||
Running 1 test case...
|
||||
test.cpp(10): fatal error in "test": critical check i == j failed [2 != 1]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example36
|
||||
//[example_code
|
||||
#define BOOST_TEST_MODULE example
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example36o
|
||||
//[example_output
|
||||
> example
|
||||
Running 1 test case...
|
||||
test.cpp(11): error in "test": check { col1, col1+7 } == { col2, col2+7 } failed.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example37
|
||||
//[example_code
|
||||
#define BOOST_TEST_MODULE example
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example37o
|
||||
//[example_output
|
||||
> example
|
||||
Running 1 test case...
|
||||
test.cpp(16): error in "test": incorrect exception my_exception is caught
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example38
|
||||
//[example_code
|
||||
#define BOOST_TEST_MODULE example
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example38o
|
||||
//[example_output
|
||||
> example --log_level=warning
|
||||
Running 1 test case...
|
||||
test.cpp(12): warning in "test": sin(45){0.850904} is > 0.71. Arg is not in radian?
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example39
|
||||
//[example_code
|
||||
#define BOOST_TEST_MODULE example
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example39o
|
||||
//[example_output
|
||||
> example
|
||||
Running 1 test case...
|
||||
test.cpp(10): error in "test": exception thrown by throw my_exception()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example40
|
||||
//[example_code
|
||||
#define BOOST_TEST_MODULE example
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
using namespace boost::unit_test;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example40o
|
||||
//[example_output
|
||||
> example
|
||||
Running 1 test case...
|
||||
test.cpp(14): warning in "test": condition moo( 12,i,j ) is not satisfied
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example41
|
||||
//[example_code
|
||||
#define BOOST_TEST_MODULE example
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
#include <boost/test/floating_point_comparison.hpp>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example41o
|
||||
//[example_output
|
||||
> example
|
||||
Running 1 test case...
|
||||
test.cpp(11): error in "test": absolute value of v{-0.00123456} exceeds 1e-006
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example42
|
||||
//[example_code
|
||||
#define BOOST_TEST_MODULE example
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
#include <boost/test/floating_point_comparison.hpp>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example42o
|
||||
//[example_output
|
||||
> example
|
||||
Running 1 test case...
|
||||
test.cpp(12): error in "test": difference between v1{1.23456e-010} and v2{1.23457e-010} exceeds 0.0001%
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example43
|
||||
//[example_code
|
||||
#define BOOST_TEST_MODULE example
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
#include <boost/test/floating_point_comparison.hpp>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example43o
|
||||
//[example_output
|
||||
> example
|
||||
Running 1 test case...
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example44
|
||||
//[example_code
|
||||
#define BOOST_TEST_MODULE example
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
#include <boost/test/floating_point_comparison.hpp>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example44o
|
||||
//[example_output
|
||||
> example
|
||||
Running 1 test case...
|
||||
test.cpp(12): error in "test": difference between v1{1.111e-010} and v2{1.112e-010} exceeds 0.0008999
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example45
|
||||
//[example_code
|
||||
#define BOOST_TEST_MODULE example
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example45o
|
||||
//[example_output
|
||||
> example
|
||||
Running 1 test case...
|
||||
test.cpp(11): error in "test": exception my_exception is expected
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example46
|
||||
//[example_code
|
||||
#define BOOST_TEST_MODULE example
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example46o
|
||||
//[example_output
|
||||
> example
|
||||
Running 1 test case...
|
||||
test.cpp(8): error in "test": Nothing to test
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example47
|
||||
//[example_code
|
||||
#define BOOST_TEST_MODULE example
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//[example47o
|
||||
//[example_output
|
||||
> example
|
||||
Running 1 test case...
|
||||
test.cpp(8): fatal error in "test": Test is not ready yet
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user