]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/test/remove_requirement.py
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / tools / build / test / remove_requirement.py
1 #!/usr/bin/python
2
3 # Copyright (C) Vladimir Prus 2006.
4 # Distributed under the Boost Software License, Version 1.0. (See
5 # accompanying file LICENSE_1_0.txt or copy at
6 # http://www.boost.org/LICENSE_1_0.txt)
7
8 import BoostBuild
9
10 t = BoostBuild.Tester(use_test_config=False)
11
12
13 t.write("jamroot.jam", """
14 project : requirements <threading>multi <variant>debug:<link>static ;
15 # Force link to be relevant
16 project : requirements <link>shared:<define>TEST_DLL ;
17
18 build-project sub ;
19 build-project sub2 ;
20 build-project sub3 ;
21 build-project sub4 ;
22 """)
23
24 t.write("sub/jamfile.jam", """
25 exe hello : hello.cpp : -<threading>multi ;
26 """)
27
28 t.write("sub/hello.cpp", """
29 int main() {}
30 """)
31
32 t.write("sub2/jamfile.jam", """
33 project : requirements -<threading>multi ;
34 exe hello : hello.cpp ;
35 """)
36
37 t.write("sub2/hello.cpp", """
38 int main() {}
39 """)
40
41 t.write("sub3/hello.cpp", """
42 int main() {}
43 """)
44
45 t.write("sub3/jamfile.jam", """
46 exe hello : hello.cpp : "-<variant>debug:<link>static" ;
47 """)
48
49 t.write("sub4/hello.cpp", """
50 int main() {}
51 """)
52
53 t.write("sub4/jamfile.jam", """
54 project : requirements "-<variant>debug:<link>static" ;
55 exe hello : hello.cpp ;
56 """)
57
58 t.run_build_system()
59
60 t.expect_addition("sub/bin/$toolset/debug*/link-static*/hello.exe")
61 t.expect_addition("sub2/bin/$toolset/debug*/link-static*/hello.exe")
62 t.expect_addition("sub3/bin/$toolset/debug*/threading-multi*/hello.exe")
63 t.expect_addition("sub4/bin/$toolset/debug*/threading-multi*/hello.exe")
64
65 t.rm(".")
66
67 # Now test that path requirements can be removed as well.
68 t.write("jamroot.jam", """
69 build-project sub ;
70 """)
71
72 t.write("sub/jamfile.jam", """
73 project : requirements <include>broken ;
74 exe hello : hello.cpp : -<include>broken ;
75 """)
76
77 t.write("sub/hello.cpp", """
78 #include "math.h"
79 int main() {}
80 """)
81
82 t.write("sub/broken/math.h", """
83 Broken
84 """)
85
86
87 t.run_build_system()
88
89 t.expect_addition("sub/bin/$toolset/debug*/hello.exe")
90
91 t.cleanup()