1 | #!/usr/bin/python |
---|
2 | |
---|
3 | # Copyright 2003, 2006 Vladimir Prus |
---|
4 | # Distributed under the Boost Software License, Version 1.0. |
---|
5 | # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) |
---|
6 | |
---|
7 | from BoostBuild import Tester, List |
---|
8 | |
---|
9 | t = Tester() |
---|
10 | |
---|
11 | t.write("Jamroot", """ |
---|
12 | project : requirements <link>static ; |
---|
13 | exe a : a.cpp [ lib helper : helper.cpp ] ; |
---|
14 | """) |
---|
15 | |
---|
16 | t.write("a.cpp", """ |
---|
17 | extern void helper(); |
---|
18 | int main() |
---|
19 | { |
---|
20 | return 0; |
---|
21 | } |
---|
22 | |
---|
23 | """) |
---|
24 | |
---|
25 | t.write("helper.cpp", """ |
---|
26 | void helper() |
---|
27 | { |
---|
28 | } |
---|
29 | """) |
---|
30 | |
---|
31 | t.run_build_system() |
---|
32 | t.expect_addition("bin/$toolset/debug/link-static/a__helper.lib") |
---|
33 | t.rm("bin/$toolset/debug/link-static/a__helper.lib") |
---|
34 | |
---|
35 | t.run_build_system("a__helper") |
---|
36 | t.expect_addition("bin/$toolset/debug/link-static/a__helper.lib") |
---|
37 | |
---|
38 | t.rm("bin") |
---|
39 | |
---|
40 | # Now check that inline targets with the same name but |
---|
41 | # present in different places are not confused between |
---|
42 | # each other, and with top-level targets. |
---|
43 | t.write("Jamroot", """ |
---|
44 | project : requirements <link>static ; |
---|
45 | exe a : a.cpp [ lib helper : helper.cpp ] ; |
---|
46 | exe a2 : a.cpp [ lib helper : helper.cpp ] ; |
---|
47 | """) |
---|
48 | |
---|
49 | t.run_build_system() |
---|
50 | t.expect_addition("bin/$toolset/debug/link-static/a.exe") |
---|
51 | t.expect_addition("bin/$toolset/debug/link-static/a__helper.lib") |
---|
52 | t.expect_addition("bin/$toolset/debug/link-static/a2__helper.lib") |
---|
53 | |
---|
54 | # Check that the 'alias' target does not change name of |
---|
55 | # inline targets, and that inline targets are explicit. |
---|
56 | t.write("Jamroot", """ |
---|
57 | project : requirements <link>static ; |
---|
58 | alias a : [ lib helper : helper.cpp ] ; |
---|
59 | explicit a ; |
---|
60 | """) |
---|
61 | t.rm("bin") |
---|
62 | |
---|
63 | t.run_build_system() |
---|
64 | t.expect_nothing_more() |
---|
65 | |
---|
66 | t.run_build_system("a") |
---|
67 | t.expect_addition("bin/$toolset/debug/link-static/helper.lib") |
---|
68 | |
---|
69 | t.cleanup() |
---|
70 | |
---|