Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/tools/build/v2/test/project_test3.py @ 12

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

added boost

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