Boost logo

Boost-Commit :

From: bdawes_at_[hidden]
Date: 2007-09-18 11:37:36


Author: bemandawes
Date: 2007-09-18 11:37:36 EDT (Tue, 18 Sep 2007)
New Revision: 39365
URL: http://svn.boost.org/trac/boost/changeset/39365

Log:
Remove files after tests
Text files modified:
   trunk/libs/filesystem/test/fstream_test.cpp | 10 ++++++++--
   trunk/libs/filesystem/test/wide_test.cpp | 9 +++++++++
   2 files changed, 17 insertions(+), 2 deletions(-)

Modified: trunk/libs/filesystem/test/fstream_test.cpp
==============================================================================
--- trunk/libs/filesystem/test/fstream_test.cpp (original)
+++ trunk/libs/filesystem/test/fstream_test.cpp 2007-09-18 11:37:36 EDT (Tue, 18 Sep 2007)
@@ -37,6 +37,8 @@
 
 namespace
 {
+ bool cleanup = true;
+
   template< class Path >
   void test( const Path & p )
   {
@@ -141,12 +143,16 @@
       BOOST_CHECK( tfs.is_open() );
     }
 # endif
+
+ if ( cleanup ) fs::remove( p );
+
   } // test
 } // unnamed namespace
 
-int test_main( int, char*[] )
+int test_main( int argc, char*[] )
 {
-
+ if ( argc > 1 ) cleanup = false;
+
   // test fs::path
   std::cout << "path tests:\n";
   test( fs::path( "fstream_test_foo" ) );

Modified: trunk/libs/filesystem/test/wide_test.cpp
==============================================================================
--- trunk/libs/filesystem/test/wide_test.cpp (original)
+++ trunk/libs/filesystem/test/wide_test.cpp 2007-09-18 11:37:36 EDT (Tue, 18 Sep 2007)
@@ -38,6 +38,8 @@
 
 namespace
 {
+ bool cleanup = true;
+
   template< class Path >
   void create_file( const Path & ph, const std::string & contents )
   {
@@ -90,6 +92,11 @@
       ++count;
     }
     BOOST_CHECK( count == 1 );
+ if ( cleanup )
+ {
+ fs::remove( dir / file );
+ fs::remove( dir );
+ }
   }
 
   // test boost::detail::utf8_codecvt_facet - even though it is not used by
@@ -117,6 +124,8 @@
 int test_main( int argc, char * argv[] )
 {
 
+ if ( argc > 1 ) cleanup = false;
+
   // So that tests are run with known encoding, use Boost UTF-8 codecvt
   std::locale global_loc = std::locale();
   std::locale loc( global_loc, new fs::detail::utf8_codecvt_facet );


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