Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/tools/build/v2/test/project_test3.py @ 32

Last change on this file since 32 was 29, checked in by landauf, 17 years ago

updated boost from 1_33_1 to 1_34_1

File size: 4.0 KB
Line 
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 http://www.boost.org/LICENSE_1_0.txt)
7
8from BoostBuild import Tester, List
9import os
10from string import strip
11
12t = Tester(translate_suffixes=0)
13
14# First check some startup
15t.set_tree("project-test3")
16os.remove("project-root.jam")
17t.run_build_system(status=1, stdout=
18"""error: Could not find parent for project at '.'
19error: Did not find Jamfile or project-root.jam in any parent directory.
20
21""")
22
23t.set_tree("project-test3")
24t.run_build_system()
25
26t.expect_addition("bin/$toolset/debug/a.obj")
27t.expect_content("bin/$toolset/debug/a.obj",
28"""$toolset/debug
29a.cpp
30""")
31
32t.expect_addition("bin/$toolset/debug/a.exe")
33t.expect_content("bin/$toolset/debug/a.exe",
34"$toolset/debug\n" +
35"bin/$toolset/debug/a.obj lib/bin/$toolset/debug/b.obj " +
36"lib2/bin/$toolset/debug/c.obj lib2/bin/$toolset/debug/d.obj " +
37"lib2/helper/bin/$toolset/debug/e.obj " +
38"lib3/bin/$toolset/debug/f.obj\n"
39)
40
41t.expect_addition("lib/bin/$toolset/debug/b.obj")
42t.expect_content("lib/bin/$toolset/debug/b.obj",
43"""$toolset/debug
44lib/b.cpp
45""")
46
47t.expect_addition("lib/bin/$toolset/debug/m.exe")
48t.expect_content("lib/bin/$toolset/debug/m.exe",
49"""$toolset/debug
50lib/bin/$toolset/debug/b.obj lib2/bin/$toolset/debug/c.obj
51""")
52
53t.expect_addition("lib2/bin/$toolset/debug/c.obj")
54t.expect_content("lib2/bin/$toolset/debug/c.obj",
55"""$toolset/debug
56lib2/c.cpp
57""")
58
59t.expect_addition("lib2/bin/$toolset/debug/d.obj")
60t.expect_content("lib2/bin/$toolset/debug/d.obj",
61"""$toolset/debug
62lib2/d.cpp
63""")
64
65t.expect_addition("lib2/bin/$toolset/debug/l.exe")
66t.expect_content("lib2/bin/$toolset/debug/l.exe",
67"""$toolset/debug
68lib2/bin/$toolset/debug/c.obj bin/$toolset/debug/a.obj
69""")
70
71t.expect_addition("lib2/helper/bin/$toolset/debug/e.obj")
72t.expect_content("lib2/helper/bin/$toolset/debug/e.obj",
73"""$toolset/debug
74lib2/helper/e.cpp
75""")
76
77t.expect_addition("lib3/bin/$toolset/debug/f.obj")
78t.expect_content("lib3/bin/$toolset/debug/f.obj",
79"""$toolset/debug
80lib3/f.cpp lib2/helper/bin/$toolset/debug/e.obj
81""")
82                 
83
84t.touch("a.cpp")
85t.run_build_system()
86t.expect_touch(["bin/$toolset/debug/a.obj",
87                "bin/$toolset/debug/a.exe",
88                "lib2/bin/$toolset/debug/l.exe"])
89
90
91t.run_build_system(extra_args="release optimization=off,speed")
92t.expect_addition(["bin/$toolset/release/a.exe", 
93                  "bin/$toolset/release/a.obj", 
94                  "bin/$toolset/release/optimization-off/a.exe", 
95                  "bin/$toolset/release/optimization-off/a.obj"])
96
97t.run_build_system(extra_args='--clean-all')
98t.expect_removal(["bin/$toolset/debug/a.obj",
99                 "bin/$toolset/debug/a.exe",
100                 "lib/bin/$toolset/debug/b.obj",
101                 "lib/bin/$toolset/debug/m.exe",
102                 "lib2/bin/$toolset/debug/c.obj",
103                 "lib2/bin/$toolset/debug/d.obj",
104                 "lib2/bin/$toolset/debug/l.exe",
105                 "lib3/bin/$toolset/debug/f.obj",
106                  ])
107
108# Now test target ids in command line
109t.set_tree("project-test3")
110t.run_build_system("lib//b.obj")
111t.expect_addition("lib/bin/$toolset/debug/b.obj")
112t.expect_nothing_more()
113
114t.run_build_system("--clean lib//b.obj")
115t.expect_removal("lib/bin/$toolset/debug/b.obj")
116t.expect_nothing_more()
117
118t.run_build_system("lib//b.obj")
119t.expect_addition("lib/bin/$toolset/debug/b.obj")
120t.expect_nothing_more()
121
122
123t.run_build_system("release lib2/helper//e.obj /lib3//f.obj")
124t.expect_addition("lib2/helper/bin/$toolset/release/e.obj")
125t.expect_addition("lib3/bin/$toolset/release/f.obj")
126t.expect_nothing_more()
127
128# Test project ids in command line work as well
129t.set_tree("project-test3")
130t.run_build_system("/lib2")
131t.expect_addition("lib2/bin/$toolset/debug/" * List("c.obj d.obj l.exe"))
132t.expect_addition("bin/$toolset/debug/a.obj")
133t.expect_nothing_more()
134
135
136t.run_build_system("lib")
137t.expect_addition("lib/bin/$toolset/debug/" * List("b.obj m.exe"))
138t.expect_nothing_more()
139
140t.cleanup()
Note: See TracBrowser for help on using the repository browser.