Boost logo

Boost-Commit :

From: ghost_at_[hidden]
Date: 2007-09-08 12:24:51


Author: vladimir_prus
Date: 2007-09-08 12:24:50 EDT (Sat, 08 Sep 2007)
New Revision: 39168
URL: http://svn.boost.org/trac/boost/changeset/39168

Log:
        Fix the rebuilds test on linux.
        * BoostBuild.py (wait_for_time_change): Use floor,
        to avoid waiting 0.5 seconds.
        * rebuilds.py: Wait for time change as necessary.
Text files modified:
   trunk/tools/build/v2/test/BoostBuild.py | 10 ++++++++--
   trunk/tools/build/v2/test/rebuilds.py | 3 ++-
   2 files changed, 10 insertions(+), 3 deletions(-)

Modified: trunk/tools/build/v2/test/BoostBuild.py
==============================================================================
--- trunk/tools/build/v2/test/BoostBuild.py (original)
+++ trunk/tools/build/v2/test/BoostBuild.py 2007-09-08 12:24:50 EDT (Sat, 08 Sep 2007)
@@ -19,6 +19,7 @@
 import tempfile
 import sys
 import traceback
+import math
 from StringIO import StringIO
 
 annotation_func = None
@@ -750,8 +751,13 @@
     # Wait while time is no longer equal to the time last "run_build_system"
     # call finished.
     def wait_for_time_change(self):
- while int(time.time()) < int(self.last_build_time) + 1:
- time.sleep(0.1)
+ while 1:
+ f = time.time();
+ if math.floor(f) < math.floor(self.last_build_time) + 1:
+ time.sleep(0.1)
+ else:
+ break
+
 
             
 class List:

Modified: trunk/tools/build/v2/test/rebuilds.py
==============================================================================
--- trunk/tools/build/v2/test/rebuilds.py (original)
+++ trunk/tools/build/v2/test/rebuilds.py 2007-09-08 12:24:50 EDT (Sat, 08 Sep 2007)
@@ -35,6 +35,7 @@
 t.expect_addition('bar')
 t.expect_nothing_more()
 
+t.wait_for_time_change()
 t.run_build_system('-ffile.jam foo')
 t.expect_touch('bar')
 t.expect_addition('foo')
@@ -46,7 +47,7 @@
 
 t.touch('bar')
 t.run_build_system('-ffile.jam')
-t.expect_touch(['foo', 'aux1', 'aux2', 'bar'])
+t.expect_touch(['foo', 'aux1', 'aux2'])
 t.expect_nothing_more()
 
 t.cleanup()


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