Boost logo

Boost-Commit :

From: gennadiy.rozental_at_[hidden]
Date: 2008-07-28 00:03:22


Author: rogeeff
Date: 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
New Revision: 47848
URL: http://svn.boost.org/trac/boost/changeset/47848

Log:
missing files
Added:
   trunk/libs/test/doc/src/
   trunk/libs/test/doc/src/examples/
   trunk/libs/test/doc/src/examples/example.sln (contents, props changed)
   trunk/libs/test/doc/src/examples/example.vcproj (contents, props changed)
   trunk/libs/test/doc/src/examples/example01.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example01.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example02.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example02.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example03.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example03.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example04.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example04.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example05.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example05.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example06.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example06.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example07.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example07.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example08.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example08.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example09.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example09.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example10.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example10.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example11.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example11.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example12.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example12.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example13.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example13.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example14.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example14.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example15.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example15.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example16.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example16.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example17.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example17.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example18.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example18.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example19.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example19.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example20.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example20.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example21.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example21.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example22.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example22.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example23.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example23.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example24.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example24.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example25.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example25.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example26.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example26.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example27.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example27.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example28.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example28.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example29.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example29.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example30.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example30.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example31.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example31.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example32.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example32.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example33.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example33.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example34.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example34.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example35.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example35.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example36.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example36.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example37.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example37.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example38.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example38.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example39.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example39.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example40.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example40.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example41.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example41.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example42.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example42.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example43.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example43.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example44.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example44.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example45.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example45.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example46.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example46.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example47.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example47.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example48.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example48.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example49.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example49.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example50.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example50.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example51.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example51.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example52.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example52.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example53.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example53.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example54.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example54.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example55.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example55.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example56.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example56.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example57.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example57.output (contents, props changed)
   trunk/libs/test/doc/src/examples/example58.cpp (contents, props changed)
   trunk/libs/test/doc/src/examples/example58.output (contents, props changed)

Added: trunk/libs/test/doc/src/examples/example.sln
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example.sln 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example", "example.vcproj", "{9C8197C8-60ED-4D4F-9FFE-F3DFC4C57AE5}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {9C8197C8-60ED-4D4F-9FFE-F3DFC4C57AE5}.Debug|Win32.ActiveCfg = Debug|Win32
+ {9C8197C8-60ED-4D4F-9FFE-F3DFC4C57AE5}.Debug|Win32.Build.0 = Debug|Win32
+ {9C8197C8-60ED-4D4F-9FFE-F3DFC4C57AE5}.Release|Win32.ActiveCfg = Release|Win32
+ {9C8197C8-60ED-4D4F-9FFE-F3DFC4C57AE5}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal

Added: trunk/libs/test/doc/src/examples/example.vcproj
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example.vcproj 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,196 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="example"
+ ProjectGUID="{9C8197C8-60ED-4D4F-9FFE-F3DFC4C57AE5}"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="&quot;$(TargetDir)\$(TargetName).exe&quot; --result_code=no"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath="..\snippet\snippet18.cpp"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: trunk/libs/test/doc/src/examples/example01.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example01.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,22 @@
+#include <boost/test/included/unit_test.hpp>
+using namespace boost::unit_test;
+
+//____________________________________________________________________________//
+
+void free_test_function()
+{
+ BOOST_CHECK( true /* test assertion */ );
+}
+
+//____________________________________________________________________________//
+
+test_suite*
+init_unit_test_suite( int argc, char* argv[] )
+{
+ framework::master_test_suite().
+ add( BOOST_TEST_CASE( &free_test_function ) );
+
+ return 0;
+}
+
+//____________________________________________________________________________//

Added: trunk/libs/test/doc/src/examples/example01.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example01.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,4 @@
+> example
+Running 1 test case...
+
+*** No errors detected
\ No newline at end of file

Added: trunk/libs/test/doc/src/examples/example02.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example02.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,26 @@
+#include <boost/test/included/unit_test.hpp>
+#include <boost/bind.hpp>
+using namespace boost::unit_test;
+
+//____________________________________________________________________________//
+
+class test_class {
+public:
+ void test_method()
+ {
+ BOOST_CHECK( true /* test assertion */ );
+ }
+} tester;
+
+//____________________________________________________________________________//
+
+test_suite*
+init_unit_test_suite( int argc, char* argv[] )
+{
+ framework::master_test_suite().
+ add( BOOST_TEST_CASE( boost::bind( &test_class::test_method, &tester )));
+
+ return 0;
+}
+
+//____________________________________________________________________________//

Added: trunk/libs/test/doc/src/examples/example02.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example02.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,5 @@
+> example
+Running 1 test case...
+test.cpp(11): error in "boost::bind( &test_class::test_method, &tester )": check false failed
+
+*** 1 failure detected in test suite "Master Test Suite"

Added: trunk/libs/test/doc/src/examples/example03.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example03.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,33 @@
+#include <boost/test/included/unit_test.hpp>
+#include <boost/bind.hpp>
+using namespace boost::unit_test;
+
+//____________________________________________________________________________//
+
+class test_class {
+public:
+ void test_method1()
+ {
+ BOOST_CHECK( true /* test assertion */ );
+ }
+ void test_method2()
+ {
+ BOOST_CHECK( false /* test assertion */ );
+ }
+};
+
+//____________________________________________________________________________//
+
+test_suite*
+init_unit_test_suite( int argc, char* argv[] )
+{
+ boost::shared_ptr<test_class> tester( new test_class );
+
+ framework::master_test_suite().
+ add( BOOST_TEST_CASE( boost::bind( &test_class::test_method1, tester )));
+ framework::master_test_suite().
+ add( BOOST_TEST_CASE( boost::bind( &test_class::test_method2, tester )));
+ return 0;
+}
+
+//____________________________________________________________________________//

Added: trunk/libs/test/doc/src/examples/example03.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example03.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,5 @@
+> example
+Running 2 test cases...
+test.cpp(15): error in "boost::bind( &test_class::test_method2, tester )": check false failed
+
+*** 1 failure detected in test suite "Master Test Suite"

Added: trunk/libs/test/doc/src/examples/example04.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example04.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,32 @@
+#include<boost/test/included/unit_test.hpp>
+
+using namespace boost::unit_test;
+
+class test_class {
+public:
+ void test_method()
+ {
+ BOOST_CHECK( true /* test assertion */ );
+ }
+};
+
+//____________________________________________________________________________//
+
+void free_test_function()
+{
+ test_class inst;
+
+ inst.test_method();
+}
+
+//____________________________________________________________________________//
+
+test_suite*
+init_unit_test_suite( int argc, char* argv[] )
+{
+ framework::master_test_suite().add( BOOST_TEST_CASE( &free_test_function ) );
+
+ return 0;
+}
+
+//____________________________________________________________________________//

Added: trunk/libs/test/doc/src/examples/example04.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example04.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,4 @@
+> example
+Running 1 test case...
+
+*** No errors detected

Added: trunk/libs/test/doc/src/examples/example05.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example05.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,36 @@
+#define BOOST_TEST_DYN_LINK
+#include <boost/test/included/unit_test.hpp>
+#include <boost/bind.hpp>
+using namespace boost::unit_test;
+
+//____________________________________________________________________________//
+
+void free_test_function( int i, int j )
+{
+ BOOST_CHECK( true /* test assertion */ );
+}
+
+//____________________________________________________________________________//
+
+bool
+init_function()
+{
+ framework::master_test_suite().
+ add( BOOST_TEST_CASE( boost::bind( &free_test_function, 1, 1 ) ) );
+ framework::master_test_suite().
+ add( BOOST_TEST_CASE( boost::bind( &free_test_function, 1, 2 ) ) );
+ framework::master_test_suite().
+ add( BOOST_TEST_CASE( boost::bind( &free_test_function, 2, 1 ) ) );
+
+ return true;
+}
+
+//____________________________________________________________________________//
+
+int
+main( int argc, char* argv[] )
+{
+ return ::boost::unit_test::unit_test_main( &init_function, argc, argv );
+}
+
+//____________________________________________________________________________//

Added: trunk/libs/test/doc/src/examples/example05.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example05.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,4 @@
+> example
+Running 3 test cases...
+
+*** No errors detected

Added: trunk/libs/test/doc/src/examples/example06.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example06.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,12 @@
+#define BOOST_TEST_MODULE example
+#include <boost/test/included/unit_test.hpp>
+
+//____________________________________________________________________________//
+
+BOOST_AUTO_TEST_CASE( free_test_function )
+{
+ BOOST_CHECK( true /* test assertion */ );
+}
+
+//____________________________________________________________________________//
+

Added: trunk/libs/test/doc/src/examples/example06.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example06.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,8 @@
+> example --log_level=test_suite
+Running 1 test case...
+Entering test suite "example"
+Entering test case "free_test_function"
+Leaving test case "free_test_function"; testing time: 16ms
+Leaving test suite "example"
+
+*** No errors detected

Added: trunk/libs/test/doc/src/examples/example07.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example07.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,25 @@
+#include <boost/test/included/unit_test.hpp>
+#include <boost/test/parameterized_test.hpp>
+using namespace boost::unit_test;
+
+//____________________________________________________________________________//
+
+void free_test_function( int i )
+{
+ BOOST_CHECK( i < 4 /* test assertion */ );
+}
+
+//____________________________________________________________________________//
+
+test_suite*
+init_unit_test_suite( int argc, char* argv[] )
+{
+ int params[] = { 1, 2, 3, 4, 5 };
+
+ framework::master_test_suite().
+ add( BOOST_PARAM_TEST_CASE( &free_test_function, params, params+5 ) );
+
+ return 0;
+}
+
+//____________________________________________________________________________//

Added: trunk/libs/test/doc/src/examples/example07.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example07.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,6 @@
+> example
+Running 5 test cases...
+test.cpp(9): error in "free_test_function": check i < 4 failed
+test.cpp(9): error in "free_test_function": check i < 4 failed
+
+*** 2 failures detected in test suite "Master Test Suite"

Added: trunk/libs/test/doc/src/examples/example08.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example08.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,34 @@
+#define BOOST_TEST_ALTERNATIVE_INIT_API
+#include <boost/test/included/unit_test.hpp>
+#include <boost/test/floating_point_comparison.hpp>
+#include <boost/test/parameterized_test.hpp>
+#include <boost/bind.hpp>
+using namespace boost::unit_test;
+using namespace boost;
+
+//____________________________________________________________________________//
+
+class test_class {
+public:
+ void test_method( double const& d )
+ {
+ BOOST_CHECK_CLOSE( d * 100, (double)(int)(d*100), 0.01 );
+ }
+} tester;
+
+//____________________________________________________________________________//
+
+bool init_unit_test()
+{
+ double params[] = { 1., 1.1, 1.01, 1.001, 1.0001 };
+
+ callback1<double> tm = bind( &test_class::test_method, &tester, _1);
+
+ framework::master_test_suite().
+ add( BOOST_PARAM_TEST_CASE( tm, params, params+5 ) );
+
+ return true;
+}
+
+//____________________________________________________________________________//
+

Added: trunk/libs/test/doc/src/examples/example08.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example08.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,6 @@
+> 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%
+test.cpp(14): error in "tm": difference between d * 100{100.01} and (double)(int)(d*100){100} exceeds 0.01%
+
+*** 2 failures detected in test suite "Master Test Suite"

Added: trunk/libs/test/doc/src/examples/example09.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example09.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,25 @@
+#include <boost/test/included/unit_test.hpp>
+#include <boost/mpl/list.hpp>
+using namespace boost::unit_test;
+
+//____________________________________________________________________________//
+
+BOOST_TEST_CASE_TEMPLATE_FUNCTION( my_test, T )
+{
+ BOOST_CHECK_EQUAL( sizeof(T), 4 );
+}
+
+//____________________________________________________________________________//
+
+test_suite*
+init_unit_test_suite( int argc, char* argv[] )
+{
+ typedef boost::mpl::list<int,long,unsigned char> test_types;
+
+ framework::master_test_suite().
+ add( BOOST_TEST_CASE_TEMPLATE( my_test, test_types ) );
+
+ return 0;
+}
+
+//____________________________________________________________________________//

Added: trunk/libs/test/doc/src/examples/example09.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example09.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,5 @@
+> example
+Running 3 test cases...
+test.cpp(10): error in "my_test<unsigned char>": check sizeof(T) == 4 failed [1 != 4]
+
+*** 1 failure detected in test suite "Master Test Suite"

Added: trunk/libs/test/doc/src/examples/example10.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example10.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,14 @@
+#define BOOST_TEST_MODULE example
+#include <boost/test/included/unit_test.hpp>
+#include <boost/mpl/list.hpp>
+
+//____________________________________________________________________________//
+
+typedef boost::mpl::list<int,long,unsigned char> test_types;
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( my_test, T, test_types )
+{
+ BOOST_CHECK_EQUAL( sizeof(T), (unsigned)4 )
+}
+
+//____________________________________________________________________________//

Added: trunk/libs/test/doc/src/examples/example10.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example10.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,5 @@
+> example
+Running 3 test cases...
+test.cpp(12): error in "my_test<unsigned char>": check sizeof(T) == 4 failed [1 != 4]
+
+*** 1 failure detected in test suite "example"

Added: trunk/libs/test/doc/src/examples/example11.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example11.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,30 @@
+#include <boost/test/included/unit_test.hpp>
+using namespace boost::unit_test;
+
+//____________________________________________________________________________//
+
+void test_case1() { /* : */ }
+void test_case2() { /* : */ }
+void test_case3() { /* : */ }
+void test_case4() { /* : */ }
+
+//____________________________________________________________________________//
+
+test_suite*
+init_unit_test_suite( int argc, char* argv[] )
+{
+ test_suite* ts1 = BOOST_TEST_SUITE( "test_suite1" );
+ ts1->add( BOOST_TEST_CASE( &test_case1 ) );
+ ts1->add( BOOST_TEST_CASE( &test_case2 ) );
+
+ test_suite* ts2 = BOOST_TEST_SUITE( "test_suite2" );
+ ts2->add( BOOST_TEST_CASE( &test_case3 ) );
+ ts2->add( BOOST_TEST_CASE( &test_case4 ) );
+
+ framework::master_test_suite().add( ts1 );
+ framework::master_test_suite().add( ts2 );
+
+ return 0;
+}
+
+//____________________________________________________________________________//

Added: trunk/libs/test/doc/src/examples/example11.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example11.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,18 @@
+> example --log_level=test_suite
+Running 4 test cases...
+Entering test suite "Master Test Suite"
+Entering test suite "test_suite1"
+Entering test case "test_case1"
+Leaving test case "test_case1"
+Entering test case "test_case2"
+Leaving test case "test_case2"
+Leaving test suite "test_suite1"
+Entering test suite "test_suite2"
+Entering test case "test_case3"
+Leaving test case "test_case3"
+Entering test case "test_case4"
+Leaving test case "test_case4"
+Leaving test suite "test_suite2"
+Leaving test suite "Master Test Suite"
+
+*** No errors detected

Added: trunk/libs/test/doc/src/examples/example12.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example12.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,30 @@
+#define BOOST_TEST_MODULE example
+#include <boost/test/included/unit_test.hpp>
+
+BOOST_AUTO_TEST_SUITE( test_suite1 )
+
+BOOST_AUTO_TEST_CASE( test_case1 )
+{
+ BOOST_WARN( sizeof(int) < 4 );
+}
+
+BOOST_AUTO_TEST_CASE( test_case2 )
+{
+ BOOST_REQUIRE_EQUAL( 1, 2 );
+ BOOST_FAIL( "Should never reach this line" );
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+BOOST_AUTO_TEST_SUITE( test_suite2 )
+
+BOOST_AUTO_TEST_CASE( test_case3 )
+{
+ BOOST_CHECK( true );
+}
+
+BOOST_AUTO_TEST_CASE( test_case4 )
+{
+ BOOST_CHECK( false );
+}
+
+BOOST_AUTO_TEST_SUITE_END()

Added: trunk/libs/test/doc/src/examples/example12.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example12.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,6 @@
+> example
+Running 4 test cases...
+test.cpp(12): fatal error in "test_case2": critical check 1 == 2 failed [1 != 2]
+test.cpp(27): error in "test_case4": check false failed
+
+*** 2 failures detected in test suite "example"

Added: trunk/libs/test/doc/src/examples/example13.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example13.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,26 @@
+#include <boost/test/included/unit_test.hpp>
+using namespace boost::unit_test;
+
+//____________________________________________________________________________//
+
+void free_test_function()
+{
+ BOOST_CHECK( true /* test assertion */ );
+}
+
+//____________________________________________________________________________//
+
+test_suite*
+init_unit_test_suite( int argc, char* argv[] )
+{
+ if( framework::master_test_suite().argc > 1 )
+ return 0;
+
+ framework::master_test_suite().
+ add( BOOST_TEST_CASE( &free_test_function ) );
+
+ return 0;
+}
+
+//____________________________________________________________________________//
+

Added: trunk/libs/test/doc/src/examples/example13.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example13.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,2 @@
+> example 1
+Test setup error: test tree is empty
\ No newline at end of file

Added: trunk/libs/test/doc/src/examples/example14.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example14.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,13 @@
+#define BOOST_TEST_DYN_LINK
+#define BOOST_TEST_MODULE my master test suite name
+#include <boost/test/included/unit_test.hpp>
+
+//____________________________________________________________________________//
+
+BOOST_AUTO_TEST_CASE( free_test_function )
+{
+ BOOST_CHECK( true /* test assertion */ );
+}
+
+//____________________________________________________________________________//
+

Added: trunk/libs/test/doc/src/examples/example14.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example14.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,9 @@
+> example --log_level=test_suite
+Running 1 test case...
+Entering test suite "my master test suite name"
+Entering test case "free_test_function"
+Leaving test case "free_test_function"; testing time: 1ms
+Leaving test suite "my master test suite name"
+
+*** No errors detected
+

Added: trunk/libs/test/doc/src/examples/example15.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example15.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,21 @@
+#include <boost/test/included/unit_test.hpp>
+using namespace boost::unit_test;
+
+//____________________________________________________________________________//
+
+BOOST_AUTO_TEST_CASE( free_test_function )
+{
+ BOOST_CHECK( true /* test assertion */ );
+}
+
+//____________________________________________________________________________//
+
+test_suite*
+init_unit_test_suite( int argc, char* argv[] )
+{
+ framework::master_test_suite().p_name.value = "my master test suite name";
+
+ return 0;
+}
+
+//____________________________________________________________________________//

Added: trunk/libs/test/doc/src/examples/example15.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example15.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,9 @@
+> example --log_level=test_suite
+Running 1 test case...
+Entering test suite "my master test suite name"
+Entering test case "free_test_function"
+Leaving test case "free_test_function"; testing time: 1ms
+Leaving test suite "my master test suite name"
+
+*** No errors detected
+

Added: trunk/libs/test/doc/src/examples/example16.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example16.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,21 @@
+#include <boost/test/included/unit_test.hpp>
+using namespace boost::unit_test;
+
+//____________________________________________________________________________//
+
+void free_test_function()
+{
+ BOOST_CHECK( 2 == 1 );
+}
+
+//____________________________________________________________________________//
+
+test_suite*
+init_unit_test_suite( int, char* [] ) {
+ framework::master_test_suite().
+ add( BOOST_TEST_CASE( &free_test_function ), 2 );
+
+ return 0;
+}
+
+//____________________________________________________________________________//

Added: trunk/libs/test/doc/src/examples/example16.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example16.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,6 @@
+> example --log_level=message
+Running 1 test case...
+test.cpp(8): error in "free_test_function": check 2 == 1 failed
+Test case has less failures then expected
+
+*** No errors detected

Added: trunk/libs/test/doc/src/examples/example17.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example17.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,27 @@
+#define BOOST_TEST_MODULE example
+#include <boost/test/included/unit_test.hpp>
+
+//____________________________________________________________________________//
+
+BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES( my_test1, 1 )
+
+BOOST_AUTO_TEST_CASE( my_test1 )
+{
+ BOOST_CHECK( 2 == 1 );
+}
+
+//____________________________________________________________________________//
+
+BOOST_AUTO_TEST_SUITE( internal )
+
+BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES( my_test1, 2 )
+
+BOOST_AUTO_TEST_CASE( my_test1 )
+{
+ BOOST_CHECK_EQUAL( sizeof(int), sizeof(char) );
+ BOOST_CHECK_EQUAL( sizeof(int*), sizeof(char) );
+}
+
+//____________________________________________________________________________//
+
+BOOST_AUTO_TEST_SUITE_END()
\ No newline at end of file

Added: trunk/libs/test/doc/src/examples/example17.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example17.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,10 @@
+> example --report_level=short
+Running 2 test cases...
+test.cpp(10): error in "my_test1": check 2 == 1 failed
+test.cpp(21): error in "my_test1": check sizeof(int) == sizeof(char) failed [4 != 1]
+test.cpp(22): error in "my_test1": check sizeof(int*) == sizeof(char) failed [4 != 1]
+
+Test suite "example" passed with:
+ 3 assertions out of 3 failed
+ 3 failures expected
+ 2 test cases out of 2 passed

Added: trunk/libs/test/doc/src/examples/example18.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example18.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,25 @@
+#define BOOST_TEST_MODULE example
+#include <boost/test/included/unit_test.hpp>
+
+struct F {
+ F() : i( 0 ) { BOOST_TEST_MESSAGE( "setup fixture" ); }
+ ~F() { BOOST_TEST_MESSAGE( "teardown fixture" ); }
+
+ int i;
+};
+
+BOOST_FIXTURE_TEST_CASE( test_case1, F )
+{
+ BOOST_CHECK( i == 1 );
+ ++i;
+}
+
+BOOST_FIXTURE_TEST_CASE( test_case2, F )
+{
+ BOOST_CHECK_EQUAL( i, 1 );
+}
+
+BOOST_AUTO_TEST_CASE( test_case3 )
+{
+ BOOST_CHECK( true );
+}

Added: trunk/libs/test/doc/src/examples/example18.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example18.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,10 @@
+> example --log_level=message
+Running 3 test cases...
+setup fixture
+test.cpp(13): error in "test_case1": check i == 1 failed
+teardown fixture
+setup fixture
+test.cpp(19): error in "test_case2": check i == 1 failed [0 != 1]
+teardown fixture
+
+*** 2 failures detected in test suite "example"
\ No newline at end of file

Added: trunk/libs/test/doc/src/examples/example19.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example19.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,30 @@
+#define BOOST_TEST_MODULE example
+#include <boost/test/included/unit_test.hpp>
+
+struct F {
+ F() : i( 0 ) { BOOST_TEST_MESSAGE( "setup fixture" ); }
+ ~F() { BOOST_TEST_MESSAGE( "teardown fixture" ); }
+
+ int i;
+};
+
+//____________________________________________________________________________//
+
+BOOST_FIXTURE_TEST_SUITE( s, F )
+
+BOOST_AUTO_TEST_CASE( test_case1 )
+{
+ BOOST_CHECK( i == 1 );
+}
+
+//____________________________________________________________________________//
+
+BOOST_AUTO_TEST_CASE( test_case2 )
+{
+ BOOST_CHECK_EQUAL( i, 0 );
+}
+
+//____________________________________________________________________________//
+
+BOOST_AUTO_TEST_SUITE_END()
+

Added: trunk/libs/test/doc/src/examples/example19.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example19.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,5 @@
+> example
+Running 2 test cases...
+test.cpp(17): error in "test_case1": check i == 1 failed
+
+*** 1 failure detected in test suite "example"

Added: trunk/libs/test/doc/src/examples/example20.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example20.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,22 @@
+#define BOOST_TEST_MODULE example
+#include <boost/test/included/unit_test.hpp>
+#include <iostream>
+
+//____________________________________________________________________________//
+
+struct MyConfig {
+ MyConfig() { std::cout << "global setup\n"; }
+ ~MyConfig() { std::cout << "global teardown\n"; }
+};
+
+//____________________________________________________________________________//
+
+BOOST_GLOBAL_FIXTURE( MyConfig );
+
+BOOST_AUTO_TEST_CASE( test_case )
+{
+ BOOST_CHECK( true );
+}
+
+//____________________________________________________________________________//
+

Added: trunk/libs/test/doc/src/examples/example20.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example20.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,6 @@
+> example
+global setup
+Running 1 test case...
+global teardown
+
+*** No errors detected

Added: trunk/libs/test/doc/src/examples/example21.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example21.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,25 @@
+#define BOOST_TEST_MODULE example
+#include <boost/test/included/unit_test.hpp>
+
+//____________________________________________________________________________//
+
+BOOST_AUTO_TEST_CASE( test_init )
+{
+ int current_time = 0; // real call is required here
+
+ BOOST_TEST_MESSAGE( "Testing initialization :" );
+ BOOST_TEST_MESSAGE( "Current time:" << current_time );
+}
+
+//____________________________________________________________________________//
+
+BOOST_AUTO_TEST_CASE( test_update )
+{
+ std::string field_name = "Volume";
+ int value = 100;
+
+ BOOST_TEST_MESSAGE( "Testing update :" );
+ BOOST_TEST_MESSAGE( "Update " << field_name << " with " << value );
+}
+
+//____________________________________________________________________________//

Added: trunk/libs/test/doc/src/examples/example21.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example21.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,8 @@
+> example --log_level=message
+Running 2 test cases...
+Testing initialization :
+Current time:0
+Testing update :
+Update Volume with 100
+
+*** No errors detected

Added: trunk/libs/test/doc/src/examples/example22.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example22.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,25 @@
+#define BOOST_TEST_MODULE example
+#include <boost/test/included/unit_test.hpp>
+
+//____________________________________________________________________________//
+
+extern void foo( int i );
+
+//____________________________________________________________________________//
+
+BOOST_AUTO_TEST_CASE( test_external_interface )
+{
+ for( int i = 3; i >=0; i-- ) {
+ BOOST_TEST_CHECKPOINT( "Calling foo with i=" << i );
+ foo( i );
+ }
+}
+
+//____________________________________________________________________________//
+
+void foo( int i )
+{
+ int j = 2/(i-1);
+}
+
+//____________________________________________________________________________//
\ No newline at end of file

Added: trunk/libs/test/doc/src/examples/example22.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example22.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,6 @@
+> example
+Running 1 test case...
+unknown location(0): fatal error in "test_external_interface": signal: integer divide by zero; address of failing instruction: 0x00048090
+test.cpp(13): last checkpoint: Calling foo with i=1
+
+*** 1 failure detected in test suite "example"

Added: trunk/libs/test/doc/src/examples/example23.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example23.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,20 @@
+#define BOOST_TEST_MODULE example
+#include <boost/test/included/unit_test.hpp>
+
+//____________________________________________________________________________//
+
+BOOST_AUTO_TEST_CASE( test_case )
+{
+ int* p = 0;
+
+ BOOST_TEST_PASSPOINT();
+ ++p;
+
+ BOOST_TEST_PASSPOINT();
+ ++p;
+
+ BOOST_TEST_PASSPOINT();
+ int j = *p;
+}
+
+//____________________________________________________________________________//
\ No newline at end of file

Added: trunk/libs/test/doc/src/examples/example23.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example23.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,6 @@
+> example
+Running 1 test case...
+unknown location(0): fatal error in "test_case": memory access violation at address: 0x00000008: no mapping at fault address
+test.cpp(16): last checkpoint
+
+*** 1 failure detected in test suite "example"

Added: trunk/libs/test/doc/src/examples/example24.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example24.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,13 @@
+#include <iostream>
+#include <boost/test/included/prg_exec_monitor.hpp>
+
+//____________________________________________________________________________//
+
+int cpp_main( int, char* [] ) // note name cpp_main, not main.
+{
+ std::cout << "Hello, world\n";
+
+ return 0;
+}
+
+//____________________________________________________________________________//

Added: trunk/libs/test/doc/src/examples/example24.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example24.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,3 @@
+Hello, world
+
+no errors detected
\ No newline at end of file

Added: trunk/libs/test/doc/src/examples/example25.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example25.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,17 @@
+#include <stdexcept>
+#include <boost/test/included/prg_exec_monitor.hpp>
+
+//____________________________________________________________________________//
+
+int foo() { throw std::runtime_exception( "big trouble" ); }
+
+//____________________________________________________________________________//
+
+int cpp_main( int, char* [] ) // note the name
+{
+ foo();
+
+ return 0;
+}
+
+//____________________________________________________________________________//

Added: trunk/libs/test/doc/src/examples/example25.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example25.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,2 @@
+**** exception(205): std::runtime_error: big trouble
+******** errors detected; see standard output for details ********
\ No newline at end of file

Added: trunk/libs/test/doc/src/examples/example26.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example26.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,10 @@
+#include <boost/test/prg_exec_monitor.hpp> // this header is optional
+
+//____________________________________________________________________________//
+
+int cpp_main( int, char* [] ) // note the name
+{
+ return 5;
+}
+
+//____________________________________________________________________________//

Added: trunk/libs/test/doc/src/examples/example26.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example26.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,2 @@
+**** error return code: 5
+******** errors detected; see standard output for details ********
\ No newline at end of file

Added: trunk/libs/test/doc/src/examples/example27.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example27.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,23 @@
+#include <boost/test/minimal.hpp>
+
+//____________________________________________________________________________//
+
+int add( int i, int j ) { return i+j; }
+
+//____________________________________________________________________________//
+
+int test_main( int, char *[] ) // note the name!
+{
+ // six ways to detect and report the same error:
+ BOOST_CHECK( add( 2,2 ) == 4 ); // #1 continues on error
+ BOOST_REQUIRE( add( 2,2 ) == 4 ); // #2 throws on error
+ if( add( 2,2 ) != 4 )
+ BOOST_ERROR( "Ouch..." ); // #3 continues on error
+ if( add( 2,2 ) != 4 )
+ BOOST_FAIL( "Ouch..." ); // #4 throws on error
+ if( add( 2,2 ) != 4 ) throw "Oops..."; // #5 throws on error
+
+ return add( 2, 2 ) == 4 ? 0 : 1; // #6 returns error code
+}
+
+//____________________________________________________________________________//

Added: trunk/libs/test/doc/src/examples/example27.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example27.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,2 @@
+
+**** no errors detected

Added: trunk/libs/test/doc/src/examples/example28.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example28.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,18 @@
+#define BOOST_TEST_MODULE example
+#include <boost/test/included/unit_test.hpp>
+#include <boost/test/output_test_stream.hpp>
+using boost::test_tools::output_test_stream;
+
+//____________________________________________________________________________//
+
+BOOST_AUTO_TEST_CASE( test )
+{
+ output_test_stream output;
+ int i=2;
+ output << "i=" << i;
+ BOOST_CHECK( !output.is_empty( false ) );
+ BOOST_CHECK( output.check_length( 3, false ) );
+ BOOST_CHECK( output.is_equal( "i=3" ) );
+}
+
+//____________________________________________________________________________//

Added: trunk/libs/test/doc/src/examples/example28.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example28.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,5 @@
+> example
+Running 1 test case...
+test.cpp(15): error in "test": check output.is_equal( "i=3" ) failed. Output content: "i=2"
+
+*** 1 failure detected in test suite "example"

Added: trunk/libs/test/doc/src/examples/example29.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example29.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,19 @@
+#define BOOST_TEST_MODULE example
+#include <boost/test/included/unit_test.hpp>
+#include <boost/test/output_test_stream.hpp>
+using boost::test_tools::output_test_stream;
+
+//____________________________________________________________________________//
+
+BOOST_AUTO_TEST_CASE( test )
+{
+ output_test_stream output( "pattern_file", true );
+ int i=2;
+ output << "i=" << i;
+ BOOST_CHECK( output.match_pattern() );
+
+ output << "\nFile: " << __FILE__ << " Line: " << __LINE__;
+ BOOST_CHECK( output.match_pattern() );
+}
+
+//____________________________________________________________________________//

Added: trunk/libs/test/doc/src/examples/example29.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example29.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,7 @@
+> example
+Running 1 test case...
+test.cpp(16): error in "test": check output.match_pattern() failed. Mismatch at position 23
+...5...
+...4...
+
+*** 1 failure detected in test suite "example"

Added: trunk/libs/test/doc/src/examples/example30.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example30.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,17 @@
+#define BOOST_TEST_MODULE example
+#include <boost/test/included/unit_test.hpp>
+
+//____________________________________________________________________________//
+
+bool is_even( int i ) { return i%2 == 0; }
+
+BOOST_AUTO_TEST_CASE( test_is_even )
+{
+ BOOST_CHECK_PREDICATE( is_even, (14) );
+
+ int i = 17;
+ BOOST_CHECK_PREDICATE( is_even, (i) );
+}
+
+//____________________________________________________________________________//
+

Added: trunk/libs/test/doc/src/examples/example30.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example30.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,5 @@
+> example
+Running 1 test case...
+test.cpp(13): error in "test_is_even": check is_even( i ) failed for ( 17 )
+
+*** 1 failure detected in test suite "example"

Added: trunk/libs/test/doc/src/examples/example31.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example31.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,32 @@
+#define BOOST_TEST_MODULE example
+#include <boost/test/included/unit_test.hpp>
+
+//____________________________________________________________________________//
+
+boost::test_tools::predicate_result
+compare_lists( std::list<int> const& l1, std::list<int> const& l2 )
+{
+ if( l1.size() != l2.size() ) {
+ boost::test_tools::predicate_result res( false );
+
+ res.message() << "Different sizes [" << l1.size() << "!=" << l2.size() << "]";
+
+ return res;
+ }
+
+ return true;
+}
+
+//____________________________________________________________________________//
+
+BOOST_AUTO_TEST_CASE( test_list_comparizon )
+{
+ std::list<int> l1, l2;
+ l1.push_back( 1 );
+ l1.push_back( 2 );
+
+ BOOST_CHECK( compare_lists( l1, l2 ) );
+}
+
+//____________________________________________________________________________//
+

Added: trunk/libs/test/doc/src/examples/example31.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example31.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,4 @@
+Running 1 test case...
+test.cpp(28): error in "test_list_comparizon": check compare_lists( l1, l2 ) failed. Different sizes [2!=0]
+
+*** 1 failure detected in test suite "example"

Added: trunk/libs/test/doc/src/examples/example32.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example32.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,19 @@
+#define BOOST_TEST_MODULE example
+#include <boost/test/included/unit_test.hpp>
+#include <utility>
+
+//____________________________________________________________________________//
+
+typedef std::pair<int,float> pair_type;
+
+BOOST_TEST_DONT_PRINT_LOG_VALUE( pair_type );
+
+BOOST_AUTO_TEST_CASE( test_list )
+{
+ pair_type p1( 2, 5.5 );
+ pair_type p2( 2, 5.501 );
+
+ BOOST_CHECK_EQUAL( p1, p2 );
+}
+
+//____________________________________________________________________________//

Added: trunk/libs/test/doc/src/examples/example32.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example32.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,4 @@
+Running 1 test case...
+test.cpp(16): error in "test_list": check p1 == p2 failed [ != ]
+
+*** 1 failure detected in test suite "example"

Added: trunk/libs/test/doc/src/examples/example33.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example33.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,11 @@
+#define BOOST_TEST_MODULE example
+#include <boost/test/included/unit_test.hpp>
+
+//____________________________________________________________________________//
+
+BOOST_AUTO_TEST_CASE( test )
+{
+ BOOST_CHECK_BITWISE_EQUAL( (char)0x26, 0x04 );
+}
+
+//____________________________________________________________________________//

Added: trunk/libs/test/doc/src/examples/example33.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example33.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,8 @@
+> example
+Running 1 test case...
+test.cpp(8): error in "test": check (char)0x26 =.= 0x04 failed.
+Mismatch in a position 1
+Mismatch in a position 5
+Operands bit sizes mismatch: 8 != 32
+
+*** 1 failure detected in test suite "example"
\ No newline at end of file

Added: trunk/libs/test/doc/src/examples/example34.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example34.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,15 @@
+#define BOOST_TEST_MODULE example
+#include <boost/test/included/unit_test.hpp>
+
+//____________________________________________________________________________//
+
+BOOST_AUTO_TEST_CASE( test )
+{
+ int i=2;
+ BOOST_WARN( sizeof(int) == sizeof(short) );
+ BOOST_CHECK( i == 1 );
+ BOOST_REQUIRE( i > 5 );
+ BOOST_CHECK( i == 6 ); // will never reach this check
+}
+
+//____________________________________________________________________________//

Added: trunk/libs/test/doc/src/examples/example34.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example34.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,7 @@
+> example --log_level=warning
+Running 1 test case...
+test.cpp(9): warning in "test": condition sizeof(int) == sizeof(short) is not satisfied
+test.cpp(10): error in "test": check i == 1 failed
+test.cpp(11): fatal error in "test": critical check i > 5 failed
+
+*** 2 failures detected in test suite "example"

Added: trunk/libs/test/doc/src/examples/example35.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example35.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,13 @@
+#define BOOST_TEST_MODULE example
+#include <boost/test/included/unit_test.hpp>
+
+//____________________________________________________________________________//
+
+BOOST_AUTO_TEST_CASE( test )
+{
+ int i = 2;
+ int j = 1;
+ BOOST_REQUIRE_EQUAL( i, j );
+}
+
+//____________________________________________________________________________//

Added: trunk/libs/test/doc/src/examples/example35.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example35.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,5 @@
+> example
+Running 1 test case...
+test.cpp(10): fatal error in "test": critical check i == j failed [2 != 1]
+
+*** 1 failure detected in test suite "example"

Added: trunk/libs/test/doc/src/examples/example36.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example36.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,14 @@
+#define BOOST_TEST_MODULE example
+#include <boost/test/included/unit_test.hpp>
+
+//____________________________________________________________________________//
+
+BOOST_AUTO_TEST_CASE( test )
+{
+ int col1 [] = { 1, 2, 3, 4, 5, 6, 7 };
+ int col2 [] = { 1, 2, 4, 4, 5, 7, 7 };
+
+ BOOST_CHECK_EQUAL_COLLECTIONS( col1, col1+7, col2, col2+7 );
+}
+
+//____________________________________________________________________________//

Added: trunk/libs/test/doc/src/examples/example36.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example36.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,7 @@
+> example
+Running 1 test case...
+test.cpp(11): error in "test": check { col1, col1+7 } == { col2, col2+7 } failed.
+Mismatch in a position 2: 3 != 4
+Mismatch in a position 5: 6 != 7
+
+*** 1 failure detected in test suite "example"

Added: trunk/libs/test/doc/src/examples/example37.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example37.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,19 @@
+#define BOOST_TEST_MODULE example
+#include <boost/test/included/unit_test.hpp>
+
+//____________________________________________________________________________//
+
+struct my_exception {
+ explicit my_exception( int ec = 0 ) : m_error_code( ec ) {}
+
+ int m_error_code;
+};
+
+bool is_critical( my_exception const& ex ) { return ex.m_error_code < 0; }
+
+BOOST_AUTO_TEST_CASE( test )
+{
+ BOOST_CHECK_EXCEPTION( throw my_exception( 1 ), my_exception, is_critical );
+}
+
+//____________________________________________________________________________//

Added: trunk/libs/test/doc/src/examples/example37.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example37.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,5 @@
+> example
+Running 1 test case...
+test.cpp(16): error in "test": incorrect exception my_exception is caught
+
+*** 1 failure detected in test suite "example"

Added: trunk/libs/test/doc/src/examples/example38.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example38.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,15 @@
+#define BOOST_TEST_MODULE example
+#include <boost/test/included/unit_test.hpp>
+
+//____________________________________________________________________________//
+
+#include <cmath>
+
+BOOST_AUTO_TEST_CASE( test )
+{
+ double res = std::sin( 45. );
+
+ BOOST_WARN_MESSAGE( res > 1, "sin(45){" << res << "} is <= 1. Hmm.. Strange. " );
+}
+
+//____________________________________________________________________________//

Added: trunk/libs/test/doc/src/examples/example38.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example38.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,5 @@
+> example --log_level=warning
+Running 1 test case...
+test.cpp(12): warning in "test": sin(45){0.850904} is <= 1. Hmm.. Strange.
+
+*** No errors detected
\ No newline at end of file

Added: trunk/libs/test/doc/src/examples/example39.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example39.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,13 @@
+#define BOOST_TEST_MODULE example
+#include <boost/test/included/unit_test.hpp>
+
+//____________________________________________________________________________//
+
+class my_exception{};
+
+BOOST_AUTO_TEST_CASE( test )
+{
+ BOOST_CHECK_NO_THROW( throw my_exception() );
+}
+
+//____________________________________________________________________________//

Added: trunk/libs/test/doc/src/examples/example39.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example39.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,5 @@
+> example
+Running 1 test case...
+test.cpp(10): error in "test": exception thrown by throw my_exception()
+
+*** 1 failure detected in test suite "example"
\ No newline at end of file

Added: trunk/libs/test/doc/src/examples/example40.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example40.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,18 @@
+#define BOOST_TEST_MODULE example
+#include <boost/test/included/unit_test.hpp>
+using namespace boost::unit_test;
+
+//____________________________________________________________________________//
+
+bool moo( int arg1, int arg2, int mod ) { return ((arg1+arg2) % mod) == 0; }
+
+BOOST_AUTO_TEST_CASE( test )
+{
+ int i = 17;
+ int j = 15;
+ unit_test_log.set_threshold_level( log_warnings );
+ BOOST_WARN( moo( 12,i,j ) );
+ BOOST_WARN_PREDICATE( moo, (12)(i)(j) );
+}
+
+//____________________________________________________________________________//

Added: trunk/libs/test/doc/src/examples/example40.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example40.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,6 @@
+> example
+Running 1 test case...
+test.cpp(14): warning in "test": condition moo( 12,i,j ) is not satisfied
+test.cpp(15): warning in "test": condition moo( 12, i, j ) is not satisfied for ( 12, 17, 15 )
+
+*** No errors detected
\ No newline at end of file

Added: trunk/libs/test/doc/src/examples/example41.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example41.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,14 @@
+#define BOOST_TEST_MODULE example
+#include <boost/test/included/unit_test.hpp>
+#include <boost/test/floating_point_comparison.hpp>
+
+//____________________________________________________________________________//
+
+BOOST_AUTO_TEST_CASE( test )
+{
+ double v = -1.23456e-3;
+
+ BOOST_CHECK_SMALL( v, 0.000001 );
+}
+
+//____________________________________________________________________________//

Added: trunk/libs/test/doc/src/examples/example41.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example41.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,5 @@
+> example
+Running 1 test case...
+test.cpp(11): error in "test": absolute value of v{-0.00123456} exceeds 1e-006
+
+*** 1 failure detected in test suite "example"

Added: trunk/libs/test/doc/src/examples/example42.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example42.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,18 @@
+#define BOOST_TEST_MODULE example
+#include <boost/test/included/unit_test.hpp>
+#include <boost/test/floating_point_comparison.hpp>
+
+//____________________________________________________________________________//
+
+BOOST_AUTO_TEST_CASE( test )
+{
+ double v1 = 1.23456e-10;
+ double v2 = 1.23457e-10;
+
+ BOOST_CHECK_CLOSE( v1, v2, 0.0001 );
+ // Absolute value of difference between these two values is 1e-15. They seems
+ // to be very close. But we want to checks that these values differ no more then 0.0001%
+ // of their value. And this test will fail at tolerance supplied.
+}
+
+//____________________________________________________________________________//

Added: trunk/libs/test/doc/src/examples/example42.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example42.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,5 @@
+> 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 failure detected in test suite "example"

Added: trunk/libs/test/doc/src/examples/example43.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example43.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,18 @@
+#define BOOST_TEST_MODULE example
+#include <boost/test/included/unit_test.hpp>
+#include <boost/test/floating_point_comparison.hpp>
+
+//____________________________________________________________________________//
+
+BOOST_AUTO_TEST_CASE( test )
+{
+ double v1 = 1.23456e28;
+ double v2 = 1.23457e28;
+
+ BOOST_REQUIRE_CLOSE( v1, v2, 0.001 );
+ // Absolute value of difference between these two values is 1e+23.
+ // But we are interested only that it does not exeed 0.001% of a values compared
+ // And this test will pass.
+}
+
+//____________________________________________________________________________//

Added: trunk/libs/test/doc/src/examples/example43.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example43.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,4 @@
+> example
+Running 1 test case...
+
+*** No errors detected

Added: trunk/libs/test/doc/src/examples/example44.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example44.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,15 @@
+#define BOOST_TEST_MODULE example
+#include <boost/test/included/unit_test.hpp>
+#include <boost/test/floating_point_comparison.hpp>
+
+//____________________________________________________________________________//
+
+BOOST_AUTO_TEST_CASE( test )
+{
+ double v1 = 1.111e-10;
+ double v2 = 1.112e-10;
+
+ BOOST_CHECK_CLOSE_FRACTION( v1, v2, 0.0008999 );
+}
+
+//____________________________________________________________________________//

Added: trunk/libs/test/doc/src/examples/example44.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example44.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,5 @@
+> 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 failure detected in test suite "example"

Added: trunk/libs/test/doc/src/examples/example45.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example45.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,14 @@
+#define BOOST_TEST_MODULE example
+#include <boost/test/included/unit_test.hpp>
+
+//____________________________________________________________________________//
+
+class my_exception{};
+
+BOOST_AUTO_TEST_CASE( test )
+{
+ int i = 0;
+ BOOST_CHECK_THROW( i++, my_exception );
+}
+
+//____________________________________________________________________________//

Added: trunk/libs/test/doc/src/examples/example45.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example45.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,5 @@
+> example
+Running 1 test case...
+test.cpp(11): error in "test": exception my_exception is expected
+
+*** 1 failure detected in test suite "example"
\ No newline at end of file

Added: trunk/libs/test/doc/src/examples/example46.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example46.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,11 @@
+#define BOOST_TEST_MODULE example
+#include <boost/test/included/unit_test.hpp>
+
+//____________________________________________________________________________//
+
+BOOST_AUTO_TEST_CASE( test )
+{
+ BOOST_ERROR( "Nothing to test" );
+}
+
+//____________________________________________________________________________//

Added: trunk/libs/test/doc/src/examples/example46.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example46.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,5 @@
+> example
+Running 1 test case...
+test.cpp(8): error in "test": Nothing to test
+
+*** 1 failure detected in test suite "example"
\ No newline at end of file

Added: trunk/libs/test/doc/src/examples/example47.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example47.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,11 @@
+#define BOOST_TEST_MODULE example
+#include <boost/test/included/unit_test.hpp>
+
+//____________________________________________________________________________//
+
+BOOST_AUTO_TEST_CASE( test )
+{
+ BOOST_FAIL( "Test is not ready yet" );
+}
+
+//____________________________________________________________________________//

Added: trunk/libs/test/doc/src/examples/example47.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example47.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,5 @@
+> example
+Running 1 test case...
+test.cpp(8): fatal error in "test": Test is not ready yet
+
+*** 1 failure detected in test suite "example"
\ No newline at end of file

Added: trunk/libs/test/doc/src/examples/example48.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example48.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,12 @@
+#define BOOST_TEST_MODULE example
+#include <boost/test/included/unit_test.hpp>
+
+//____________________________________________________________________________//
+
+BOOST_AUTO_TEST_CASE( test )
+{
+ BOOST_CHECK( BOOST_IS_DEFINED(SYMBOL1) );
+ BOOST_CHECK( BOOST_IS_DEFINED(SYMBOL2(arg)) );
+}
+
+//____________________________________________________________________________//

Added: trunk/libs/test/doc/src/examples/example48.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example48.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,6 @@
+> example
+Running 1 test case...
+test.cpp(8): error in "test": check ::boost::test_tools::tt_detail::is_defined_impl( "SYMBOL1", "= SYMBOL1" ) failed
+test.cpp(9): error in "test": check ::boost::test_tools::tt_detail::is_defined_impl( "SYMBOL2(arg)", "= SYMBOL2(arg)" ) failed
+
+*** 2 failures detected in test suite "example"
\ No newline at end of file

Added: trunk/libs/test/doc/src/examples/example49.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example49.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,23 @@
+#include <boost/test/included/unit_test.hpp>
+using namespace boost::unit_test;
+
+//____________________________________________________________________________//
+
+void free_test_function()
+{
+ BOOST_CHECK( true /* test assertion */ );
+}
+
+//____________________________________________________________________________//
+
+test_suite*
+init_unit_test_suite( int argc, char* argv[] )
+{
+ for( int i=0; i < 10000; i++ )
+ framework::master_test_suite().
+ add( BOOST_TEST_CASE( &free_test_function ) );
+
+ return 0;
+}
+
+//____________________________________________________________________________//

Added: trunk/libs/test/doc/src/examples/example49.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example49.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,7 @@
+> example --show_progress=yes --log_level=nothing
+
+0% 10 20 30 40 50 60 70 80 90 100%
+|----|----|----|----|----|----|----|----|----|----|
+***************************************************
+
+*** No errors detected

Added: trunk/libs/test/doc/src/examples/example50.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example50.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,24 @@
+#define BOOST_TEST_MODULE example
+#include <boost/test/included/unit_test.hpp>
+#include <fstream>
+
+//____________________________________________________________________________//
+
+struct MyConfig {
+ MyConfig() : test_log( "example.log" ) { boost::unit_test::unit_test_log.set_stream( test_log ); }
+ ~MyConfig() { boost::unit_test::unit_test_log.set_stream( std::cout ); }
+
+ std::ofstream test_log;
+};
+
+//____________________________________________________________________________//
+
+BOOST_GLOBAL_FIXTURE( MyConfig );
+
+BOOST_AUTO_TEST_CASE( test_case )
+{
+ BOOST_CHECK( false );
+}
+
+//____________________________________________________________________________//
+

Added: trunk/libs/test/doc/src/examples/example50.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example50.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,6 @@
+> example
+
+*** 1 failure detected in test suite "example"
+> cat example.log
+Running 1 test case...
+test.cpp(20): error in "test_case": check false failed

Added: trunk/libs/test/doc/src/examples/example51.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example51.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,17 @@
+#define BOOST_TEST_MODULE example
+#include <boost/test/included/unit_test.hpp>
+#include <boost/test/detail/unit_test_parameters.hpp>
+using namespace boost::unit_test;
+
+//____________________________________________________________________________//
+
+BOOST_AUTO_TEST_CASE( test_case0 )
+{
+ if( runtime_config::log_level() < log_warnings )
+ unit_test_log.set_threshold_level( log_warnings );
+
+ BOOST_WARN( sizeof(int) > 4 );
+}
+
+//____________________________________________________________________________//
+

Added: trunk/libs/test/doc/src/examples/example51.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example51.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,5 @@
+> example
+Running 1 test case...
+test.cpp(13): warning in "test_case0": condition sizeof(int) > 4 is not satisfied
+
+*** No errors detected

Added: trunk/libs/test/doc/src/examples/example52.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example52.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,22 @@
+#define BOOST_TEST_MODULE example
+#include <boost/test/included/unit_test.hpp>
+using namespace boost::unit_test;
+
+//____________________________________________________________________________//
+
+struct MyConfig {
+ MyConfig() { unit_test_log.set_format( XML ); }
+ ~MyConfig() {}
+};
+
+//____________________________________________________________________________//
+
+BOOST_GLOBAL_FIXTURE( MyConfig );
+
+BOOST_AUTO_TEST_CASE( test_case0 )
+{
+ BOOST_CHECK( false );
+}
+
+//____________________________________________________________________________//
+

Added: trunk/libs/test/doc/src/examples/example52.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example52.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,2 @@
+> example --report_level=no
+<TestLog><Error file="test.cpp" line="18">check false failed</Error></TestLog>

Added: trunk/libs/test/doc/src/examples/example53.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example53.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,26 @@
+#define BOOST_TEST_MODULE example
+#include <boost/test/included/unit_test.hpp>
+
+BOOST_AUTO_TEST_SUITE( test_suite )
+
+BOOST_AUTO_TEST_CASE( test_case1 )
+{
+ BOOST_ERROR( "some error 1" );
+}
+
+
+BOOST_AUTO_TEST_SUITE_END()
+
+BOOST_AUTO_TEST_CASE( test_case_on_file_scope )
+{
+ BOOST_CHECK( true );
+}
+
+BOOST_AUTO_TEST_SUITE( test_suite )
+
+BOOST_AUTO_TEST_CASE( test_case2 )
+{
+ BOOST_ERROR( "some error 2" );
+}
+
+BOOST_AUTO_TEST_SUITE_END()

Added: trunk/libs/test/doc/src/examples/example53.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example53.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,23 @@
+>example --report_level=detailed
+Running 3 test cases...
+test.cpp(8): error in "test_case1": some error 1
+test.cpp(23): error in "test_case2": some error 2
+
+Test suite "example" failed with:
+ 1 assertion out of 3 passed
+ 2 assertions out of 3 failed
+ 1 test case out of 3 passed
+ 2 test cases out of 3 failed
+
+ Test suite "test_suite" failed with:
+ 2 assertions out of 2 failed
+ 2 test cases out of 2 failed
+
+ Test case "test_case1" failed with:
+ 1 assertion out of 1 failed
+
+ Test case "test_case2" failed with:
+ 1 assertion out of 1 failed
+
+ Test case "test_case_on_file_scope" passed with:
+ 1 assertion out of 1 passed
\ No newline at end of file

Added: trunk/libs/test/doc/src/examples/example54.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example54.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,13 @@
+#define BOOST_TEST_MODULE example
+#include <boost/test/included/unit_test.hpp>
+
+//____________________________________________________________________________//
+
+BOOST_AUTO_TEST_CASE( test )
+{
+ int i = 3;
+ int j = 3;
+ BOOST_CHECK_NE( i, j );
+}
+
+//____________________________________________________________________________//

Added: trunk/libs/test/doc/src/examples/example54.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example54.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,5 @@
+>example
+Running 1 test case...
+test.cpp(10): error in "test": check i != j failed [3 == 3]
+
+*** 1 failure detected in test suite "example"

Added: trunk/libs/test/doc/src/examples/example55.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example55.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,13 @@
+#define BOOST_TEST_MODULE example
+#include <boost/test/included/unit_test.hpp>
+
+//____________________________________________________________________________//
+
+BOOST_AUTO_TEST_CASE( test )
+{
+ int i = 9;
+ int j = 6;
+ BOOST_CHECK_LE( i, j );
+}
+
+//____________________________________________________________________________//

Added: trunk/libs/test/doc/src/examples/example55.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example55.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,5 @@
+>example
+Running 1 test case...
+test.cpp(10): error in "test": check i <= j failed [9 > 6]
+
+*** 1 failure detected in test suite "example"

Added: trunk/libs/test/doc/src/examples/example56.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example56.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,13 @@
+#define BOOST_TEST_MODULE example
+#include <boost/test/included/unit_test.hpp>
+
+//____________________________________________________________________________//
+
+BOOST_AUTO_TEST_CASE( test )
+{
+ int i = 7;
+ int j = 7;
+ BOOST_CHECK_LT( i, j );
+}
+
+//____________________________________________________________________________//

Added: trunk/libs/test/doc/src/examples/example56.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example56.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,5 @@
+>example
+Running 1 test case...
+test.cpp(10): error in "test": check i < j failed [7 >= 7]
+
+*** 1 failure detected in test suite "example"

Added: trunk/libs/test/doc/src/examples/example57.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example57.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,13 @@
+#define BOOST_TEST_MODULE example
+#include <boost/test/included/unit_test.hpp>
+
+//____________________________________________________________________________//
+
+BOOST_AUTO_TEST_CASE( test )
+{
+ int i = 1;
+ int j = 4;
+ BOOST_CHECK_GE( i, j );
+}
+
+//____________________________________________________________________________//

Added: trunk/libs/test/doc/src/examples/example57.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example57.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,5 @@
+>example
+Running 1 test case...
+test.cpp(10): error in "test": check i >= j failed [1 < 4]
+
+*** 1 failure detected in test suite "example"

Added: trunk/libs/test/doc/src/examples/example58.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example58.cpp 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,13 @@
+#define BOOST_TEST_MODULE example
+#include <boost/test/included/unit_test.hpp>
+
+//____________________________________________________________________________//
+
+BOOST_AUTO_TEST_CASE( test )
+{
+ int i = 2;
+ int j = 14;
+ BOOST_CHECK_GT( i, j );
+}
+
+//____________________________________________________________________________//

Added: trunk/libs/test/doc/src/examples/example58.output
==============================================================================
--- (empty file)
+++ trunk/libs/test/doc/src/examples/example58.output 2008-07-28 00:03:12 EDT (Mon, 28 Jul 2008)
@@ -0,0 +1,5 @@
+>example
+Running 1 test case...
+test.cpp(10): error in "test": check i > j failed [2 < 14]
+
+*** 1 failure detected in test suite "example"


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk