]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | #!/usr/bin/python |
2 | ||
3 | # Copyright 2005 Dave Abrahams | |
4 | # Distributed under the Boost Software License, Version 1.0. | |
5 | # (See accompanying file LICENSE_1_0.txt or copy at | |
6 | # http://www.boost.org/LICENSE_1_0.txt) | |
7 | ||
8 | import BoostBuild | |
9 | ||
10 | ||
11 | def wait_for_bar(t): | |
12 | """ | |
13 | Wait to make the test system correctly recognize the 'bar' file as | |
14 | touched after the next build run. Without the wait, the next build run may | |
15 | rebuild the 'bar' file with the new and the old file modification timestamp | |
16 | too close to each other - which could, depending on the currently supported | |
17 | file modification timestamp resolution, be detected as 'no change' by the | |
18 | testing system. | |
19 | ||
20 | """ | |
21 | t.wait_for_time_change("bar", touch=False) | |
22 | ||
23 | ||
11fdf7f2 | 24 | t = BoostBuild.Tester(["-ffile.jam", "-d+3", "-d+12", "-d+13"], |
7c673cae FG |
25 | pass_toolset=0) |
26 | ||
27 | t.write("file.jam", """\ | |
28 | rule make | |
29 | { | |
30 | DEPENDS $(<) : $(>) ; | |
31 | DEPENDS all : $(<) ; | |
32 | } | |
33 | actions make | |
34 | { | |
35 | echo "******" making $(<) from $(>) "******" | |
36 | echo made from $(>) > $(<) | |
37 | } | |
38 | ||
39 | make aux1 : bar ; | |
40 | make foo : bar ; | |
41 | REBUILDS foo : bar ; | |
42 | make bar : baz ; | |
43 | make aux2 : bar ; | |
44 | """) | |
45 | ||
46 | t.write("baz", "nothing") | |
47 | ||
48 | t.run_build_system(["bar"]) | |
49 | t.expect_addition("bar") | |
50 | t.expect_nothing_more() | |
51 | ||
52 | wait_for_bar(t) | |
53 | t.run_build_system(["foo"]) | |
54 | t.expect_touch("bar") | |
55 | t.expect_addition("foo") | |
56 | t.expect_nothing_more() | |
57 | ||
58 | t.run_build_system() | |
59 | t.expect_addition(["aux1", "aux2"]) | |
60 | t.expect_nothing_more() | |
61 | ||
62 | t.touch("bar") | |
63 | wait_for_bar(t) | |
64 | t.run_build_system() | |
65 | t.expect_touch(["foo", "bar", "aux1", "aux2"]) | |
66 | t.expect_nothing_more() | |
67 | ||
68 | t.cleanup() |