Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r67078 - in trunk/libs/filesystem: build v2/doc v2/test v3/doc
From: bdawes_at_[hidden]
Date: 2010-12-06 19:57:19


Author: bemandawes
Date: 2010-12-06 19:57:13 EST (Mon, 06 Dec 2010)
New Revision: 67078
URL: http://svn.boost.org/trac/boost/changeset/67078

Log:
Resolve ticket #4585 by accepting bjam options --disable-filesystem2 or --disable-filesystem3. Document same. Also, switch V2 tests to use <boost/detail/lightweight_main.hpp> to improved test reporting.
Text files modified:
   trunk/libs/filesystem/build/Jamfile.v2 | 37 ++++++++++++++++++++++++++++++-------
   trunk/libs/filesystem/v2/doc/index.htm | 7 ++++++-
   trunk/libs/filesystem/v2/test/convenience_test.cpp | 4 +++-
   trunk/libs/filesystem/v2/test/deprecated_test.cpp | 3 ++-
   trunk/libs/filesystem/v2/test/fstream_test.cpp | 3 ++-
   trunk/libs/filesystem/v2/test/operations_test.cpp | 3 ++-
   trunk/libs/filesystem/v2/test/path_test.cpp | 3 ++-
   trunk/libs/filesystem/v2/test/wide_test.cpp | 3 ++-
   trunk/libs/filesystem/v3/doc/index.htm | 7 ++++++-
   9 files changed, 55 insertions(+), 15 deletions(-)

Modified: trunk/libs/filesystem/build/Jamfile.v2
==============================================================================
--- trunk/libs/filesystem/build/Jamfile.v2 (original)
+++ trunk/libs/filesystem/build/Jamfile.v2 2010-12-06 19:57:13 EST (Mon, 06 Dec 2010)
@@ -13,13 +13,36 @@
       <link>shared:<define>BOOST_FILESYSTEM_DYN_LINK=1
     ;
     
-SOURCES =
- v2/src/v2_operations v2/src/v2_path v2/src/v2_portability
- v3/src/operations v3/src/path v3/src/portability v3/src/utf8_codecvt_facet
- v3/src/codecvt_error_category v3/src/path_traits v3/src/unique_path
- v3/src/windows_file_codecvt
- ;
-
+local disable-filesystem2 = [ MATCH (--disable-filesystem2) : [ modules.peek : ARGV ] ] ;
+local disable-filesystem3 = [ MATCH (--disable-filesystem3) : [ modules.peek : ARGV ] ] ;
+
+if ! $(disable-filesystem2)
+{
+ if ! $(disable-filesystem3)
+ {
+ SOURCES =
+ v2/src/v2_operations v2/src/v2_path v2/src/v2_portability
+ v3/src/operations v3/src/path v3/src/portability v3/src/windows_file_codecvt
+ v3/src/codecvt_error_category v3/src/path_traits v3/src/unique_path
+ v3/src/utf8_codecvt_facet
+ ;
+ }
+ else
+ {
+ SOURCES =
+ v2/src/v2_operations v2/src/v2_path v2/src/v2_portability
+ v3/src/utf8_codecvt_facet # used by both v2 and v3
+ ;
+ }
+}
+else
+{
+ SOURCES =
+ v3/src/operations v3/src/path v3/src/portability v3/src/windows_file_codecvt
+ v3/src/codecvt_error_category v3/src/path_traits v3/src/unique_path
+ v3/src/utf8_codecvt_facet
+ ;
+}
 
 lib boost_filesystem
     : $(SOURCES).cpp ../../system/build//boost_system

Modified: trunk/libs/filesystem/v2/doc/index.htm
==============================================================================
--- trunk/libs/filesystem/v2/doc/index.htm (original)
+++ trunk/libs/filesystem/v2/doc/index.htm 2010-12-06 19:57:13 EST (Mon, 06 Dec 2010)
@@ -102,6 +102,11 @@
       convenient. New code should be written for version 3.</p>
       <p align="left">Version 2 is deprecated, and will not be included in Boost
       releases 1.48 and later.</p>
+ <p align="left"><b>Building the library</b></p>
+ <p align="left">By default, the Boost build system creates libraries that
+ support both version 2 and version 3. To support only a single version,
+ include <code>--disable-filesystem2</code> or <code>--disable-filesystem3</code>
+ on the <code>bjam</code> command line.</p>
       </td>
     </tr>
   </table>
@@ -818,7 +823,7 @@
 
 <hr>
 <p>Revised
-<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->03 December, 2010<!--webbot bot="Timestamp" endspan i-checksum="38634" --></p>
+<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->06 December, 2010<!--webbot bot="Timestamp" endspan i-checksum="38640" --></p>
 
 <p>&copy; Copyright Beman Dawes, 2002-2005</p>
 <p> Use, modification, and distribution are subject to the Boost Software

Modified: trunk/libs/filesystem/v2/test/convenience_test.cpp
==============================================================================
--- trunk/libs/filesystem/v2/test/convenience_test.cpp (original)
+++ trunk/libs/filesystem/v2/test/convenience_test.cpp 2010-12-06 19:57:13 EST (Mon, 06 Dec 2010)
@@ -26,6 +26,8 @@
 namespace sys = boost::system;
 
 #include <boost/detail/lightweight_test.hpp>
+#include <boost/detail/lightweight_main.hpp>
+
 #include <boost/bind.hpp>
 #include <fstream>
 #include <iostream>
@@ -60,7 +62,7 @@
 
 // --------------------------------------------------------------------------//
 
-int main( int, char*[] )
+int cpp_main( int, char*[] )
 {
 
 // create_directories() tests ----------------------------------------------//

Modified: trunk/libs/filesystem/v2/test/deprecated_test.cpp
==============================================================================
--- trunk/libs/filesystem/v2/test/deprecated_test.cpp (original)
+++ trunk/libs/filesystem/v2/test/deprecated_test.cpp 2010-12-06 19:57:13 EST (Mon, 06 Dec 2010)
@@ -16,6 +16,7 @@
 
 #include <boost/filesystem.hpp>
 #include <boost/detail/lightweight_test.hpp>
+#include <boost/detail/lightweight_main.hpp>
 
 namespace fs = boost::filesystem;
 using boost::filesystem::path;
@@ -147,7 +148,7 @@
 
 //----------------------------------------------------------------------------//
 
-int main( int /*argc*/, char * /*argv*/[] )
+int cpp_main( int /*argc*/, char * /*argv*/[] )
 {
   // The choice of platform is make at runtime rather than compile-time
   // so that compile errors for all platforms will be detected even though

Modified: trunk/libs/filesystem/v2/test/fstream_test.cpp
==============================================================================
--- trunk/libs/filesystem/v2/test/fstream_test.cpp (original)
+++ trunk/libs/filesystem/v2/test/fstream_test.cpp 2010-12-06 19:57:13 EST (Mon, 06 Dec 2010)
@@ -39,6 +39,7 @@
 #endif
 
 #include <boost/detail/lightweight_test.hpp>
+#include <boost/detail/lightweight_main.hpp>
 
 namespace
 {
@@ -150,7 +151,7 @@
   } // test
 } // unnamed namespace
 
-int main( int argc, char*[] )
+int cpp_main( int argc, char*[] )
 {
   if ( argc > 1 ) cleanup = false;
 

Modified: trunk/libs/filesystem/v2/test/operations_test.cpp
==============================================================================
--- trunk/libs/filesystem/v2/test/operations_test.cpp (original)
+++ trunk/libs/filesystem/v2/test/operations_test.cpp 2010-12-06 19:57:13 EST (Mon, 06 Dec 2010)
@@ -26,6 +26,7 @@
 
 #include <boost/config.hpp>
 #include <boost/detail/lightweight_test.hpp>
+#include <boost/detail/lightweight_main.hpp>
 
 using boost::system::error_code;
 using boost::system::system_category;
@@ -266,7 +267,7 @@
 
 // main ------------------------------------------------------------------------------//
 
-int main( int argc, char * argv[] )
+int cpp_main( int argc, char * argv[] )
 {
   if ( argc > 1 && *argv[1]=='-' && *(argv[1]+1)=='t' ) report_throws = true;
 

Modified: trunk/libs/filesystem/v2/test/path_test.cpp
==============================================================================
--- trunk/libs/filesystem/v2/test/path_test.cpp (original)
+++ trunk/libs/filesystem/v2/test/path_test.cpp 2010-12-06 19:57:13 EST (Mon, 06 Dec 2010)
@@ -37,6 +37,7 @@
 
 
 #include <boost/detail/lightweight_test.hpp>
+#include <boost/detail/lightweight_main.hpp>
 
 #define PATH_CHECK( a, b ) check( a, b, __LINE__ )
 #define DIR_CHECK( a, b ) check_dir( a, b, __LINE__ )
@@ -196,7 +197,7 @@
 
 } // unnamed namespace
 
-int main( int, char*[] )
+int cpp_main( int, char* [] )
 {
   // The choice of platform is make at runtime rather than compile-time
   // so that compile errors for all platforms will be detected even though

Modified: trunk/libs/filesystem/v2/test/wide_test.cpp
==============================================================================
--- trunk/libs/filesystem/v2/test/wide_test.cpp (original)
+++ trunk/libs/filesystem/v2/test/wide_test.cpp 2010-12-06 19:57:13 EST (Mon, 06 Dec 2010)
@@ -29,6 +29,7 @@
 #include <boost/filesystem/fstream.hpp>
 #include <boost/scoped_array.hpp>
 #include <boost/detail/lightweight_test.hpp>
+#include <boost/detail/lightweight_main.hpp>
 
 #include <boost/filesystem/detail/utf8_codecvt_facet.hpp>
 
@@ -127,7 +128,7 @@
 
 // main ------------------------------------------------------------------------------//
 
-int main( int argc, char * /*argv*/[] )
+int cpp_main( int argc, char * /*argv*/[] )
 {
 
   if ( argc > 1 ) cleanup = false;

Modified: trunk/libs/filesystem/v3/doc/index.htm
==============================================================================
--- trunk/libs/filesystem/v3/doc/index.htm (original)
+++ trunk/libs/filesystem/v3/doc/index.htm 2010-12-06 19:57:13 EST (Mon, 06 Dec 2010)
@@ -96,6 +96,11 @@
       convenient. New code should be written for Version 3.</p>
       <p align="left">Version 2 is deprecated, and will not be included in Boost
       releases 1.48 and later.</p>
+ <p align="left"><b>Building the library</b></p>
+ <p align="left">By default, the Boost build system creates libraries that
+ support both version 2 and version 3. To support only a single version,
+ include <code>--disable-filesystem2</code> or <code>--disable-filesystem3</code>
+ on the <code>bjam</code> command line.</p>
       </td>
     </tr>
   </table>
@@ -478,7 +483,7 @@
 
 <hr>
 <p>Revised
-<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->03 December, 2010<!--webbot bot="Timestamp" endspan i-checksum="38634" --></p>
+<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->06 December, 2010<!--webbot bot="Timestamp" endspan i-checksum="38640" --></p>
 
 <p>&copy; Copyright Beman Dawes, 2002-2005</p>
 <p> Use, modification, and distribution are subject to the Boost Software


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