Boost logo

Boost-Commit :

From: jurko.gospodnetic_at_[hidden]
Date: 2008-01-09 09:36:37


Author: jurko
Date: 2008-01-09 09:36:37 EST (Wed, 09 Jan 2008)
New Revision: 42637
URL: http://svn.boost.org/trac/boost/changeset/42637

Log:
Updated the test so it passes on Windows. Had to change it to enable action output logging and compensate for the fact that now action names are sent to the output as well. Minor stylistic changes.
Text files modified:
   trunk/tools/build/v2/test/timedata.py | 31 +++++++++++++++++++------------
   1 files changed, 19 insertions(+), 12 deletions(-)

Modified: trunk/tools/build/v2/test/timedata.py
==============================================================================
--- trunk/tools/build/v2/test/timedata.py (original)
+++ trunk/tools/build/v2/test/timedata.py 2008-01-09 09:36:37 EST (Wed, 09 Jan 2008)
@@ -6,16 +6,18 @@
 # This tests the build step timing facilities.
 
 import BoostBuild
+import re
 
 t = BoostBuild.Tester(pass_toolset=0)
 
-t.write('file.jam', '''
+t.write("file.jam", """
 rule time
 {
     DEPENDS $(<) : $(>) ;
     __TIMING_RULE__ on $(>) = record_time $(<) ;
     DEPENDS all : $(<) ;
 }
+
 actions time
 {
     echo $(>) user: $(__USER_TIME__) system: $(__SYSTEM_TIME__)
@@ -24,7 +26,6 @@
 
 rule record_time ( target : source : start end user system )
 {
- ECHO record_time called: $(target) / $(source) / $(user) / $(system) ;
     __USER_TIME__ on $(target) = $(user) ;
     __SYSTEM_TIME__ on $(target) = $(system) ;
 }
@@ -33,6 +34,7 @@
 {
     DEPENDS $(<) : $(>) ;
 }
+
 actions make
 {
     echo made from $(>) >> $(<)
@@ -41,17 +43,22 @@
 
 time foo : bar ;
 make bar : baz ;
-''')
+""")
 
-import re
-t.write('baz', 'nothing\n')
-t.run_build_system(
- '-ffile.jam',
- stdout=r'bar +user: [0-9\.]+ +system: +[0-9\.]+ *$',
- match = lambda actual,expected: re.search(expected,actual,re.DOTALL)
- )
-t.expect_addition('foo')
-t.expect_addition('bar')
+t.write("baz", "nothing\n")
+
+expected_output = """\.\.\.found 4 targets\.\.\.
+\.\.\.updating 2 targets\.\.\.
+make bar
+time foo
+bar +user: [0-9\.]+ +system: +[0-9\.]+ *
+\.\.\.updated 2 targets\.\.\.$
+"""
+
+t.run_build_system("-ffile.jam -d+1", stdout=expected_output,
+ match=lambda actual, expected: re.search(expected, actual, re.DOTALL))
+t.expect_addition("foo")
+t.expect_addition("bar")
 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