Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r51959 - trunk/libs/filesystem/test
From: bdawes_at_[hidden]
Date: 2009-03-24 11:33:32


Author: bemandawes
Date: 2009-03-24 11:33:31 EDT (Tue, 24 Mar 2009)
New Revision: 51959
URL: http://svn.boost.org/trac/boost/changeset/51959

Log:
Filesystem: remove dependency on Boost.Test
Text files modified:
   trunk/libs/filesystem/test/convenience_test.cpp | 6 +++---
   trunk/libs/filesystem/test/deprecated_test.cpp | 10 ++++------
   trunk/libs/filesystem/test/fstream_test.cpp | 6 +++---
   trunk/libs/filesystem/test/operations_test.cpp | 13 +++++++------
   trunk/libs/filesystem/test/path_test.cpp | 17 ++++++-----------
   trunk/libs/filesystem/test/wide_test.cpp | 8 ++++----
   6 files changed, 27 insertions(+), 33 deletions(-)

Modified: trunk/libs/filesystem/test/convenience_test.cpp
==============================================================================
--- trunk/libs/filesystem/test/convenience_test.cpp (original)
+++ trunk/libs/filesystem/test/convenience_test.cpp 2009-03-24 11:33:31 EDT (Tue, 24 Mar 2009)
@@ -18,7 +18,7 @@
 using fs::path;
 namespace sys = boost::system;
 
-#include <boost/test/minimal.hpp>
+#include <boost/detail/test_framework.hpp>
 #include <boost/bind.hpp>
 #include <fstream>
 #include <iostream>
@@ -53,7 +53,7 @@
 
 // --------------------------------------------------------------------------//
 
-int test_main( int, char*[] )
+int main( int, char*[] )
 {
 
 // create_directories() tests ----------------------------------------------//
@@ -163,5 +163,5 @@
 
 
 
- return 0;
+ return boost::test_framework::errors();
 }

Modified: trunk/libs/filesystem/test/deprecated_test.cpp
==============================================================================
--- trunk/libs/filesystem/test/deprecated_test.cpp (original)
+++ trunk/libs/filesystem/test/deprecated_test.cpp 2009-03-24 11:33:31 EDT (Tue, 24 Mar 2009)
@@ -13,7 +13,7 @@
 // important to preserve existing code that uses the old names.
 
 #include <boost/filesystem.hpp>
-#include <boost/test/minimal.hpp>
+#include <boost/detail/test_framework.hpp>
 
 namespace fs = boost::filesystem;
 using boost::filesystem::path;
@@ -24,14 +24,12 @@
 {
   std::string platform( BOOST_PLATFORM );
 
- int errors;
-
   void check( const fs::path & source,
               const std::string & expected, int line )
   {
     if ( source.string()== expected ) return;
 
- ++errors;
+ ++boost::test_framework::error_count;
 
     std::cout << '(' << line << ") source.string(): \"" << source.string()
               << "\" != expected: \"" << expected
@@ -147,7 +145,7 @@
 
 //----------------------------------------------------------------------------//
 
-int test_main( int /*argc*/, char * /*argv*/[] )
+int 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
@@ -200,5 +198,5 @@
   // see the rationale in html docs for explanation why this works
   BOOST_CHECK( fs::change_extension("", ".png").string() == ".png" );
 
- return errors;
+ return boost::test_framework::errors();
 }

Modified: trunk/libs/filesystem/test/fstream_test.cpp
==============================================================================
--- trunk/libs/filesystem/test/fstream_test.cpp (original)
+++ trunk/libs/filesystem/test/fstream_test.cpp 2009-03-24 11:33:31 EDT (Tue, 24 Mar 2009)
@@ -31,7 +31,7 @@
   namespace std { using ::remove; }
 #endif
 
-#include <boost/test/minimal.hpp>
+#include <boost/detail/test_framework.hpp>
 
 namespace
 {
@@ -147,7 +147,7 @@
   } // test
 } // unnamed namespace
 
-int test_main( int argc, char*[] )
+int main( int argc, char*[] )
 {
   if ( argc > 1 ) cleanup = false;
 
@@ -176,5 +176,5 @@
 
 #endif
 
- return 0;
+ return boost::test_framework::errors();
 }

Modified: trunk/libs/filesystem/test/operations_test.cpp
==============================================================================
--- trunk/libs/filesystem/test/operations_test.cpp (original)
+++ trunk/libs/filesystem/test/operations_test.cpp 2009-03-24 11:33:31 EDT (Tue, 24 Mar 2009)
@@ -18,8 +18,7 @@
 namespace fs = boost::filesystem;
 
 #include <boost/config.hpp>
-#include <boost/test/minimal.hpp>
-//#include <boost/concept_check.hpp>
+#include <boost/detail/test_framework.hpp>
 
 using boost::system::error_code;
 using boost::system::system_category;
@@ -258,9 +257,9 @@
   
 } // unnamed namespace
 
-// test_main ---------------------------------------------------------------//
+// main ------------------------------------------------------------------------------//
 
-int test_main( int argc, char * argv[] )
+int main( int argc, char * argv[] )
 {
   if ( argc > 1 && *argv[1]=='-' && *(argv[1]+1)=='t' ) report_throws = true;
 
@@ -650,7 +649,8 @@
 
   if ( create_hard_link_ok )
   {
- std::cout << "create_hard_link() succeeded\n";
+ std::cout << "create_hard_link(\"" << file_ph << "\", \""
+ << from_ph << "\") succeeded\n";
     BOOST_CHECK( fs::exists( from_ph ) );
     BOOST_CHECK( fs::exists( file_ph ) );
     BOOST_CHECK( fs::equivalent( from_ph, file_ph ) );
@@ -925,6 +925,7 @@
   // a bug (failure to close an internal search handle).
   BOOST_CHECK( !fs::exists( dir ) );
   BOOST_CHECK( fs::remove_all( dir ) == 0 );
- return 0;
+
+ return boost::test_framework::errors();
 } // main
 

Modified: trunk/libs/filesystem/test/path_test.cpp
==============================================================================
--- trunk/libs/filesystem/test/path_test.cpp (original)
+++ trunk/libs/filesystem/test/path_test.cpp 2009-03-24 11:33:31 EDT (Tue, 24 Mar 2009)
@@ -30,7 +30,7 @@
 using boost::next;
 using boost::prior;
 
-#include <boost/test/minimal.hpp>
+#include <boost/detail/test_framework.hpp>
 
 #define PATH_CHECK( a, b ) check( a, b, __LINE__ )
 #define DIR_CHECK( a, b ) check_dir( a, b, __LINE__ )
@@ -41,14 +41,12 @@
 {
   std::string platform( BOOST_PLATFORM );
 
- int errors;
-
   void check( const fs::path & source,
               const std::string & expected, int line )
   {
     if ( source.string()== expected ) return;
 
- ++errors;
+ ++boost::test_framework::error_count;
 
     std::cout << '(' << line << ") source.string(): \"" << source.string()
               << "\" != expected: \"" << expected
@@ -60,7 +58,7 @@
   {
     if ( source.directory_string()== expected ) return;
 
- ++errors;
+ ++boost::test_framework::error_count;
 
     std::cout << '(' << line << ") source.directory_string(): \""
               << source.directory_string()
@@ -73,7 +71,7 @@
   {
     if ( value == expected ) return;
 
- ++errors;
+ ++boost::test_framework::error_count;
 
     std::cout << '(' << line << ") value: \"" << value
               << "\" != expected: \"" << expected
@@ -192,7 +190,7 @@
 
 } // unnamed namespace
 
-int test_main( int, char*[] )
+int 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
@@ -1343,8 +1341,5 @@
   std::cout << round_trip.string() << "..." << round_trip << " complete\n";
 # endif
 
-
- std::cout << errors << " errors detected\n";
-
- return errors;
+ return boost::test_framework::errors();
 }

Modified: trunk/libs/filesystem/test/wide_test.cpp
==============================================================================
--- trunk/libs/filesystem/test/wide_test.cpp (original)
+++ trunk/libs/filesystem/test/wide_test.cpp 2009-03-24 11:33:31 EDT (Tue, 24 Mar 2009)
@@ -21,7 +21,7 @@
 #include <boost/filesystem/operations.hpp>
 #include <boost/filesystem/fstream.hpp>
 #include <boost/scoped_array.hpp>
-#include <boost/test/minimal.hpp>
+#include <boost/detail/test_framework.hpp>
 
 #include "../src/utf8_codecvt_facet.hpp"
 
@@ -118,9 +118,9 @@
 
 } // unnamed namespace
 
-// test_main ---------------------------------------------------------------//
+// main ------------------------------------------------------------------------------//
 
-int test_main( int argc, char * /*argv*/[] )
+int main( int argc, char * /*argv*/[] )
 {
 
   if ( argc > 1 ) cleanup = false;
@@ -157,5 +157,5 @@
   test( ::user::lpath( dir ), ::user::lpath( file ), ::user::lpath( dot ) );
   std::cout << "complete\n\n";
 
- return 0;
+ return boost::test_framework::errors();
 }


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