Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/tools/build/v2/test/timedata.py @ 29

Last change on this file since 29 was 29, checked in by landauf, 16 years ago

updated boost from 1_33_1 to 1_34_1

File size: 1.2 KB
Line 
1#!/usr/bin/python
2# Copyright David Abrahams 2005. Distributed under the Boost
3# Software License, Version 1.0. (See accompanying
4# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5
6# This tests the build step timing facilities.
7
8import BoostBuild
9
10t = BoostBuild.Tester(pass_toolset=0)
11
12t.write('file.jam', '''
13rule time
14{
15    DEPENDS $(<) : $(>) ;
16    __TIMING_RULE__ on $(>) = record_time $(<) ;
17    DEPENDS all : $(<) ;
18}
19actions time
20{
21    echo $(>) user: $(__USER_TIME__) system: $(__SYSTEM_TIME__)
22    echo timed from $(>) >> $(<)
23}
24
25rule record_time ( target source : user : system )
26{
27    ECHO record_time called: $(target) / $(source) / $(user) / $(system) ;
28    __USER_TIME__ on $(target) = $(user) ;
29    __SYSTEM_TIME__ on $(target) = $(system) ;
30}
31
32rule make
33{
34    DEPENDS $(<) : $(>) ;
35}
36actions make
37{
38    echo made from $(>) >> $(<)
39}
40
41
42time foo : bar ;
43make bar : baz ;
44''')
45
46import re
47t.write('baz', 'nothing\n')
48t.run_build_system(
49    '-ffile.jam',
50    stdout=r'bar +user: [0-9\.]+ +system: +[0-9\.]+ *$',
51    match = lambda actual,expected: re.search(expected,actual,re.DOTALL)
52    )
53t.expect_addition('foo')
54t.expect_addition('bar')
55t.expect_nothing_more()
56
57t.cleanup()
Note: See TracBrowser for help on using the repository browser.