Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58357 - in sandbox/filesystem-v3: . libs/filesystem/src libs/filesystem/test
From: bdawes_at_[hidden]
Date: 2009-12-13 12:17:52


Author: bemandawes
Date: 2009-12-13 12:17:51 EST (Sun, 13 Dec 2009)
New Revision: 58357
URL: http://svn.boost.org/trac/boost/changeset/58357

Log:
Add distro changes and bug fixes from Linux tests
Added:
   sandbox/filesystem-v3/install_distro.sh (contents, props changed)
Text files modified:
   sandbox/filesystem-v3/create_distro.bat | 28 ++++++++++++++++++++++------
   sandbox/filesystem-v3/install_distro.bat | 4 ++--
   sandbox/filesystem-v3/libs/filesystem/src/operations.cpp | 4 ++--
   sandbox/filesystem-v3/libs/filesystem/test/path_unit_test.cpp | 40 +++++++++++++++++-----------------------
   4 files changed, 43 insertions(+), 33 deletions(-)

Modified: sandbox/filesystem-v3/create_distro.bat
==============================================================================
--- sandbox/filesystem-v3/create_distro.bat (original)
+++ sandbox/filesystem-v3/create_distro.bat 2009-12-13 12:17:51 EST (Sun, 13 Dec 2009)
@@ -8,24 +8,40 @@
 echo Create Boost Filesystem Version 3 distribution for Windows
 if {%1}=={} goto usage
 
-echo Prepare temporary directory %TEMP%\%1...
 pushd %TEMP%
+echo Prepare temporary directory %TEMP%\%1 for Windows distro...
 rmdir /S /Q %1 2>nul
 del %1.zip 2>nul
 
-echo Exporte https://svn.boost.org/svn/boost/sandbox/filesystem-v3 to %TEMP%\%1...
-svn export --non-interactive --trust-server-cert --native-eol CRLF ^
+echo Export https://svn.boost.org/svn/boost/sandbox/filesystem-v3 to %TEMP%\%1...
+svn export --quiet --non-interactive --trust-server-cert --native-eol CRLF ^
  https://svn.boost.org/svn/boost/sandbox/filesystem-v3 %1
 
-echo Creating %TEMP%\%1.zip...
+echo Create %TEMP%\%1.zip...
 zip -r -q %1.zip %1
 
+echo Prepare temporary directory %TEMP%\%1 for POSIX distro...
+rmdir /S /Q %1 2>nul
+del %1.tmp 2>nul
+del %1.tar.gz 2>nul
+del %1.tar.bz2 2>nul
+
+echo Export https://svn.boost.org/svn/boost/sandbox/filesystem-v3 to %TEMP%\%1...
+svn export --quiet --non-interactive --trust-server-cert --native-eol LF ^
+ https://svn.boost.org/svn/boost/sandbox/filesystem-v3 %1
+
+echo Create %TEMP%\%1.tar.gz...
+tar cfz %1.tar.gz %1
+echo Create %TEMP%\%1.tar.bz2...
+gzip -d -c %1.tar.gz >%1.tmp
+bzip2 <%1.tmp >%1.tar.bz2
+
 echo Finish up...
 popd
-dir %TEMP%\%1.zip
+dir %TEMP%\%1.*
 goto done
 
 :usage
 echo Usage: create_distro distro-name
-echo Will create %TEMP%\distro-name.zip
+echo Will create distro-name.zip, distro-name.tar.gz, distro-name.tar.bz2 in temp
 :done

Modified: sandbox/filesystem-v3/install_distro.bat
==============================================================================
--- sandbox/filesystem-v3/install_distro.bat (original)
+++ sandbox/filesystem-v3/install_distro.bat 2009-12-13 12:17:51 EST (Sun, 13 Dec 2009)
@@ -26,7 +26,7 @@
 )
 
 pushd %2
-echo Delete prior version of Filesystem...
+echo Delete prior version of Filesystem library...
 del boost\filesystem.hpp
 rmdir /S /Q boost\filesystem
 rmdir /S /Q libs\filesystem
@@ -38,7 +38,7 @@
 )
 
 echo Copy files from %1 to %2...
-xcopy /s /q C:\temp\filesystem-v3-alpha-0.1\* .
+xcopy /s /q %1\* .
 
 echo Build libraries...
 time /t

Added: sandbox/filesystem-v3/install_distro.sh
==============================================================================
--- (empty file)
+++ sandbox/filesystem-v3/install_distro.sh 2009-12-13 12:17:51 EST (Sun, 13 Dec 2009)
@@ -0,0 +1,73 @@
+#!/usr/bin/env bash
+
+# Install Boost Filesystem Version 3 distribution for POSIX
+# © Copyright 2008 Beman Dawes
+# Distributed under the Boost Software License, Version 1.0.
+# See http://www.boost.org/LICENSE_1_0.txt
+
+echo "Install Boost Filesystem Version 3 distribution for POSIX"
+if [ $# -lt 1 ]
+then
+ echo "Usage: $0 distro-path boost-path"
+ echo "Installs the Filesystem V3 distribution file found at distro-path"
+ echo "in the Boost root found at boost-path"
+ exit 1
+fi
+
+if [ ! -e "$1" ]
+then
+ echo "error: $1 not found"
+ exit 1
+fi
+
+if [ ! -e "$2" ]
+then
+ echo "error: $2 not found"
+ exit 1
+fi
+
+if [ ! -e "$2/boost-build.jam" ]
+then
+ echo "error: $2 does not contain boost-build.jam"
+ echo "Is it really a Boost root directory?"
+ exit 1
+fi
+
+pushd $2
+echo "Deleting prior version of filesystem library..."
+rm boost/filesystem.hpp
+rm -r boost/filesystem
+rm -r libs/filesystem
+
+if [ ! -e "bjam" ]
+then
+ echo "Running bootstrap script..."
+ ./bootstrap.sh &>bootstrap.log
+ echo "bootstrap complete - see $2/boostrap.log for details"
+fi
+
+popd
+echo "Copying files from $1 to $2..."
+cp -r $1/* $2
+pushd $2
+
+echo "Building libraries..."
+date '+%T'
+echo "If other libraries have not been previously built, this step may take a"
+echo "long time - 10 minutes on a fast machine, much longer on a slow machine."
+./bjam &>bjam.log
+date '+%T'
+echo "Library build complete - see $2/bjam.log for details."
+echo "Libraries have been installed in $2/stage"
+
+echo "Testing Filesystem Version 3..."
+pushd libs/filesystem/test
+date '+%T'
+../../../bjam &>bjam.log
+date '+%T'
+popd
+grep "...failed" libs/filesystem/test/bjam.log
+echo "Testing complete - see $2/libs/filesystem/test/bjam.log for details."
+
+echo "Installation complete."
+popd

Modified: sandbox/filesystem-v3/libs/filesystem/src/operations.cpp
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/src/operations.cpp (original)
+++ sandbox/filesystem-v3/libs/filesystem/src/operations.cpp 2009-12-13 12:17:51 EST (Sun, 13 Dec 2009)
@@ -972,11 +972,11 @@
     struct stat path_stat;
     if (error(::stat(p.c_str(), &path_stat)!= 0,
         p, ec, "boost::filesystem::file_size"))
- return 0;
+ return static_cast<boost::uintmax_t>(-1);
    if (error(!S_ISREG(path_stat.st_mode),
       error_code(EPERM, system_category),
         p, ec, "boost::filesystem::file_size"))
- return 0;
+ return static_cast<boost::uintmax_t>(-1);
 
     return static_cast<boost::uintmax_t>(path_stat.st_size);
 # endif

Modified: sandbox/filesystem-v3/libs/filesystem/test/path_unit_test.cpp
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/test/path_unit_test.cpp (original)
+++ sandbox/filesystem-v3/libs/filesystem/test/path_unit_test.cpp 2009-12-13 12:17:51 EST (Sun, 13 Dec 2009)
@@ -632,53 +632,47 @@
     std::cout << " imbuing error locale ..." << std::endl;
     std::locale old_loc = path::imbue(loc);
 
-# ifdef BOOST_WINDOWS_PATH
-# define STRING_FOO_
-# else
-# define STRING_FOO_ L
-# endif
+ // These tests rely on a path constructor that fails in the locale conversion.
+ // Thus construction has to call codecvt. Force that by using a narrow string
+ // for Windows, and a wide string for POSIX.
+# ifdef BOOST_WINDOWS_PATH
+# define STRING_FOO_ "foo"
+# else
+# define STRING_FOO_ L"foo"
+# endif
 
     {
       bool exception_thrown (false);
- try { path(STRING_FOO_"foo"); }
+ try { path(STRING_FOO_); }
       catch (const bs::system_error & ex)
       {
         exception_thrown = true;
- BOOST_TEST_EQ(ex.code(), bs::error_code(std::codecvt_base::partial, fs::codecvt_error_category()));
- }
- catch (...)
- {
- std::cout << "exception thrown, but of an unexpected type" << std::endl;
+ BOOST_TEST_EQ(ex.code(), bs::error_code(std::codecvt_base::partial,
+ fs::codecvt_error_category()));
       }
       BOOST_TEST(exception_thrown);
     }
 
     {
       bool exception_thrown (false);
- try { path(STRING_FOO_"foo"); }
+ try { path(STRING_FOO_); }
       catch (const bs::system_error & ex)
       {
         exception_thrown = true;
- BOOST_TEST_EQ(ex.code(), bs::error_code(std::codecvt_base::error, fs::codecvt_error_category()));
- }
- catch (...)
- {
- std::cout << "exception thrown, but of an unexpected type" << std::endl;
+ BOOST_TEST_EQ(ex.code(), bs::error_code(std::codecvt_base::error,
+ fs::codecvt_error_category()));
       }
       BOOST_TEST(exception_thrown);
     }
 
     {
       bool exception_thrown (false);
- try { path(STRING_FOO_"foo"); }
+ try { path(STRING_FOO_); }
       catch (const bs::system_error & ex)
       {
         exception_thrown = true;
- BOOST_TEST_EQ(ex.code(), bs::error_code(std::codecvt_base::noconv, fs::codecvt_error_category()));
- }
- catch (...)
- {
- std::cout << "exception thrown, but of an unexpected type" << std::endl;
+ BOOST_TEST_EQ(ex.code(), bs::error_code(std::codecvt_base::noconv,
+ fs::codecvt_error_category()));
       }
       BOOST_TEST(exception_thrown);
     }


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