]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/test/project_test3.py
update sources to v12.2.3
[ceph.git] / ceph / src / boost / tools / build / test / project_test3.py
1 #!/usr/bin/python
2
3 # Copyright 2002, 2003 Dave Abrahams
4 # Copyright 2002, 2003, 2004, 2006 Vladimir Prus
5 # Distributed under the Boost Software License, Version 1.0.
6 # (See accompanying file LICENSE_1_0.txt or copy at
7 # http://www.boost.org/LICENSE_1_0.txt)
8
9 import BoostBuild
10 import os
11
12 t = BoostBuild.Tester(translate_suffixes=0)
13
14 # First check some startup.
15 t.set_tree("project-test3")
16 os.remove("jamroot.jam")
17 t.run_build_system(status=1)
18
19 t.expect_output_lines("error: Could not find parent for project at '.'\n"
20 "error: Did not find Jamfile.jam or Jamroot.jam in any parent directory.")
21
22 t.set_tree("project-test3")
23 t.run_build_system()
24
25 t.expect_addition("bin/$toolset/debug*/a.obj")
26 t.expect_content("bin/$toolset/debug*/a.obj", """\
27 $toolset/debug
28 a.cpp
29 """)
30
31 t.expect_addition("bin/$toolset/debug*/a.exe")
32 t.expect_content("bin/$toolset/debug*/a.exe",
33 "$toolset/debug*\n" +
34 "bin/$toolset/debug*/a.obj lib/bin/$toolset/debug*/b.obj " +
35 "lib2/bin/$toolset/debug*/c.obj lib2/bin/$toolset/debug*/d.obj " +
36 "lib2/helper/bin/$toolset/debug*/e.obj " +
37 "lib3/bin/$toolset/debug*/f.obj\n"
38 )
39
40 t.expect_addition("lib/bin/$toolset/debug*/b.obj")
41 t.expect_content("lib/bin/$toolset/debug*/b.obj", """\
42 $toolset/debug
43 lib/b.cpp
44 """)
45
46 t.expect_addition("lib/bin/$toolset/debug*/m.exe")
47 t.expect_content("lib/bin/$toolset/debug*/m.exe", """\
48 $toolset/debug
49 lib/bin/$toolset/debug*/b.obj lib2/bin/$toolset/debug*/c.obj
50 """)
51
52 t.expect_addition("lib2/bin/$toolset/debug*/c.obj")
53 t.expect_content("lib2/bin/$toolset/debug*/c.obj", """\
54 $toolset/debug
55 lib2/c.cpp
56 """)
57
58 t.expect_addition("lib2/bin/$toolset/debug*/d.obj")
59 t.expect_content("lib2/bin/$toolset/debug*/d.obj", """\
60 $toolset/debug
61 lib2/d.cpp
62 """)
63
64 t.expect_addition("lib2/bin/$toolset/debug*/l.exe")
65 t.expect_content("lib2/bin/$toolset/debug*/l.exe", """\
66 $toolset/debug
67 lib2/bin/$toolset/debug*/c.obj bin/$toolset/debug*/a.obj
68 """)
69
70 t.expect_addition("lib2/helper/bin/$toolset/debug*/e.obj")
71 t.expect_content("lib2/helper/bin/$toolset/debug*/e.obj", """\
72 $toolset/debug
73 lib2/helper/e.cpp
74 """)
75
76 t.expect_addition("lib3/bin/$toolset/debug*/f.obj")
77 t.expect_content("lib3/bin/$toolset/debug*/f.obj", """\
78 $toolset/debug
79 lib3/f.cpp lib2/helper/bin/$toolset/debug*/e.obj
80 """)
81
82 t.touch("a.cpp")
83 t.run_build_system()
84 t.expect_touch(["bin/$toolset/debug*/a.obj",
85 "bin/$toolset/debug*/a.exe",
86 "lib2/bin/$toolset/debug*/l.exe"])
87
88 t.run_build_system(["release", "optimization=off,speed"])
89 t.expect_addition(["bin/$toolset/release/optimization-off*/a.exe",
90 "bin/$toolset/release/optimization-off*/a.obj",
91 "bin/$toolset/release*/a.exe",
92 "bin/$toolset/release*/a.obj"])
93
94 t.run_build_system(["--clean-all"])
95 t.expect_removal(["bin/$toolset/debug*/a.obj",
96 "bin/$toolset/debug*/a.exe",
97 "lib/bin/$toolset/debug*/b.obj",
98 "lib/bin/$toolset/debug*/m.exe",
99 "lib2/bin/$toolset/debug*/c.obj",
100 "lib2/bin/$toolset/debug*/d.obj",
101 "lib2/bin/$toolset/debug*/l.exe",
102 "lib3/bin/$toolset/debug*/f.obj"])
103
104 # Now test target ids in command line.
105 t.set_tree("project-test3")
106 t.run_build_system(["lib//b.obj"])
107 t.expect_addition("lib/bin/$toolset/debug*/b.obj")
108 t.expect_nothing_more()
109
110 t.run_build_system(["--clean", "lib//b.obj"])
111 t.expect_removal("lib/bin/$toolset/debug*/b.obj")
112 t.expect_nothing_more()
113
114 t.run_build_system(["lib//b.obj"])
115 t.expect_addition("lib/bin/$toolset/debug*/b.obj")
116 t.expect_nothing_more()
117
118 t.run_build_system(["release", "lib2/helper//e.obj", "/lib3//f.obj"])
119 t.expect_addition("lib2/helper/bin/$toolset/release*/e.obj")
120 t.expect_addition("lib3/bin/$toolset/release*/f.obj")
121 t.expect_nothing_more()
122
123 # Test project ids in command line work as well.
124 t.set_tree("project-test3")
125 t.run_build_system(["/lib2"])
126 t.expect_addition("lib2/bin/$toolset/debug*/" *
127 BoostBuild.List("c.obj d.obj l.exe"))
128 t.expect_addition("bin/$toolset/debug*/a.obj")
129 t.expect_nothing_more()
130
131 t.run_build_system(["lib"])
132 t.expect_addition("lib/bin/$toolset/debug*/" *
133 BoostBuild.List("b.obj m.exe"))
134 t.expect_nothing_more()
135
136 t.cleanup()