]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | #!/usr/bin/python |
2 | ||
3 | # Copyright (C) Vladimir Prus 2006. | |
4 | # Distributed under the Boost Software License, Version 1.0. (See | |
1e59de90 TL |
5 | # accompanying file LICENSE.txt or copy at |
6 | # https://www.bfgroup.xyz/b2/LICENSE.txt) | |
7c673cae FG |
7 | |
8 | import BoostBuild | |
9 | ||
10 | t = BoostBuild.Tester(use_test_config=False) | |
11 | ||
12 | ||
13 | t.write("jamroot.jam", """ | |
14 | project : requirements <threading>multi <variant>debug:<link>static ; | |
11fdf7f2 TL |
15 | # Force link to be relevant |
16 | project : requirements <link>shared:<define>TEST_DLL ; | |
7c673cae FG |
17 | |
18 | build-project sub ; | |
19 | build-project sub2 ; | |
20 | build-project sub3 ; | |
21 | build-project sub4 ; | |
22 | """) | |
23 | ||
24 | t.write("sub/jamfile.jam", """ | |
25 | exe hello : hello.cpp : -<threading>multi ; | |
26 | """) | |
27 | ||
28 | t.write("sub/hello.cpp", """ | |
29 | int main() {} | |
30 | """) | |
31 | ||
32 | t.write("sub2/jamfile.jam", """ | |
33 | project : requirements -<threading>multi ; | |
34 | exe hello : hello.cpp ; | |
35 | """) | |
36 | ||
37 | t.write("sub2/hello.cpp", """ | |
38 | int main() {} | |
39 | """) | |
40 | ||
41 | t.write("sub3/hello.cpp", """ | |
42 | int main() {} | |
43 | """) | |
44 | ||
45 | t.write("sub3/jamfile.jam", """ | |
11fdf7f2 | 46 | exe hello : hello.cpp : "-<variant>debug:<link>static" ; |
7c673cae FG |
47 | """) |
48 | ||
49 | t.write("sub4/hello.cpp", """ | |
50 | int main() {} | |
51 | """) | |
52 | ||
53 | t.write("sub4/jamfile.jam", """ | |
11fdf7f2 | 54 | project : requirements "-<variant>debug:<link>static" ; |
7c673cae FG |
55 | exe hello : hello.cpp ; |
56 | """) | |
57 | ||
58 | t.run_build_system() | |
59 | ||
92f5a8d4 TL |
60 | t.expect_addition("sub/bin/$toolset/debug*/link-static*/hello.exe") |
61 | t.expect_addition("sub2/bin/$toolset/debug*/link-static*/hello.exe") | |
62 | t.expect_addition("sub3/bin/$toolset/debug*/threading-multi*/hello.exe") | |
63 | t.expect_addition("sub4/bin/$toolset/debug*/threading-multi*/hello.exe") | |
7c673cae FG |
64 | |
65 | t.rm(".") | |
66 | ||
67 | # Now test that path requirements can be removed as well. | |
68 | t.write("jamroot.jam", """ | |
69 | build-project sub ; | |
70 | """) | |
71 | ||
72 | t.write("sub/jamfile.jam", """ | |
73 | project : requirements <include>broken ; | |
74 | exe hello : hello.cpp : -<include>broken ; | |
75 | """) | |
76 | ||
77 | t.write("sub/hello.cpp", """ | |
78 | #include "math.h" | |
79 | int main() {} | |
80 | """) | |
81 | ||
82 | t.write("sub/broken/math.h", """ | |
83 | Broken | |
84 | """) | |
85 | ||
86 | ||
87 | t.run_build_system() | |
88 | ||
b32b8144 | 89 | t.expect_addition("sub/bin/$toolset/debug*/hello.exe") |
7c673cae FG |
90 | |
91 | t.cleanup() |