]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/test/suffix.py
update sources to v12.2.3
[ceph.git] / ceph / src / boost / tools / build / test / suffix.py
1 #!/usr/bin/python
2
3 # Copyright 2003, 2004 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 import BoostBuild
8
9 t = BoostBuild.Tester()
10
11 # Regression test: when staging V2 used to change suffixes on targets
12 # corresponding to real files.
13 t.write("jamfile.jam", """
14 import type : register ;
15 register A : a1 a2 a3 ;
16 stage a : a.a3 ;
17 """)
18
19 t.write("jamroot.jam", "")
20 t.write("a.a3", "")
21
22 t.run_build_system()
23 t.expect_addition("a/a.a3");
24
25 # Regression test: we should be able to specify empty suffix for derived target
26 # type, even if base type has non-empty suffix.
27 t.write("a.cpp", "")
28
29 t.write("suffixes.jam", """
30 import type ;
31 import generators ;
32 import common ;
33
34 type.register First : first : ;
35 type.register Second : "" : First ;
36
37 generators.register-standard $(__name__).second : CPP : Second ;
38
39 rule second
40 {
41 TOUCH on $(<) = [ common.file-creation-command ] ;
42 }
43
44 actions second
45 {
46 $(TOUCH) $(<)
47 }
48 """)
49
50 t.write("suffixes.py", """
51 import b2.build.type as type
52 import b2.build.generators as generators
53 import b2.tools.common as common
54
55 from b2.manager import get_manager
56
57 type.register("First", ["first"])
58 type.register("Second", [""], "First")
59
60 generators.register_standard("suffixes.second", ["CPP"], ["Second"])
61
62 get_manager().engine().register_action("suffixes.second",
63 "%s $(<)" % common.file_creation_command())
64
65 """)
66
67 t.write("jamroot.jam", """
68 import suffixes ;
69 """)
70
71 t.write("jamfile.jam", """
72 second a : a.cpp ;
73 """)
74
75 t.run_build_system()
76 t.expect_addition("bin/$toolset/debug*/a")
77
78 t.cleanup()