]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/tools/build/test/expansion.py
update sources to v12.2.3
[ceph.git] / ceph / src / boost / tools / build / test / expansion.py
CommitLineData
7c673cae
FG
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
8import BoostBuild
9
10t = BoostBuild.Tester(use_test_config=False)
11
12t.write("a.cpp", """
13#ifdef CF_IS_OFF
14int main() {}
15#endif
16""")
17
18t.write("b.cpp", """
19#ifdef CF_1
20int main() {}
21#endif
22""")
23
24t.write("c.cpp", """
25#ifdef FOO
26int main() {}
27#endif
28""")
29
30t.write("jamfile.jam", """
31# See if default value of composite feature 'cf' will be expanded to
32# <define>CF_IS_OFF.
33exe a : a.cpp ;
34
35# See if subfeature in requirements in expanded.
36exe b : b.cpp : <cf>on-1 ;
37
38# See if conditional requirements are recursively expanded.
39exe c : c.cpp : <toolset>$toolset:<variant>release <variant>release:<define>FOO
40 ;
41""")
42
43t.write("jamroot.jam", """
44import feature ;
45feature.feature cf : off on : composite incidental ;
46feature.compose <cf>off : <define>CF_IS_OFF ;
47feature.subfeature cf on : version : 1 2 : composite optional incidental ;
48feature.compose <cf-on:version>1 : <define>CF_1 ;
49""")
50
51t.expand_toolset("jamfile.jam")
52
53t.run_build_system()
b32b8144
FG
54t.expect_addition(["bin/$toolset/debug*/a.exe",
55 "bin/$toolset/debug*/b.exe",
56 "bin/$toolset/release*/c.exe"])
7c673cae
FG
57
58t.rm("bin")
59
60
61# Test for issue BB60.
62
63t.write("test.cpp", """
64#include "header.h"
65int main() {}
66""")
67
68t.write("jamfile.jam", """
69project : requirements <toolset>$toolset:<include>foo ;
70exe test : test.cpp : <toolset>$toolset ;
71""")
72
73t.expand_toolset("jamfile.jam")
74t.write("foo/header.h", "\n")
75t.write("jamroot.jam", "")
76
77t.run_build_system()
b32b8144 78t.expect_addition("bin/$toolset/debug*/test.exe")
7c673cae
FG
79
80t.cleanup()