]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/test/alias.py
ef89df96e60a9a89b635fd8e9ed177a9e02b492e
3 # Copyright 2003 Dave Abrahams
4 # Copyright 2003 Vladimir Prus
5 # Distributed under the Boost Software License, Version 1.0.
6 # (See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt)
11 ###############################################################################
16 ###############################################################################
18 def test_alias_rule(t
):
19 """Basic alias rule test."""
21 t
.write("jamroot.jam", """\
30 exe hello : hello.cpp src ;
33 t
.write("a.cpp", "int main() {}\n")
34 t
.copy("a.cpp", "b.cpp")
35 t
.copy("a.cpp", "c.cpp")
36 t
.copy("a.cpp", "hello.cpp")
39 # Check that targets to which "bin1" refers are updated, and only those.
40 t
.run_build_system(["bin1"])
41 t
.expect_addition(BoostBuild
.List("bin/$toolset/debug*/") * "a.exe a.obj")
42 t
.ignore_addition('bin/*/a.rsp')
43 t
.ignore_addition('bin/*/a.*.rsp')
44 t
.expect_nothing_more()
46 # Try again with "bin2"
47 t
.run_build_system(["bin2"])
48 t
.expect_addition(BoostBuild
.List("bin/$toolset/debug*/") * "b.exe b.obj")
49 t
.ignore_addition('bin/*/b.rsp')
50 t
.ignore_addition('bin/*/b.*.rsp')
51 t
.expect_nothing_more()
53 # Try building everything, making sure 'hello' target is created.
55 t
.expect_addition(BoostBuild
.List("bin/$toolset/debug*/") * \
56 "hello.exe hello.obj")
57 t
.ignore_addition('bin/*/hello.rsp')
58 t
.ignore_addition('bin/*/hello.*.rsp')
59 t
.expect_addition("bin/$toolset/debug*/s.obj")
60 t
.ignore_addition('bin/*/s.*.rsp')
61 t
.expect_addition(BoostBuild
.List("bin/$toolset/debug*/") * "c.exe c.obj")
62 t
.ignore_addition('bin/*/c.rsp')
63 t
.ignore_addition('bin/*/c.*.rsp')
64 t
.expect_nothing_more()
67 ###############################################################################
69 # test_alias_source_usage_requirements()
70 # --------------------------------------
72 ###############################################################################
74 def test_alias_source_usage_requirements(t
):
76 Check whether usage requirements are propagated via "alias". In case they
77 are not, linking will fail as there will be no main() function defined
78 anywhere in the source.
81 t
.write("jamroot.jam", """\
82 lib l : l.cpp : : : <define>WANT_MAIN ;
84 exe main : main.cpp la ;
95 t
.write("main.cpp", """\
104 ###############################################################################
109 ###############################################################################
111 t
= BoostBuild
.Tester(use_test_config
=False)
114 test_alias_source_usage_requirements(t
)