]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/test/explicit.py
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / tools / build / test / explicit.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.txt or https://www.bfgroup.xyz/b2/LICENSE.txt)
6
7 import BoostBuild
8
9 t = BoostBuild.Tester(use_test_config=False)
10
11 t.write("jamroot.jam", """\
12 exe hello : hello.cpp ;
13 exe hello2 : hello.cpp ;
14 explicit hello2 ;
15 """)
16
17 t.write("hello.cpp", "int main() {}\n")
18
19 t.run_build_system()
20 t.ignore("*.tds")
21 t.expect_addition(BoostBuild.List("bin/$toolset/debug*/hello") * \
22 [".exe", ".obj"])
23 t.ignore_addition("bin/*/hello.rsp")
24 t.expect_nothing_more()
25
26 t.run_build_system(["hello2"])
27 t.expect_addition("bin/$toolset/debug*/hello2.exe")
28
29 t.rm(".")
30
31
32 # Test that 'explicit' used in a helper rule applies to the current project, and
33 # not to the Jamfile where the helper rule is defined.
34 t.write("jamroot.jam", """\
35 rule myinstall ( name : target )
36 {
37 install $(name)-bin : $(target) ;
38 explicit $(name)-bin ;
39 alias $(name) : $(name)-bin ;
40 }
41 """)
42
43 t.write("sub/a.cpp", "\n")
44 t.write("sub/jamfile.jam", "myinstall dist : a.cpp ;")
45
46 t.run_build_system(subdir="sub")
47 t.expect_addition("sub/dist-bin/a.cpp")
48
49 t.rm("sub/dist-bin")
50
51 t.write("sub/jamfile.jam", """\
52 myinstall dist : a.cpp ;
53 explicit dist ;
54 """)
55
56 t.run_build_system(subdir="sub")
57 t.expect_nothing_more()
58
59 t.cleanup()