]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/test/build_file.py
3 # Copyright (C) 2006. Vladimir Prus
4 # Copyright (C) 2008. Jurko Gospodnetic
5 # Distributed under the Boost Software License, Version 1.0.
6 # (See accompanying file LICENSE_1_0.txt or copy at
7 # http://www.boost.org/LICENSE_1_0.txt)
9 # Tests that we explicitly request a file (not target) to be built by
10 # specifying its name on the command line.
15 ###############################################################################
17 # test_building_file_from_specific_project()
18 # ------------------------------------------
20 ###############################################################################
22 def test_building_file_from_specific_project():
23 t
= BoostBuild
.Tester(use_test_config
=False)
25 t
.write("jamroot.jam", """\
26 exe hello : hello.cpp ;
27 exe hello2 : hello.cpp ;
30 t
.write("hello.cpp", "int main() {}\n")
31 t
.write("sub/jamfile.jam", """
32 exe hello : hello.cpp ;
33 exe hello2 : hello.cpp ;
36 t
.write("sub/hello.cpp", "int main() {}\n")
38 t
.run_build_system(["sub", t
.adjust_suffix("hello.obj")])
39 t
.expect_output_lines("*depends on itself*", False)
40 t
.expect_addition("sub/bin/$toolset/debug*/hello.obj")
41 t
.expect_nothing_more()
46 ###############################################################################
48 # test_building_file_from_specific_target()
49 # -----------------------------------------
51 ###############################################################################
53 def test_building_file_from_specific_target():
54 t
= BoostBuild
.Tester(use_test_config
=False)
56 t
.write("jamroot.jam", """\
57 exe hello1 : hello1.cpp ;
58 exe hello2 : hello2.cpp ;
59 exe hello3 : hello3.cpp ;
61 t
.write("hello1.cpp", "int main() {}\n")
62 t
.write("hello2.cpp", "int main() {}\n")
63 t
.write("hello3.cpp", "int main() {}\n")
65 t
.run_build_system(["hello1", t
.adjust_suffix("hello1.obj")])
66 t
.expect_addition("bin/$toolset/debug*/hello1.obj")
67 t
.expect_nothing_more()
72 ###############################################################################
74 # test_building_missing_file_from_specific_target()
75 # -------------------------------------------------
77 ###############################################################################
79 def test_building_missing_file_from_specific_target():
80 t
= BoostBuild
.Tester(use_test_config
=False)
82 t
.write("jamroot.jam", """\
83 exe hello1 : hello1.cpp ;
84 exe hello2 : hello2.cpp ;
85 exe hello3 : hello3.cpp ;
87 t
.write("hello1.cpp", "int main() {}\n")
88 t
.write("hello2.cpp", "int main() {}\n")
89 t
.write("hello3.cpp", "int main() {}\n")
91 obj
= t
.adjust_suffix("hello2.obj")
92 t
.run_build_system(["hello1", obj
], status
=1)
93 t
.expect_output_lines("don't know how to make*" + obj
)
94 t
.expect_nothing_more()
99 ###############################################################################
101 # test_building_multiple_files_with_different_names()
102 # ---------------------------------------------------
104 ###############################################################################
106 def test_building_multiple_files_with_different_names():
107 t
= BoostBuild
.Tester(use_test_config
=False)
109 t
.write("jamroot.jam", """\
110 exe hello1 : hello1.cpp ;
111 exe hello2 : hello2.cpp ;
112 exe hello3 : hello3.cpp ;
114 t
.write("hello1.cpp", "int main() {}\n")
115 t
.write("hello2.cpp", "int main() {}\n")
116 t
.write("hello3.cpp", "int main() {}\n")
118 t
.run_build_system([t
.adjust_suffix("hello1.obj"), t
.adjust_suffix(
120 t
.expect_addition("bin/$toolset/debug*/hello1.obj")
121 t
.expect_addition("bin/$toolset/debug*/hello2.obj")
122 t
.expect_nothing_more()
127 ###############################################################################
129 # test_building_multiple_files_with_the_same_name()
130 # -------------------------------------------------
132 ###############################################################################
134 def test_building_multiple_files_with_the_same_name():
135 t
= BoostBuild
.Tester(use_test_config
=False)
137 t
.write("jamroot.jam", """\
138 exe hello : hello.cpp ;
139 exe hello2 : hello.cpp ;
142 t
.write("hello.cpp", "int main() {}\n")
143 t
.write("sub/jamfile.jam", """
144 exe hello : hello.cpp ;
145 exe hello2 : hello.cpp ;
146 exe sub : hello.cpp ;
148 t
.write("sub/hello.cpp", "int main() {}\n")
150 t
.run_build_system([t
.adjust_suffix("hello.obj")])
151 t
.expect_output_lines("*depends on itself*", False)
152 t
.expect_addition("bin/$toolset/debug*/hello.obj")
153 t
.expect_addition("sub/bin/$toolset/debug*/hello.obj")
154 t
.expect_nothing_more()
159 ###############################################################################
164 ###############################################################################
166 test_building_file_from_specific_project()
167 test_building_file_from_specific_target()
168 test_building_missing_file_from_specific_target()
169 test_building_multiple_files_with_different_names()
170 test_building_multiple_files_with_the_same_name()