]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/test/inline.py
update sources to v12.2.3
[ceph.git] / ceph / src / boost / tools / build / test / inline.py
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 import BoostBuild
8
9 t = BoostBuild.Tester(use_test_config=False)
10
11 t.write("jamroot.jam", """\
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
21 t.write("helper.cpp", "void helper() {}\n")
22
23 t.run_build_system()
24 t.expect_addition("bin/$toolset/debug/link-static*/a__helper.lib")
25 t.rm("bin/$toolset/debug/link-static/a__helper.lib")
26 t.rm("bin/$toolset/debug/link-static/*/a__helper.lib")
27
28 t.run_build_system(["a__helper"])
29 t.expect_addition("bin/$toolset/debug/link-static*/a__helper.lib")
30
31 t.rm("bin")
32
33
34 # Now check that inline targets with the same name but present in different
35 # places are not confused between each other, and with top-level targets.
36 t.write("jamroot.jam", """\
37 project : requirements <link>static ;
38 exe a : a.cpp [ lib helper : helper.cpp ] ;
39 exe a2 : a.cpp [ lib helper : helper.cpp ] ;
40 """)
41
42 t.run_build_system()
43 t.expect_addition("bin/$toolset/debug/link-static*/a.exe")
44 t.expect_addition("bin/$toolset/debug/link-static*/a__helper.lib")
45 t.expect_addition("bin/$toolset/debug/link-static*/a2__helper.lib")
46
47
48 # Check that the 'alias' target does not change the name of inline targets, and
49 # that inline targets are explicit.
50 t.write("jamroot.jam", """\
51 project : requirements <link>static ;
52 alias a : [ lib helper : helper.cpp ] ;
53 explicit a ;
54 """)
55 t.rm("bin")
56
57 t.run_build_system()
58 t.expect_nothing_more()
59
60 t.run_build_system(["a"])
61 t.expect_addition("bin/$toolset/debug/link-static*/helper.lib")
62
63 t.cleanup()