]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/tools/build/test/project_test3.py
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / boost / tools / build / test / project_test3.py
CommitLineData
7c673cae
FG
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
9import BoostBuild
10import os
11
12t = BoostBuild.Tester(translate_suffixes=0)
13
14# First check some startup.
15t.set_tree("project-test3")
16os.remove("jamroot.jam")
17t.run_build_system(status=1)
18
19t.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
22t.set_tree("project-test3")
23t.run_build_system()
24
b32b8144
FG
25t.expect_addition("bin/$toolset/debug*/a.obj")
26t.expect_content("bin/$toolset/debug*/a.obj", """\
11fdf7f2 27$toolset/debug*
7c673cae
FG
28a.cpp
29""")
30
b32b8144
FG
31t.expect_addition("bin/$toolset/debug*/a.exe")
32t.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"
7c673cae
FG
38)
39
b32b8144
FG
40t.expect_addition("lib/bin/$toolset/debug*/b.obj")
41t.expect_content("lib/bin/$toolset/debug*/b.obj", """\
11fdf7f2 42$toolset/debug*
7c673cae
FG
43lib/b.cpp
44""")
45
b32b8144
FG
46t.expect_addition("lib/bin/$toolset/debug*/m.exe")
47t.expect_content("lib/bin/$toolset/debug*/m.exe", """\
11fdf7f2 48$toolset/debug*
b32b8144 49lib/bin/$toolset/debug*/b.obj lib2/bin/$toolset/debug*/c.obj
7c673cae
FG
50""")
51
b32b8144
FG
52t.expect_addition("lib2/bin/$toolset/debug*/c.obj")
53t.expect_content("lib2/bin/$toolset/debug*/c.obj", """\
11fdf7f2 54$toolset/debug*
7c673cae
FG
55lib2/c.cpp
56""")
57
b32b8144
FG
58t.expect_addition("lib2/bin/$toolset/debug*/d.obj")
59t.expect_content("lib2/bin/$toolset/debug*/d.obj", """\
11fdf7f2 60$toolset/debug*
7c673cae
FG
61lib2/d.cpp
62""")
63
b32b8144
FG
64t.expect_addition("lib2/bin/$toolset/debug*/l.exe")
65t.expect_content("lib2/bin/$toolset/debug*/l.exe", """\
11fdf7f2 66$toolset/debug*
b32b8144 67lib2/bin/$toolset/debug*/c.obj bin/$toolset/debug*/a.obj
7c673cae
FG
68""")
69
b32b8144
FG
70t.expect_addition("lib2/helper/bin/$toolset/debug*/e.obj")
71t.expect_content("lib2/helper/bin/$toolset/debug*/e.obj", """\
11fdf7f2 72$toolset/debug*
7c673cae
FG
73lib2/helper/e.cpp
74""")
75
b32b8144
FG
76t.expect_addition("lib3/bin/$toolset/debug*/f.obj")
77t.expect_content("lib3/bin/$toolset/debug*/f.obj", """\
11fdf7f2 78$toolset/debug*
b32b8144 79lib3/f.cpp lib2/helper/bin/$toolset/debug*/e.obj
7c673cae
FG
80""")
81
82t.touch("a.cpp")
83t.run_build_system()
b32b8144
FG
84t.expect_touch(["bin/$toolset/debug*/a.obj",
85 "bin/$toolset/debug*/a.exe",
86 "lib2/bin/$toolset/debug*/l.exe"])
7c673cae
FG
87
88t.run_build_system(["release", "optimization=off,speed"])
b32b8144
FG
89t.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"])
7c673cae
FG
93
94t.run_build_system(["--clean-all"])
b32b8144
FG
95t.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"])
7c673cae
FG
103
104# Now test target ids in command line.
105t.set_tree("project-test3")
106t.run_build_system(["lib//b.obj"])
b32b8144 107t.expect_addition("lib/bin/$toolset/debug*/b.obj")
7c673cae
FG
108t.expect_nothing_more()
109
110t.run_build_system(["--clean", "lib//b.obj"])
b32b8144 111t.expect_removal("lib/bin/$toolset/debug*/b.obj")
7c673cae
FG
112t.expect_nothing_more()
113
114t.run_build_system(["lib//b.obj"])
b32b8144 115t.expect_addition("lib/bin/$toolset/debug*/b.obj")
7c673cae
FG
116t.expect_nothing_more()
117
118t.run_build_system(["release", "lib2/helper//e.obj", "/lib3//f.obj"])
b32b8144
FG
119t.expect_addition("lib2/helper/bin/$toolset/release*/e.obj")
120t.expect_addition("lib3/bin/$toolset/release*/f.obj")
7c673cae
FG
121t.expect_nothing_more()
122
123# Test project ids in command line work as well.
124t.set_tree("project-test3")
125t.run_build_system(["/lib2"])
b32b8144 126t.expect_addition("lib2/bin/$toolset/debug*/" *
7c673cae 127 BoostBuild.List("c.obj d.obj l.exe"))
b32b8144 128t.expect_addition("bin/$toolset/debug*/a.obj")
7c673cae
FG
129t.expect_nothing_more()
130
131t.run_build_system(["lib"])
b32b8144 132t.expect_addition("lib/bin/$toolset/debug*/" *
7c673cae
FG
133 BoostBuild.List("b.obj m.exe"))
134t.expect_nothing_more()
135
136t.cleanup()