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 | |
---|
8 | import BoostBuild |
---|
9 | |
---|
10 | t = BoostBuild.Tester(pass_toolset=0) |
---|
11 | |
---|
12 | t.write('file.jam', ''' |
---|
13 | rule time |
---|
14 | { |
---|
15 | DEPENDS $(<) : $(>) ; |
---|
16 | __TIMING_RULE__ on $(>) = record_time $(<) ; |
---|
17 | DEPENDS all : $(<) ; |
---|
18 | } |
---|
19 | actions time |
---|
20 | { |
---|
21 | echo $(>) user: $(__USER_TIME__) system: $(__SYSTEM_TIME__) |
---|
22 | echo timed from $(>) >> $(<) |
---|
23 | } |
---|
24 | |
---|
25 | rule 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 | |
---|
32 | rule make |
---|
33 | { |
---|
34 | DEPENDS $(<) : $(>) ; |
---|
35 | } |
---|
36 | actions make |
---|
37 | { |
---|
38 | echo made from $(>) >> $(<) |
---|
39 | } |
---|
40 | |
---|
41 | |
---|
42 | time foo : bar ; |
---|
43 | make bar : baz ; |
---|
44 | ''') |
---|
45 | |
---|
46 | import re |
---|
47 | t.write('baz', 'nothing\n') |
---|
48 | t.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 | ) |
---|
53 | t.expect_addition('foo') |
---|
54 | t.expect_addition('bar') |
---|
55 | t.expect_nothing_more() |
---|
56 | |
---|
57 | t.cleanup() |
---|
Note: See
TracBrowser
for help on using the repository browser.