Boost logo

Boost-Build :

From: Jurko Gospodnetiæ (jurko.gospodnetic_at_[hidden])
Date: 2007-12-23 01:07:13


   Attached patch fixes the failing test on Windows.
Problem was that build DLL and import library files were getting copied
by reading them in text mode. Corrected by adding a new default 'binary'
parameter flag to the method and calling it with the
binary flag set in both Tester copy operations.

   Besides that the rest are just a few cosmetic changes.

   And I noticed that the Tester.read_and_strip() method has something
fishy in it related to how it handles trailing new-line characters.
Unless I'm reading this Python code incorrectly it seems to add another
newline in case the read text already ends with a newline but otherwise
does not. Was that by design or was the intent to add a newline to files
that do not end with one? I tried running the tests with the if in this
function reversed and it made no difference.

   My failed test count is now down to 4, 2 of which seem to be timer
related (record_time rule) and 1 is the alias warning test I added for
the related defect report.

   Best regards,
     Jurko Gospodnetiæ

Left base folder: X:\Boost_Build\20071222_nightly_build\Original\boost-build
Right base folder: X:\Boost_Build\20071222_nightly_build\Modified\boost-build
--- test\ 2007-12-21 15:33:44.000000000 +-0100
+++ test\ 2007-12-23 06:43:57.000000000 +-0100
@@ -295,27 +295,27 @@
         os.rename(old, new)
     def copy(self, src, dst):
- self.write(dst,
+ self.write(dst,, 1))
     def copy_preserving_timestamp(self, src, dst):
         src_name = self.native_file_name(src)
         dst_name = self.native_file_name(dst)
         stats = os.stat(src_name)
- self.write(dst,
+ self.write(dst,, 1))
         os.utime(dst_name, (stats.st_atime, stats.st_mtime))
     def touch(self, names):
         for name in self.adjust_names(names):
- os.utime(self.native_file_name(name), None)
+ os.utime(self.native_file_name(name), None)
     def rm(self, names):
         if not type(names) == types.ListType:
             names = [names]
@@ -434,18 +434,23 @@
         if not result:
             result = glob.glob(self.native_file_name(name))
             if result:
                 result = result[0]
         return result
- def read(self, name):
+ def read(self, name, binary = 0):
             if self.toolset:
                 name = string.replace(name, "$toolset", self.toolset+"*")
             name = self.glob_file(name)
- return open(name, "rU").read()
+ openMode = "r"
+ if ( binary ):
+ openMode += "b"
+ else:
+ openMode += "U"
+ return open(name, openMode).read()
             annotation("reason", "Could not open '%s'" % name)
             return ''
     def read_and_strip(self, name):
@@ -519,13 +524,12 @@
     def ignore_modification(self, wildcard):
         self.ignore_elements(self.unexpected_difference.modified_files, wildcard)
     def expect_touch(self, names):
         d = self.unexpected_difference
         for name in self.adjust_names(names):
             # We need to check in both touched and modified files.
             # The reason is that:
             # (1) for windows binaries often have slight
--- test\ 2007-12-21 15:33:44.000000000 +-0100
+++ test\ 2007-12-23 05:35:17.000000000 +-0100
@@ -1,22 +1,22 @@
-# Copyright 2003 Dave Abrahams
-# Copyright 2003, 2004, 2005, 2006 Vladimir Prus
-# Distributed under the Boost Software License, Version 1.0.
-# (See accompanying file LICENSE_1_0.txt or
+# Copyright 2003 Dave Abrahams
+# Copyright 2003, 2004, 2005, 2006 Vladimir Prus
+# Distributed under the Boost Software License, Version 1.0.
+# (See accompanying file LICENSE_1_0.txt or
 # Test usage of searched-libs: one which are found via -l
-# switch to the linker/compiler.
+# switch to the linker/compiler.
 from BoostBuild import Tester, get_toolset
 import string
 import os
 t = Tester()
-# To start with, we have to prepate a library to link with
+# To start with, we have to prepare a library to link with.
 t.write("lib/project-root.jam", "")
 t.write("lib/Jamfile", "lib test_lib : test_lib.cpp ;")
 t.write("lib/test_lib.cpp", """
 #ifdef _WIN32
@@ -25,13 +25,12 @@
 # Auto adjusting of suffixes does not work, since we need to
 # change dll to lib.
 if ( == 'nt' or os.uname()[0].lower().startswith('cygwin')) and get_toolset() != 'gcc':
     t.copy("lib/bin/$toolset/debug/test_lib.implib", "lib/test_lib.implib")
     t.copy("lib/bin/$toolset/debug/test_lib.dll", "lib/test_lib.dll")
     t.copy("lib/bin/$toolset/debug/test_lib.dll", "lib/test_lib.dll")
@@ -101,13 +100,13 @@
 # A regression test: <library>property referring to
 # searched-lib was mishandled. As the result, we were
 # putting target name to the command line!
-# Note that
+# Note that
 # g++ ...... <.>z
 # works nicely in some cases, sending output from compiler
 # to file 'z'.
 # This problem shows up when searched libs are in usage
 # requirements.

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at