Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r76465 - in sandbox/closure: boost libs/scope_exit/doc/html libs/scope_exit/example libs/scope_exit/test
From: lorcaminiti_at_[hidden]
Date: 2012-01-13 15:06:17


Author: lcaminiti
Date: 2012-01-13 15:06:16 EST (Fri, 13 Jan 2012)
New Revision: 76465
URL: http://svn.boost.org/trac/boost/changeset/76465

Log:
Added ScopeExit original regression tests.
Text files modified:
   sandbox/closure/boost/scope_exit.hpp | 29 +++++++++++++--------
   sandbox/closure/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT.html | 2
   sandbox/closure/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_ALL.html | 2
   sandbox/closure/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_CONFIG_NO_CPP11.html | 2
   sandbox/closure/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_END.html | 2
   sandbox/closure/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_TPL.html | 2
   sandbox/closure/libs/scope_exit/doc/html/index.html | 2
   sandbox/closure/libs/scope_exit/example/Jamfile.v2 | 2
   sandbox/closure/libs/scope_exit/test/Jamfile.v2 | 55 ++++++++++++++++++++++++++++++---------
   9 files changed, 67 insertions(+), 31 deletions(-)

Modified: sandbox/closure/boost/scope_exit.hpp
==============================================================================
--- sandbox/closure/boost/scope_exit.hpp (original)
+++ sandbox/closure/boost/scope_exit.hpp 2012-01-13 15:06:16 EST (Fri, 13 Jan 2012)
@@ -30,13 +30,13 @@
 #include <boost/preprocessor/punctuation/comma_if.hpp>
 #include <boost/preprocessor/punctuation/paren_if.hpp>
 #include <boost/preprocessor/seq/cat.hpp>
-#include <boost/preprocessor/seq/enum.hpp>
-#include <boost/preprocessor/seq/for_each_i.hpp>
 #include <boost/preprocessor/tuple/elem.hpp>
+#include <boost/preprocessor/tuple/eat.hpp>
 #include <boost/preprocessor/list/append.hpp>
 #include <boost/preprocessor/list/fold_left.hpp>
 #include <boost/preprocessor/list/enum.hpp>
 #include <boost/preprocessor/list/adt.hpp>
+#include <boost/preprocessor/list/for_each_i.hpp>
 
 // PRIVATE/PROTECTED //
 
@@ -192,7 +192,7 @@
 // avoidance strategy implemented below is to make an indirect compile-time
 // constant by assigning an enum and use that as type-index-- this only works
 // with the sizeof() approach and not with the typeid() approach.
-#if BOOST_WORKAROUND(BOOST_MSVC, >= 1300)
+#if BOOST_WORKAROUND(BOOST_MSVC, >= 1300) && !defined(BOOST_TYPEOF_EMULATION)
 
 namespace boost { namespace scope_exit { namespace aux {
         namespace msvc_typeof_this {
@@ -438,9 +438,12 @@
 
 #define BOOST_SCOPE_EXIT_AUX_IMPL(id, traits, unused) \
     ::boost::scope_exit::aux::guard< \
- BOOST_PP_EXPR_IIF(BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits), \
- BOOST_TYPEOF(this) /* no need for TYPEDEF THIS MSVC workaround */ \
- ) \
+ BOOST_PP_IIF(BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits), \
+ /* no need for TYPEDEF THIS MSVC workaround on C++11 */ \
+ BOOST_TYPEOF /* delay expansion for commas in TYPEOF */ \
+ , \
+ BOOST_PP_TUPLE_EAT(1) \
+ )(this) \
> BOOST_SCOPE_EXIT_AUX_GUARD(id) \
         BOOST_PP_EXPR_IIF(BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits), \
             (this) \
@@ -449,18 +452,22 @@
     BOOST_SCOPE_EXIT_AUX_GUARD(id) = [ \
         BOOST_PP_LIST_ENUM(BOOST_SCOPE_EXIT_AUX_TRAITS_BINDS(traits)) \
     ]( \
- BOOST_PP_EXPR_IIF(BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits), \
- BOOST_TYPEOF(this) this_ \
- ) \
+ BOOST_PP_IIF(BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits), \
+ /* no need for TYPEDEF THIS MSVC workaround on C++11 */ \
+ BOOST_TYPEOF /* delay expansion for commas in TYPEOF */ \
+ , \
+ BOOST_PP_TUPLE_EAT(1) \
+ )(this) \
+ BOOST_PP_EXPR_IIF(BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits), this_) \
     ) mutable -> void
 
 #else // No lambdas.
 
-/** @todo add this_ */
 /** @todo rename binds/BINDS to captures/CAPTURES */
 /** @todo prefix all boost::... as ::boost::.. within macros */
 /** @todo unjustify the newline within macros */
-/** @todo compile ScopeExit original unit tests */
+/** @todo test capture this_ with TYPEOF_EMULATION */
+/** @todo test capture this_ within template with GCC (_TPL) */
 
 // ty: EMPTY() | typename
 #define BOOST_SCOPE_EXIT_AUX_IMPL(id, traits, ty) \

Modified: sandbox/closure/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT.html
==============================================================================
--- sandbox/closure/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT.html (original)
+++ sandbox/closure/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT.html 2012-01-13 15:06:16 EST (Fri, 13 Jan 2012)
@@ -33,7 +33,7 @@
 
 </span>BOOST_SCOPE_EXIT(capture_list)</pre></div>
 <div class="refsect1">
-<a name="id813915"></a><h2>Description</h2>
+<a name="id806269"></a><h2>Description</h2>
 <p>The scope exit declaration schedules the execution of the scope exit body at the exit of the enclosing scope:</p>
 <pre class="programlisting"> <span class="special">{</span> <span class="comment">// Some local scope.</span>
         <span class="special">...</span>

Modified: sandbox/closure/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_ALL.html
==============================================================================
--- sandbox/closure/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_ALL.html (original)
+++ sandbox/closure/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_ALL.html 2012-01-13 15:06:16 EST (Fri, 13 Jan 2012)
@@ -33,7 +33,7 @@
 
 </span>BOOST_SCOPE_EXIT_ALL(capture_list)</pre></div>
 <div class="refsect1">
-<a name="id816066"></a><h2>Description</h2>
+<a name="id808420"></a><h2>Description</h2>
 <p><span class="bold"><strong>Warning:</strong></span> This macro is only available on C++11 compilers. It is not defined on non-C++11 compilers so its use on non-C++11 compilers will generate a compiler error.</p>
 <pre class="programlisting"> <span class="special">{</span> <span class="comment">// Some local scope.</span>
         <span class="special">...</span>

Modified: sandbox/closure/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_CONFIG_NO_CPP11.html
==============================================================================
--- sandbox/closure/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_CONFIG_NO_CPP11.html (original)
+++ sandbox/closure/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_CONFIG_NO_CPP11.html 2012-01-13 15:06:16 EST (Fri, 13 Jan 2012)
@@ -33,7 +33,7 @@
 
 </span>BOOST_SCOPE_EXIT_CONFIG_NO_CPP11</pre></div>
 <div class="refsect1">
-<a name="id816805"></a><h2>Description</h2>
+<a name="id809160"></a><h2>Description</h2>
 <p>If programmers define this configuration macro, C++11 features will not be used even on C++11 compilers (only C++03 features will be used). By default this macro is not defined.</p>
 <p><span class="bold"><strong>Note:</strong></span> This macro does not disable comma-separated capture lists on compilers that support variadic macros (programmers can simply use Boost.Preprocessor sequences if they do not wish to use comma-separated capture lists).</p>
 <p><span class="bold"><strong>See:</strong></span> <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT.html" title="Macro BOOST_SCOPE_EXIT">BOOST_SCOPE_EXIT</a></code>, <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_ALL.html" title="Macro BOOST_SCOPE_EXIT_ALL">BOOST_SCOPE_EXIT_ALL</a></code>, <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_END.html" title="Macro BOOST_SCOPE_EXIT_END">BOOST_SCOPE_EXIT_END</a></code>. </p>

Modified: sandbox/closure/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_END.html
==============================================================================
--- sandbox/closure/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_END.html (original)
+++ sandbox/closure/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_END.html 2012-01-13 15:06:16 EST (Fri, 13 Jan 2012)
@@ -33,7 +33,7 @@
 
 </span>BOOST_SCOPE_EXIT_END</pre></div>
 <div class="refsect1">
-<a name="id816580"></a><h2>Description</h2>
+<a name="id808934"></a><h2>Description</h2>
 <p>This macro must follow the closing curly bracket <code class="computeroutput">}</code> that ends the scope exit body:</p>
 <pre class="programlisting"> <span class="special">{</span> <span class="comment">// Some local scope.</span>
         <span class="special">...</span>

Modified: sandbox/closure/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_TPL.html
==============================================================================
--- sandbox/closure/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_TPL.html (original)
+++ sandbox/closure/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_TPL.html 2012-01-13 15:06:16 EST (Fri, 13 Jan 2012)
@@ -33,7 +33,7 @@
 
 </span>BOOST_SCOPE_EXIT_TPL(capture_list)</pre></div>
 <div class="refsect1">
-<a name="id814451"></a><h2>Description</h2>
+<a name="id806806"></a><h2>Description</h2>
 <p>Various versions of the GCC compiler do not compile <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT.html" title="Macro BOOST_SCOPE_EXIT">BOOST_SCOPE_EXIT</a></code> inside function templates. As a workaround, <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_TPL.html" title="Macro BOOST_SCOPE_EXIT_TPL">BOOST_SCOPE_EXIT_TPL</a></code> should be used instead of <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT.html" title="Macro BOOST_SCOPE_EXIT">BOOST_SCOPE_EXIT</a></code> in these cases:</p>
 <pre class="programlisting"> <span class="special">{</span> <span class="comment">// Some local scope.</span>
         <span class="special">...</span>

Modified: sandbox/closure/libs/scope_exit/doc/html/index.html
==============================================================================
--- sandbox/closure/libs/scope_exit/doc/html/index.html (original)
+++ sandbox/closure/libs/scope_exit/doc/html/index.html 2012-01-13 15:06:16 EST (Fri, 13 Jan 2012)
@@ -140,7 +140,7 @@
 </div>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
-<td align="left"><p><small>Last revised: January 13, 2012 at 16:41:25 GMT</small></p></td>
+<td align="left"><p><small>Last revised: January 13, 2012 at 20:05:27 GMT</small></p></td>
 <td align="right"><div class="copyright-footer"></div></td>
 </tr></table>
 <hr>

Modified: sandbox/closure/libs/scope_exit/example/Jamfile.v2
==============================================================================
--- sandbox/closure/libs/scope_exit/example/Jamfile.v2 (original)
+++ sandbox/closure/libs/scope_exit/example/Jamfile.v2 2012-01-13 15:06:16 EST (Fri, 13 Jan 2012)
@@ -1,7 +1,7 @@
 
 import testing ;
 
-test-suite boost_scope_exit_examples :
+test-suite examples :
     [ run try_catch.cpp ]
     [ run try_catch_seq.cpp ]
 

Modified: sandbox/closure/libs/scope_exit/test/Jamfile.v2
==============================================================================
--- sandbox/closure/libs/scope_exit/test/Jamfile.v2 (original)
+++ sandbox/closure/libs/scope_exit/test/Jamfile.v2 2012-01-13 15:06:16 EST (Fri, 13 Jan 2012)
@@ -1,24 +1,53 @@
 
 import testing ;
 
-test-suite boost_scope_exit_tests :
- [ run world.cpp /boost//unit_test_framework ]
- [ run world_seq.cpp /boost//unit_test_framework ]
+project : requirements
+ <library>/boost/test//boost_test_exec_monitor
+ <library>/boost//unit_test_framework
+ <link>static
+;
+
+test-suite world_tests :
+ [ run world.cpp ]
+ [ run world_seq.cpp ]
     
- [ run world_commit.cpp /boost//unit_test_framework ]
- [ run world_commit_seq.cpp /boost//unit_test_framework ]
+ [ run world_commit.cpp ]
+ [ run world_commit_seq.cpp ]
     
- [ run world_commit_this.cpp /boost//unit_test_framework ]
- [ run world_commit_this_seq.cpp /boost//unit_test_framework ]
+ [ run world_commit_this.cpp ]
+ [ run world_commit_this_seq.cpp ]
     
- [ run world_commit_void.cpp /boost//unit_test_framework ]
+ [ run world_commit_void.cpp ]
     
- [ run world_all.cpp /boost//unit_test_framework ]
- [ run world_all_seq.cpp /boost//unit_test_framework ]
+ [ run world_all.cpp ]
+ [ run world_all_seq.cpp ]
     
- [ run world_commit_tpl.cpp /boost//unit_test_framework ]
- [ run world_commit_tpl_seq.cpp /boost//unit_test_framework ]
+ [ run world_commit_tpl.cpp ]
+ [ run world_commit_tpl_seq.cpp ]
     
- [ run world_commit_lambda.cpp /boost//unit_test_framework ]
+ [ run world_commit_lambda.cpp ]
+;
+
+test-suite native_tests :
+ [ run native.cpp : : : <define>BOOST_TYPEOF_NATIVE ]
+ [ run native_tpl.cpp : : : <define>BOOST_TYPEOF_NATIVE ]
+ [ compile-fail native_const_error.cpp : <define>BOOST_TYPEOF_NATIVE ]
+ [ compile-fail native_cv_error.cpp : <define>BOOST_TYPEOF_NATIVE ]
+ # Following test is known to fail on MSVC 7.1 and 8.0.
+ [ run native_tu_test.cpp native_tu1.cpp native_tu2.cpp : : :
+ <define>BOOST_TYPEOF_NATIVE ]
+;
+
+test-suite emulation_tests :
+ [ run native.cpp : : : <define>BOOST_TYPEOF_EMULATION : emulation : ]
+ [ run native_tpl.cpp : : : <define>BOOST_TYPEOF_EMULATION :
+ emulation_tpl : ]
+ [ compile-fail native_const_error.cpp : <define>BOOST_TYPEOF_EMULATION :
+ emulation_const_error : ]
+ [ compile-fail native_cv_error.cpp : <define>BOOST_TYPEOF_EMULATION :
+ emulation_cv_error : ]
+ # Following test is known to fail on MSVC 7.1 and 8.0.
+ [ run native_tu_test.cpp native_tu1.cpp native_tu2.cpp : : :
+ <define>BOOST_TYPEOF_EMULATION : emulation_tu_test : ]
 ;
 


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