]>
Commit | Line | Data |
---|---|---|
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 | ||
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 | ||
b32b8144 FG |
25 | t.expect_addition("bin/$toolset/debug*/a.obj") |
26 | t.expect_content("bin/$toolset/debug*/a.obj", """\ | |
11fdf7f2 | 27 | $toolset/debug* |
7c673cae FG |
28 | a.cpp |
29 | """) | |
30 | ||
b32b8144 FG |
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" | |
7c673cae FG |
38 | ) |
39 | ||
b32b8144 FG |
40 | t.expect_addition("lib/bin/$toolset/debug*/b.obj") |
41 | t.expect_content("lib/bin/$toolset/debug*/b.obj", """\ | |
11fdf7f2 | 42 | $toolset/debug* |
7c673cae FG |
43 | lib/b.cpp |
44 | """) | |
45 | ||
b32b8144 FG |
46 | t.expect_addition("lib/bin/$toolset/debug*/m.exe") |
47 | t.expect_content("lib/bin/$toolset/debug*/m.exe", """\ | |
11fdf7f2 | 48 | $toolset/debug* |
b32b8144 | 49 | lib/bin/$toolset/debug*/b.obj lib2/bin/$toolset/debug*/c.obj |
7c673cae FG |
50 | """) |
51 | ||
b32b8144 FG |
52 | t.expect_addition("lib2/bin/$toolset/debug*/c.obj") |
53 | t.expect_content("lib2/bin/$toolset/debug*/c.obj", """\ | |
11fdf7f2 | 54 | $toolset/debug* |
7c673cae FG |
55 | lib2/c.cpp |
56 | """) | |
57 | ||
b32b8144 FG |
58 | t.expect_addition("lib2/bin/$toolset/debug*/d.obj") |
59 | t.expect_content("lib2/bin/$toolset/debug*/d.obj", """\ | |
11fdf7f2 | 60 | $toolset/debug* |
7c673cae FG |
61 | lib2/d.cpp |
62 | """) | |
63 | ||
b32b8144 FG |
64 | t.expect_addition("lib2/bin/$toolset/debug*/l.exe") |
65 | t.expect_content("lib2/bin/$toolset/debug*/l.exe", """\ | |
11fdf7f2 | 66 | $toolset/debug* |
b32b8144 | 67 | lib2/bin/$toolset/debug*/c.obj bin/$toolset/debug*/a.obj |
7c673cae FG |
68 | """) |
69 | ||
b32b8144 FG |
70 | t.expect_addition("lib2/helper/bin/$toolset/debug*/e.obj") |
71 | t.expect_content("lib2/helper/bin/$toolset/debug*/e.obj", """\ | |
11fdf7f2 | 72 | $toolset/debug* |
7c673cae FG |
73 | lib2/helper/e.cpp |
74 | """) | |
75 | ||
b32b8144 FG |
76 | t.expect_addition("lib3/bin/$toolset/debug*/f.obj") |
77 | t.expect_content("lib3/bin/$toolset/debug*/f.obj", """\ | |
11fdf7f2 | 78 | $toolset/debug* |
b32b8144 | 79 | lib3/f.cpp lib2/helper/bin/$toolset/debug*/e.obj |
7c673cae FG |
80 | """) |
81 | ||
82 | t.touch("a.cpp") | |
83 | t.run_build_system() | |
b32b8144 FG |
84 | t.expect_touch(["bin/$toolset/debug*/a.obj", |
85 | "bin/$toolset/debug*/a.exe", | |
86 | "lib2/bin/$toolset/debug*/l.exe"]) | |
7c673cae FG |
87 | |
88 | t.run_build_system(["release", "optimization=off,speed"]) | |
b32b8144 FG |
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"]) | |
7c673cae FG |
93 | |
94 | t.run_build_system(["--clean-all"]) | |
b32b8144 FG |
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"]) | |
7c673cae FG |
103 | |
104 | # Now test target ids in command line. | |
105 | t.set_tree("project-test3") | |
106 | t.run_build_system(["lib//b.obj"]) | |
b32b8144 | 107 | t.expect_addition("lib/bin/$toolset/debug*/b.obj") |
7c673cae FG |
108 | t.expect_nothing_more() |
109 | ||
110 | t.run_build_system(["--clean", "lib//b.obj"]) | |
b32b8144 | 111 | t.expect_removal("lib/bin/$toolset/debug*/b.obj") |
7c673cae FG |
112 | t.expect_nothing_more() |
113 | ||
114 | t.run_build_system(["lib//b.obj"]) | |
b32b8144 | 115 | t.expect_addition("lib/bin/$toolset/debug*/b.obj") |
7c673cae FG |
116 | t.expect_nothing_more() |
117 | ||
118 | t.run_build_system(["release", "lib2/helper//e.obj", "/lib3//f.obj"]) | |
b32b8144 FG |
119 | t.expect_addition("lib2/helper/bin/$toolset/release*/e.obj") |
120 | t.expect_addition("lib3/bin/$toolset/release*/f.obj") | |
7c673cae FG |
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"]) | |
b32b8144 | 126 | t.expect_addition("lib2/bin/$toolset/debug*/" * |
7c673cae | 127 | BoostBuild.List("c.obj d.obj l.exe")) |
b32b8144 | 128 | t.expect_addition("bin/$toolset/debug*/a.obj") |
7c673cae FG |
129 | t.expect_nothing_more() |
130 | ||
131 | t.run_build_system(["lib"]) | |
b32b8144 | 132 | t.expect_addition("lib/bin/$toolset/debug*/" * |
7c673cae FG |
133 | BoostBuild.List("b.obj m.exe")) |
134 | t.expect_nothing_more() | |
135 | ||
136 | t.cleanup() |