]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/test/alias.py
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_1_0.txt or http://www.boost.org/LICENSE_1_0.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
.expect_nothing_more()
44 # Try again with "bin2"
45 t
.run_build_system(["bin2"])
46 t
.expect_addition(BoostBuild
.List("bin/$toolset/debug*/") * "b.exe b.obj")
47 t
.expect_nothing_more()
49 # Try building everything, making sure 'hello' target is created.
51 t
.expect_addition(BoostBuild
.List("bin/$toolset/debug*/") * \
52 "hello.exe hello.obj")
53 t
.expect_addition("bin/$toolset/debug*/s.obj")
54 t
.expect_addition(BoostBuild
.List("bin/$toolset/debug*/") * "c.exe c.obj")
55 t
.expect_nothing_more()
58 ###############################################################################
60 # test_alias_source_usage_requirements()
61 # --------------------------------------
63 ###############################################################################
65 def test_alias_source_usage_requirements(t
):
67 Check whether usage requirements are propagated via "alias". In case they
68 are not, linking will fail as there will be no main() function defined
69 anywhere in the source.
72 t
.write("jamroot.jam", """\
73 lib l : l.cpp : : : <define>WANT_MAIN ;
75 exe main : main.cpp la ;
86 t
.write("main.cpp", """\
95 ###############################################################################
100 ###############################################################################
102 # We do not pass the '-d0' option to Boost Build here to get more detailed
103 # information in case of failure.
104 t
= BoostBuild
.Tester(pass_d0
=False, use_test_config
=False)
107 test_alias_source_usage_requirements(t
)