Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r77452 - in branches/filesystem-v3/libs/filesystem: src test
From: bdawes_at_[hidden]
Date: 2012-03-21 09:03:30


Author: bemandawes
Date: 2012-03-21 09:03:27 EDT (Wed, 21 Mar 2012)
New Revision: 77452
URL: http://svn.boost.org/trac/boost/changeset/77452

Log:
Centralize BOOST_NO_STD_WSTRING error reporting in path.cpp, remove code that allowed V3 code to be skipped in V2 only builds, remove BOOST_FILESYSTEM_VERSION defines from test programs.
Text files modified:
   branches/filesystem-v3/libs/filesystem/src/codecvt_error_category.cpp | 9 ---------
   branches/filesystem-v3/libs/filesystem/src/operations.cpp | 10 ----------
   branches/filesystem-v3/libs/filesystem/src/path.cpp | 12 +++++-------
   branches/filesystem-v3/libs/filesystem/src/path_traits.cpp | 9 ---------
   branches/filesystem-v3/libs/filesystem/src/portability.cpp | 9 ---------
   branches/filesystem-v3/libs/filesystem/src/unique_path.cpp | 11 +----------
   branches/filesystem-v3/libs/filesystem/src/windows_file_codecvt.cpp | 8 --------
   branches/filesystem-v3/libs/filesystem/test/convenience_test.cpp | 20 +++++++++-----------
   branches/filesystem-v3/libs/filesystem/test/deprecated_test.cpp | 8 +++-----
   branches/filesystem-v3/libs/filesystem/test/fstream_test.cpp | 14 ++++++--------
   branches/filesystem-v3/libs/filesystem/test/large_file_support_test.cpp | 11 ++++-------
   branches/filesystem-v3/libs/filesystem/test/long_path_test.cpp | 2 --
   branches/filesystem-v3/libs/filesystem/test/operations_test.cpp | 17 +++++++----------
   branches/filesystem-v3/libs/filesystem/test/operations_unit_test.cpp | 13 ++++++-------
   branches/filesystem-v3/libs/filesystem/test/path_test.cpp | 19 ++++++++-----------
   branches/filesystem-v3/libs/filesystem/test/path_unit_test.cpp | 9 +--------
   16 files changed, 50 insertions(+), 131 deletions(-)

Modified: branches/filesystem-v3/libs/filesystem/src/codecvt_error_category.cpp
==============================================================================
--- branches/filesystem-v3/libs/filesystem/src/codecvt_error_category.cpp (original)
+++ branches/filesystem-v3/libs/filesystem/src/codecvt_error_category.cpp 2012-03-21 09:03:27 EDT (Wed, 21 Mar 2012)
@@ -9,13 +9,6 @@
 
 //--------------------------------------------------------------------------------------//
 
-#include <boost/config.hpp>
-#if !defined( BOOST_NO_STD_WSTRING )
-// Boost.Filesystem V3 and later requires std::wstring support.
-// During the transition to V3, libraries are compiled with both V2 and V3 sources.
-// On old compilers that don't support V3 anyhow, we just skip everything so the compile
-// will succeed and the library can be built.
-
 #include <boost/config/warning_disable.hpp>
 
 // define BOOST_FILESYSTEM_SOURCE so that <boost/filesystem/config.hpp> knows
@@ -89,5 +82,3 @@
 
   } // namespace filesystem3
 } // namespace boost
-
-#endif // no wide character support

Modified: branches/filesystem-v3/libs/filesystem/src/operations.cpp
==============================================================================
--- branches/filesystem-v3/libs/filesystem/src/operations.cpp (original)
+++ branches/filesystem-v3/libs/filesystem/src/operations.cpp 2012-03-21 09:03:27 EDT (Wed, 21 Mar 2012)
@@ -29,16 +29,8 @@
 #define _FILE_OFFSET_BITS 64
 #endif
 
-#include <boost/config.hpp>
-#if !defined( BOOST_NO_STD_WSTRING )
-// Boost.Filesystem V3 and later requires std::wstring support.
-// During the transition to V3, libraries are compiled with both V2 and V3 sources.
-// On old compilers that don't support V3 anyhow, we just skip everything so the compile
-// will succeed and the library can be built.
-
 // define BOOST_FILESYSTEM_SOURCE so that <boost/filesystem/config.hpp> knows
 // the library is being built (possibly exporting rather than importing code)
-
 #define BOOST_FILESYSTEM_SOURCE
 
 #ifndef BOOST_SYSTEM_NO_DEPRECATED
@@ -2205,5 +2197,3 @@
 } // namespace detail
 } // namespace filesystem3
 } // namespace boost
-
-#endif // no wide character support

Modified: branches/filesystem-v3/libs/filesystem/src/path.cpp
==============================================================================
--- branches/filesystem-v3/libs/filesystem/src/path.cpp (original)
+++ branches/filesystem-v3/libs/filesystem/src/path.cpp 2012-03-21 09:03:27 EDT (Wed, 21 Mar 2012)
@@ -7,12 +7,12 @@
 
 // Library home page: http://www.boost.org/libs/filesystem
 
+// Old standard library configurations, particularly MingGW, don't support wide strings.
+// Report this with an explicit error message.
 #include <boost/config.hpp>
-#if !defined( BOOST_NO_STD_WSTRING )
-// Boost.Filesystem V3 and later requires std::wstring support.
-// During the transition to V3, libraries are compiled with both V2 and V3 sources.
-// On old compilers that don't support V3 anyhow, we just skip everything so the compile
-// will succeed and the library can be built.
+# if defined( BOOST_NO_STD_WSTRING )
+# error Configuration not supported: Boost.Filesystem V3 and later requires std::wstring support
+# endif
 
 // define BOOST_FILESYSTEM_SOURCE so that <boost/system/config.hpp> knows
 // the library is being built (possibly exporting rather than importing code)
@@ -839,5 +839,3 @@
 
 } // namespace filesystem3
 } // namespace boost
-
-#endif // has wide character support

Modified: branches/filesystem-v3/libs/filesystem/src/path_traits.cpp
==============================================================================
--- branches/filesystem-v3/libs/filesystem/src/path_traits.cpp (original)
+++ branches/filesystem-v3/libs/filesystem/src/path_traits.cpp 2012-03-21 09:03:27 EDT (Wed, 21 Mar 2012)
@@ -9,13 +9,6 @@
 
 //--------------------------------------------------------------------------------------//
 
-#include <boost/config.hpp>
-#if !defined( BOOST_NO_STD_WSTRING )
-// Boost.Filesystem V3 and later requires std::wstring support.
-// During the transition to V3, libraries are compiled with both V2 and V3 sources.
-// On old compilers that don't support V3 anyhow, we just skip everything so the compile
-// will succeed and the library can be built.
-
 // define BOOST_FILESYSTEM_SOURCE so that <boost/system/config.hpp> knows
 // the library is being built (possibly exporting rather than importing code)
 #define BOOST_FILESYSTEM_SOURCE
@@ -205,5 +198,3 @@
     }
   }
 }}} // namespace boost::filesystem3::path_traits
-
-#endif // no wide character support

Modified: branches/filesystem-v3/libs/filesystem/src/portability.cpp
==============================================================================
--- branches/filesystem-v3/libs/filesystem/src/portability.cpp (original)
+++ branches/filesystem-v3/libs/filesystem/src/portability.cpp 2012-03-21 09:03:27 EDT (Wed, 21 Mar 2012)
@@ -9,13 +9,6 @@
 
 //--------------------------------------------------------------------------------------//
 
-#include <boost/config.hpp>
-#if !defined( BOOST_NO_STD_WSTRING )
-// Boost.Filesystem V3 and later requires std::wstring support.
-// During the transition to V3, libraries are compiled with both V2 and V3 sources.
-// On old compilers that don't support V3 anyhow, we just skip everything so the compile
-// will succeed and the library can be built.
-
 // define BOOST_FILESYSTEM_SOURCE so that <boost/filesystem/config.hpp> knows
 // the library is being built (possibly exporting rather than importing code)
 #define BOOST_FILESYSTEM_SOURCE
@@ -124,5 +117,3 @@
 
   } // namespace filesystem3
 } // namespace boost
-
-#endif // no wide character support

Modified: branches/filesystem-v3/libs/filesystem/src/unique_path.cpp
==============================================================================
--- branches/filesystem-v3/libs/filesystem/src/unique_path.cpp (original)
+++ branches/filesystem-v3/libs/filesystem/src/unique_path.cpp 2012-03-21 09:03:27 EDT (Wed, 21 Mar 2012)
@@ -1,4 +1,4 @@
-// filesystem system_crypt_random.cpp ------------------------------------------------//
+// filesystem unique_path.cpp --------------------------------------------------------//
 
 // Copyright Beman Dawes 2010
 
@@ -9,13 +9,6 @@
 
 //--------------------------------------------------------------------------------------//
 
-#include <boost/config.hpp>
-#if !defined( BOOST_NO_STD_WSTRING )
-// Boost.Filesystem V3 and later requires std::wstring support.
-// During the transition to V3, libraries are compiled with both V2 and V3 sources.
-// On old compilers that don't support V3 anyhow, we just skip everything so the compile
-// will succeed and the library can be built.
-
 // define BOOST_FILESYSTEM_SOURCE so that <boost/filesystem/config.hpp> knows
 // the library is being built (possibly exporting rather than importing code)
 #define BOOST_FILESYSTEM_SOURCE
@@ -147,5 +140,3 @@
 }
 
 }}}
-
-#endif // no wide character support

Modified: branches/filesystem-v3/libs/filesystem/src/windows_file_codecvt.cpp
==============================================================================
--- branches/filesystem-v3/libs/filesystem/src/windows_file_codecvt.cpp (original)
+++ branches/filesystem-v3/libs/filesystem/src/windows_file_codecvt.cpp 2012-03-21 09:03:27 EDT (Wed, 21 Mar 2012)
@@ -9,13 +9,6 @@
 
 //--------------------------------------------------------------------------------------//
 
-#include <boost/config.hpp>
-#if !defined( BOOST_NO_STD_WSTRING )
-// Boost.Filesystem V3 and later requires std::wstring support.
-// During the transition to V3, libraries are compiled with both V2 and V3 sources.
-// On old compilers that don't support V3 anyhow, we just skip everything so the compile
-// will succeed and the library can be built.
-
 // define BOOST_FILESYSTEM_SOURCE so that <boost/system/config.hpp> knows
 // the library is being built (possibly exporting rather than importing code)
 #define BOOST_FILESYSTEM_SOURCE
@@ -80,4 +73,3 @@
 
   # endif // BOOST_WINDOWS_API
 
-#endif // no wide character support

Modified: branches/filesystem-v3/libs/filesystem/test/convenience_test.cpp
==============================================================================
--- branches/filesystem-v3/libs/filesystem/test/convenience_test.cpp (original)
+++ branches/filesystem-v3/libs/filesystem/test/convenience_test.cpp 2012-03-21 09:03:27 EDT (Wed, 21 Mar 2012)
@@ -8,14 +8,6 @@
 
 // See library home page at http://www.boost.org/libs/filesystem
 
-#define BOOST_FILESYSTEM_VERSION 3
-
-#include <boost/config.hpp>
-
-# if defined( BOOST_NO_STD_WSTRING )
-# error Configuration not supported: Boost.Filesystem V3 and later requires std::wstring support
-# endif
-
 #include <boost/config/warning_disable.hpp>
 
 // See deprecated_test for tests of deprecated features
@@ -27,9 +19,11 @@
 #endif
 
 #include <boost/filesystem/convenience.hpp>
-namespace fs = boost::filesystem;
-using fs::path;
-namespace sys = boost::system;
+
+#include <boost/config.hpp>
+# if defined( BOOST_NO_STD_WSTRING )
+# error Configuration not supported: Boost.Filesystem V3 and later requires std::wstring support
+# endif
 
 #include <boost/detail/lightweight_test.hpp>
 #include <boost/detail/lightweight_main.hpp>
@@ -37,6 +31,10 @@
 #include <fstream>
 #include <iostream>
 
+namespace fs = boost::filesystem;
+using fs::path;
+namespace sys = boost::system;
+
 namespace
 {
   template< typename F >

Modified: branches/filesystem-v3/libs/filesystem/test/deprecated_test.cpp
==============================================================================
--- branches/filesystem-v3/libs/filesystem/test/deprecated_test.cpp (original)
+++ branches/filesystem-v3/libs/filesystem/test/deprecated_test.cpp 2012-03-21 09:03:27 EDT (Wed, 21 Mar 2012)
@@ -11,17 +11,15 @@
 // This test verifies that various deprecated names still work. This is
 // important to preserve existing code that uses the old names.
 
-#define BOOST_FILESYSTEM_VERSION 3
+#define BOOST_FILESYSTEM_DEPRECATED
 
-#include <boost/config.hpp>
+#include <boost/filesystem.hpp>
 
+#include <boost/config.hpp>
 # if defined( BOOST_NO_STD_WSTRING )
 # error Configuration not supported: Boost.Filesystem V3 and later requires std::wstring support
 # endif
 
-#define BOOST_FILESYSTEM_DEPRECATED
-
-#include <boost/filesystem.hpp>
 #include <boost/detail/lightweight_test.hpp>
 #include <boost/detail/lightweight_main.hpp>
 

Modified: branches/filesystem-v3/libs/filesystem/test/fstream_test.cpp
==============================================================================
--- branches/filesystem-v3/libs/filesystem/test/fstream_test.cpp (original)
+++ branches/filesystem-v3/libs/filesystem/test/fstream_test.cpp 2012-03-21 09:03:27 EDT (Wed, 21 Mar 2012)
@@ -7,14 +7,6 @@
 
 // Library home page: http://www.boost.org/libs/filesystem
 
-#define BOOST_FILESYSTEM_VERSION 3
-
-#include <boost/config.hpp>
-
-# if defined( BOOST_NO_STD_WSTRING )
-# error Configuration not supported: Boost.Filesystem V3 and later requires std::wstring support
-# endif
-
 #include <boost/config/warning_disable.hpp>
 
 // See deprecated_test for tests of deprecated features
@@ -26,6 +18,12 @@
 #endif
 
 #include <boost/filesystem/fstream.hpp>
+
+#include <boost/config.hpp>
+# if defined( BOOST_NO_STD_WSTRING )
+# error Configuration not supported: Boost.Filesystem V3 and later requires std::wstring support
+# endif
+
 #include <boost/filesystem/operations.hpp>
 #include <string>
 #include <iostream>

Modified: branches/filesystem-v3/libs/filesystem/test/large_file_support_test.cpp
==============================================================================
--- branches/filesystem-v3/libs/filesystem/test/large_file_support_test.cpp (original)
+++ branches/filesystem-v3/libs/filesystem/test/large_file_support_test.cpp 2012-03-21 09:03:27 EDT (Wed, 21 Mar 2012)
@@ -7,20 +7,17 @@
 
 // See library home page at http://www.boost.org/libs/filesystem
 
+// See deprecated_test for tests of deprecated features
+#define BOOST_FILESYSTEM_NO_DEPRECATED
+#define BOOST_SYSTEM_NO_DEPRECATED
 
-#define BOOST_FILESYSTEM_VERSION 3
+#include <boost/filesystem/operations.hpp>
 
 #include <boost/config.hpp>
-
 # if defined( BOOST_NO_STD_WSTRING )
 # error Configuration not supported: Boost.Filesystem V3 and later requires std::wstring support
 # endif
 
-// See deprecated_test for tests of deprecated features
-#define BOOST_FILESYSTEM_NO_DEPRECATED
-#define BOOST_SYSTEM_NO_DEPRECATED
-
-#include <boost/filesystem/operations.hpp>
 namespace fs = boost::filesystem;
 
 #include <iostream>

Modified: branches/filesystem-v3/libs/filesystem/test/long_path_test.cpp
==============================================================================
--- branches/filesystem-v3/libs/filesystem/test/long_path_test.cpp (original)
+++ branches/filesystem-v3/libs/filesystem/test/long_path_test.cpp 2012-03-21 09:03:27 EDT (Wed, 21 Mar 2012)
@@ -9,8 +9,6 @@
 
 // See http://msdn.microsoft.com/en-us/library/aa365247%28v=vs.85%29.aspx
 
-#define BOOST_FILESYSTEM_VERSION 3
-
 #include <boost/config/warning_disable.hpp>
 
 #include <boost/filesystem.hpp>

Modified: branches/filesystem-v3/libs/filesystem/test/operations_test.cpp
==============================================================================
--- branches/filesystem-v3/libs/filesystem/test/operations_test.cpp (original)
+++ branches/filesystem-v3/libs/filesystem/test/operations_test.cpp 2012-03-21 09:03:27 EDT (Wed, 21 Mar 2012)
@@ -7,14 +7,6 @@
 
 // Library home page: http://www.boost.org/libs/filesystem
 
-#define BOOST_FILESYSTEM_VERSION 3
-
-#include <boost/config.hpp>
-
-# if defined( BOOST_NO_STD_WSTRING )
-# error Configuration not supported: Boost.Filesystem V3 and later requires std::wstring support
-# endif
-
 #include <boost/config/warning_disable.hpp>
 
 // See deprecated_test for tests of deprecated features
@@ -26,12 +18,17 @@
 #endif
 
 #include <boost/filesystem/operations.hpp>
-#include <boost/cerrno.hpp>
-namespace fs = boost::filesystem;
 
+#include <boost/config.hpp>
+# if defined( BOOST_NO_STD_WSTRING )
+# error Configuration not supported: Boost.Filesystem V3 and later requires std::wstring support
+# endif
+
+#include <boost/cerrno.hpp>
 #include <boost/detail/lightweight_test.hpp>
 #include <boost/detail/lightweight_main.hpp>
 
+namespace fs = boost::filesystem;
 using boost::system::error_code;
 using boost::system::system_category;
 using boost::system::system_error;

Modified: branches/filesystem-v3/libs/filesystem/test/operations_unit_test.cpp
==============================================================================
--- branches/filesystem-v3/libs/filesystem/test/operations_unit_test.cpp (original)
+++ branches/filesystem-v3/libs/filesystem/test/operations_unit_test.cpp 2012-03-21 09:03:27 EDT (Wed, 21 Mar 2012)
@@ -13,13 +13,6 @@
 
 // ------------------------------------------------------------------------------------//
 
-#define BOOST_FILESYSTEM_VERSION 3
-
-#include <boost/config.hpp>
-
-# if defined( BOOST_NO_STD_WSTRING )
-# error Configuration not supported: Boost.Filesystem V3 and later requires std::wstring support
-# endif
 
 #include <boost/config/warning_disable.hpp>
 
@@ -32,6 +25,12 @@
 #endif
 
 #include <boost/filesystem.hpp> // make sure filesystem.hpp works
+
+#include <boost/config.hpp>
+# if defined( BOOST_NO_STD_WSTRING )
+# error Configuration not supported: Boost.Filesystem V3 and later requires std::wstring support
+# endif
+
 #include <boost/system/error_code.hpp>
 #include <boost/detail/lightweight_test.hpp>
 #include <boost/detail/lightweight_main.hpp>

Modified: branches/filesystem-v3/libs/filesystem/test/path_test.cpp
==============================================================================
--- branches/filesystem-v3/libs/filesystem/test/path_test.cpp (original)
+++ branches/filesystem-v3/libs/filesystem/test/path_test.cpp 2012-03-21 09:03:27 EDT (Wed, 21 Mar 2012)
@@ -39,14 +39,6 @@
 // //
 //--------------------------------------------------------------------------------------//
 
-#define BOOST_FILESYSTEM_VERSION 3
-
-#include <boost/config.hpp>
-
-# if defined( BOOST_NO_STD_WSTRING )
-# error Configuration not supported: Boost.Filesystem V3 and later requires std::wstring support
-# endif
-
 #include <boost/config/warning_disable.hpp>
 
 // See deprecated_test for tests of deprecated features
@@ -58,6 +50,12 @@
 #endif
 
 #include <boost/filesystem/operations.hpp>
+
+#include <boost/config.hpp>
+# if defined( BOOST_NO_STD_WSTRING )
+# error Configuration not supported: Boost.Filesystem V3 and later requires std::wstring support
+# endif
+
 #include <boost/utility.hpp>
 #include <iostream>
 #include <sstream>
@@ -65,13 +63,12 @@
 #include <vector>
 #include <cstring>
 #include <cassert>
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/detail/lightweight_main.hpp>
 
 namespace fs = boost::filesystem;
 using boost::filesystem::path;
 
-#include <boost/detail/lightweight_test.hpp>
-#include <boost/detail/lightweight_main.hpp>
-
 #ifdef BOOST_WINDOWS_API
 # define BOOST_DIR_SEP "\\"
 #else

Modified: branches/filesystem-v3/libs/filesystem/test/path_unit_test.cpp
==============================================================================
--- branches/filesystem-v3/libs/filesystem/test/path_unit_test.cpp (original)
+++ branches/filesystem-v3/libs/filesystem/test/path_unit_test.cpp 2012-03-21 09:03:27 EDT (Wed, 21 Mar 2012)
@@ -19,14 +19,6 @@
 //
 // ---------------------------------------------------------------------------------- //
 
-#define BOOST_FILESYSTEM_VERSION 3
-
-#include <boost/config.hpp>
-
-# if defined( BOOST_NO_STD_WSTRING )
-# error Configuration not supported: Boost.Filesystem V3 and later requires std::wstring support
-# endif
-
 #include <boost/config/warning_disable.hpp>
 
 // See deprecated_test for tests of deprecated features
@@ -38,6 +30,7 @@
 #endif
 
 #include <boost/filesystem/path.hpp>
+
 #include <boost/filesystem/detail/utf8_codecvt_facet.hpp> // for imbue tests
 #include "test_codecvt.hpp" // for codecvt arg tests
 #include <boost/detail/lightweight_test.hpp>


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