]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/test/ordered_include.py
3 # Copyright (c) 2008 Steven Watanabe
5 # Distributed under the Boost Software License, Version 1.0. (See
6 # accompanying file LICENSE_1_0.txt) or copy at
7 # http://www.boost.org/LICENSE_1_0.txt)
11 def test_default_order():
12 tester
= BoostBuild
.Tester(use_test_config
=False)
13 tester
.write("jamroot.jam", """
16 import "class" : new ;
18 obj test : test.cpp : <include>b <include>a ;
21 tester
.write("test.cpp", """
26 tester
.write("a/test.hpp", """
30 tester
.write("b/test.hpp", """
33 tester
.run_build_system()
35 tester
.expect_addition("bin/$toolset/debug*/test.obj")
37 # Check that the dependencies are correct
38 tester
.touch("a/test.hpp")
39 tester
.run_build_system()
40 tester
.expect_touch("bin/$toolset/debug*/test.obj")
41 tester
.expect_nothing_more()
43 tester
.touch("b/test.hpp")
44 tester
.run_build_system()
45 tester
.expect_nothing_more()
49 def test_default_order_mixed():
50 tester
= BoostBuild
.Tester(use_test_config
=False)
51 tester
.write("jamroot.jam", """
54 import "class" : new ;
56 obj test : test.cpp : <include>b <include>a <include>c&&d ;
59 tester
.write("test.cpp", """
64 tester
.write("a/test.hpp", """
68 tester
.write("b/test.hpp", """
71 tester
.run_build_system()
73 tester
.expect_addition("bin/$toolset/debug*/test.obj")
75 # Check that the dependencies are correct
76 tester
.touch("a/test.hpp")
77 tester
.run_build_system()
78 tester
.expect_touch("bin/$toolset/debug*/test.obj")
79 tester
.expect_nothing_more()
81 tester
.touch("b/test.hpp")
82 tester
.run_build_system()
83 tester
.expect_nothing_more()
88 tester
= BoostBuild
.Tester(use_test_config
=False)
89 tester
.write("jamroot.jam", """
90 obj test : test.cpp : <include>a&&b ;
93 tester
.write("test.cpp", """
99 tester
.write("a/test1.hpp", """
102 tester
.write("b/test2.hpp", """
105 tester
.run_build_system()
107 tester
.expect_addition("bin/$toolset/debug*/test.obj")
109 # Check that the dependencies are correct
110 tester
.touch("a/test1.hpp")
111 tester
.run_build_system()
112 tester
.expect_touch("bin/$toolset/debug*/test.obj")
114 tester
.touch("b/test2.hpp")
115 tester
.run_build_system()
116 tester
.expect_touch("bin/$toolset/debug*/test.obj")
121 t
= BoostBuild
.Tester(use_test_config
=False)
122 t
.write("jamroot.jam", """
123 obj test : test.cpp : <include>a&&b ;
125 t
.write("test.cpp", """
129 t
.write("a/test.h", """
131 t
.write("b/test.h", """
132 #error should find a/test.h
138 t
.expect_touch("bin/$toolset/debug*/test.obj")
139 t
.expect_nothing_more()
143 t
.expect_nothing_more()
148 t
= BoostBuild
.Tester(use_test_config
=False)
149 t
.write("jamroot.jam", """
150 obj test : test.cpp : <include>b&&a ;
152 t
.write("test.cpp", """
156 t
.write("a/test.h", """
157 #error should find b/test.h
159 t
.write("b/test.h", """
165 t
.expect_nothing_more()
169 t
.expect_touch("bin/$toolset/debug*/test.obj")
170 t
.expect_nothing_more()
174 def test_order_graph():
175 t
= BoostBuild
.Tester(use_test_config
=False)
176 t
.write("jamroot.jam", """
177 obj test : test.cpp :
186 t
.write("test.cpp", """
193 t
.write("b/test1.h", "")
194 t
.write("a/test1.h", "#error should find b/test1.h\n")
196 t
.write("c/test2.h", "")
197 t
.write("b/test2.h", "#error should find c/test2.h\n")
199 t
.write("e/test3.h", "")
200 t
.write("b/test3.h", "#error should find e/test3.h\n")
202 t
.write("b/test4.h", "")
203 t
.write("d/test4.h", "#error should find b/test4.h\n")
206 t
.expect_addition("bin/$toolset/debug*/test.obj")
210 t
.expect_touch("bin/$toolset/debug*/test.obj")
211 t
.expect_nothing_more()
215 t
.expect_nothing_more()
219 t
.expect_touch("bin/$toolset/debug*/test.obj")
220 t
.expect_nothing_more()
224 t
.expect_nothing_more()
228 t
.expect_touch("bin/$toolset/debug*/test.obj")
229 t
.expect_nothing_more()
233 t
.expect_nothing_more()
237 t
.expect_touch("bin/$toolset/debug*/test.obj")
238 t
.expect_nothing_more()
242 t
.expect_nothing_more()
247 test_default_order_mixed()