]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/test/expansion.py
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / tools / build / test / expansion.py
1 #!/usr/bin/python
2
3 # Copyright 2003 Vladimir Prus
4 # Distributed under the Boost Software License, Version 1.0.
5 # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
6
7
8 import BoostBuild
9
10 t = BoostBuild.Tester(use_test_config=False)
11
12 t.write("a.cpp", """
13 #ifdef CF_IS_OFF
14 int main() {}
15 #endif
16 """)
17
18 t.write("b.cpp", """
19 #ifdef CF_1
20 int main() {}
21 #endif
22 """)
23
24 t.write("c.cpp", """
25 #ifdef FOO
26 int main() {}
27 #endif
28 """)
29
30 t.write("jamfile.jam", """
31 # See if default value of composite feature 'cf' will be expanded to
32 # <define>CF_IS_OFF.
33 exe a : a.cpp ;
34
35 # See if subfeature in requirements in expanded.
36 exe b : b.cpp : <cf>on-1 ;
37
38 # See if conditional requirements are recursively expanded.
39 exe c : c.cpp : <toolset>$toolset:<variant>release <variant>release:<define>FOO
40 ;
41 """)
42
43 t.write("jamroot.jam", """
44 import feature ;
45 feature.feature cf : off on : composite incidental ;
46 feature.compose <cf>off : <define>CF_IS_OFF ;
47 feature.subfeature cf on : version : 1 2 : composite optional incidental ;
48 feature.compose <cf-on:version>1 : <define>CF_1 ;
49 """)
50
51 t.expand_toolset("jamfile.jam")
52
53 t.run_build_system()
54 t.expect_addition(["bin/$toolset/debug/a.exe",
55 "bin/$toolset/debug/b.exe",
56 "bin/$toolset/release/c.exe"])
57
58 t.rm("bin")
59
60
61 # Test for issue BB60.
62
63 t.write("test.cpp", """
64 #include "header.h"
65 int main() {}
66 """)
67
68 t.write("jamfile.jam", """
69 project : requirements <toolset>$toolset:<include>foo ;
70 exe test : test.cpp : <toolset>$toolset ;
71 """)
72
73 t.expand_toolset("jamfile.jam")
74 t.write("foo/header.h", "\n")
75 t.write("jamroot.jam", "")
76
77 t.run_build_system()
78 t.expect_addition("bin/$toolset/debug/test.exe")
79
80 t.cleanup()