1 | #!/usr/bin/python |
---|
2 | |
---|
3 | # Copyright 2003 Dave Abrahams |
---|
4 | # Copyright 2003, 2006 Vladimir Prus |
---|
5 | # Distributed under the Boost Software License, Version 1.0. |
---|
6 | # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) |
---|
7 | |
---|
8 | # Test the 'make' rule |
---|
9 | |
---|
10 | from BoostBuild import Tester |
---|
11 | from string import find |
---|
12 | |
---|
13 | t = Tester(pass_toolset=1) |
---|
14 | |
---|
15 | t.write("Jamroot", """ |
---|
16 | |
---|
17 | import feature ; |
---|
18 | feature.feature test_feature : : free ; |
---|
19 | |
---|
20 | import toolset ; |
---|
21 | toolset.flags creator STRING : <test_feature> ; |
---|
22 | |
---|
23 | actions creator |
---|
24 | { |
---|
25 | echo $(STRING) > $(<) |
---|
26 | } |
---|
27 | |
---|
28 | make foo.bar : : creator : <test_feature>12345678 ; |
---|
29 | """) |
---|
30 | |
---|
31 | t.run_build_system() |
---|
32 | t.expect_addition("bin/$toolset/debug/foo.bar") |
---|
33 | t.fail_test(find(t.read("bin/$toolset/debug/foo.bar"), "12345678") == -1) |
---|
34 | |
---|
35 | # Regression test. Make sure that if main target requested two times, |
---|
36 | # and build request differ only in incidental properties, the main target |
---|
37 | # if created only once. The bug was discovered by Kirill Lapshin. |
---|
38 | |
---|
39 | t.write("Jamroot", """ |
---|
40 | # Make sure that incidental property does not |
---|
41 | # cause second creation of 'hello1.cpp'. |
---|
42 | exe a : dir//hello1.cpp ; |
---|
43 | exe b : dir//hello1.cpp/<hardcode-dll-paths>true ; |
---|
44 | """) |
---|
45 | |
---|
46 | t.write("dir/Jamfile", """ |
---|
47 | import common ; |
---|
48 | make hello1.cpp : hello.cpp : common.copy ; |
---|
49 | |
---|
50 | """) |
---|
51 | |
---|
52 | t.write("dir/hello.cpp", """ |
---|
53 | int main() |
---|
54 | { |
---|
55 | return 1; |
---|
56 | } |
---|
57 | """) |
---|
58 | # Show only names of the actions. |
---|
59 | t.run_build_system("-d1 -n") |
---|
60 | t.fail_test(t.stdout().count("copy") != 1) |
---|
61 | |
---|
62 | t.cleanup() |
---|