]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/test/tag.py
3 # Copyright (C) 2003. Pedro Ferreira
4 # Distributed under the Boost Software License, Version 1.0.
5 # (See accompanying file LICENSE_1_0.txt or copy at
6 # http://www.boost.org/LICENSE_1_0.txt)
11 ###############################################################################
13 # test_folder_with_dot_in_name()
14 # ------------------------------
16 ###############################################################################
18 def test_folder_with_dot_in_name(t
):
20 Regression test: the 'tag' feature did not work in directories that had a
24 t
.write("version-1.32.0/jamroot.jam", """\
25 project test : requirements <tag>@$(__name__).tag ;
27 rule tag ( name : type ? : property-set )
29 # Do nothing, just make sure the rule is invoked OK.
30 ECHO The tag rule has been invoked. ;
34 t
.write("version-1.32.0/a.cpp", "int main() {}\n")
36 t
.run_build_system(subdir
="version-1.32.0")
37 t
.expect_addition("version-1.32.0/bin/$toolset/debug*/a.exe")
38 t
.expect_output_lines("The tag rule has been invoked.")
41 ###############################################################################
46 ###############################################################################
48 def test_tag_property(t
):
49 """Basic tag property test."""
51 t
.write("jamroot.jam", """\
52 import virtual-target ;
54 rule tag ( name : type ? : property-set )
57 switch [ $(property-set).get <variant> ]
59 case debug : tags += d ;
60 case release : tags += r ;
62 switch [ $(property-set).get <link> ]
64 case shared : tags += s ;
65 case static : tags += t ;
69 return [ virtual-target.add-prefix-and-suffix $(name)_$(tags:J="")
70 : $(type) : $(property-set) ] ;
74 # Test both fully-qualified and local name of the rule
75 exe a : a.cpp : <tag>@$(__name__).tag ;
76 lib b : a.cpp : <tag>@tag ;
83 __declspec (dllexport) void x () {}
88 BoostBuild
.List("bin/$toolset/debug*/a_ds.exe") +
89 BoostBuild
.List("bin/$toolset/debug*/b_ds.dll") +
90 BoostBuild
.List("c/a_ds.exe") +
91 BoostBuild
.List("bin/$toolset/release*/a_rs.exe") +
92 BoostBuild
.List("bin/$toolset/release*/b_rs.dll") +
93 BoostBuild
.List("c/a_rs.exe") +
94 BoostBuild
.List("bin/$toolset/debug/link-static*/a_dt.exe") +
95 BoostBuild
.List("bin/$toolset/debug/link-static*/b_dt.lib") +
96 BoostBuild
.List("c/a_dt.exe") +
97 BoostBuild
.List("bin/$toolset/release/link-static*/a_rt.exe") +
98 BoostBuild
.List("bin/$toolset/release/link-static*/b_rt.lib") +
99 BoostBuild
.List("c/a_rt.exe"))
101 variants
= ["debug", "release", "link=static,shared"]
103 t
.run_build_system(variants
)
104 t
.expect_addition(file_list
)
106 t
.run_build_system(variants
+ ["clean"])
107 t
.expect_removal(file_list
)
110 ###############################################################################
115 ###############################################################################
117 t
= BoostBuild
.Tester(use_test_config
=False)
120 test_folder_with_dot_in_name(t
)