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:
1.6 KB
|
Line | |
---|
1 | #!/usr/bin/python |
---|
2 | |
---|
3 | # Copyright 2003 Dave Abrahams |
---|
4 | # Copyright 2003 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 | |
---|
8 | from BoostBuild import Tester, List |
---|
9 | t = Tester() |
---|
10 | |
---|
11 | # Test that top-level project can affect build dir |
---|
12 | t.write("project-root.jam", "") |
---|
13 | t.write("Jamfile", """ |
---|
14 | |
---|
15 | exe a : a.cpp ; |
---|
16 | exe b : b.cpp ; |
---|
17 | exe c : c.cpp ; |
---|
18 | |
---|
19 | alias bin1 : a ; |
---|
20 | alias bin2 : a b ; |
---|
21 | |
---|
22 | alias src : s.cpp ; |
---|
23 | exe hello : hello.cpp src ; |
---|
24 | |
---|
25 | """) |
---|
26 | t.write("a.cpp", "int main() { return 0; }\n") |
---|
27 | t.copy("a.cpp", "b.cpp") |
---|
28 | t.copy("a.cpp", "c.cpp") |
---|
29 | t.copy("a.cpp", "hello.cpp") |
---|
30 | t.write("s.cpp", "") |
---|
31 | |
---|
32 | # Check that targets to which "bin1" refers are updated, |
---|
33 | # and only those. |
---|
34 | t.run_build_system("bin1") |
---|
35 | t.ignore("*.tds") |
---|
36 | t.expect_addition(List("bin/$toolset/debug/") * "a.exe a.obj") |
---|
37 | t.expect_nothing_more() |
---|
38 | |
---|
39 | # Try again with "bin2" |
---|
40 | t.run_build_system("bin2") |
---|
41 | t.ignore("*.tds") |
---|
42 | t.expect_addition(List("bin/$toolset/debug/") * "b.exe b.obj") |
---|
43 | t.expect_nothing_more() |
---|
44 | |
---|
45 | # Try building everything, making sure 'hello' target is |
---|
46 | # created |
---|
47 | t.run_build_system() |
---|
48 | t.ignore("*.tds") |
---|
49 | t.expect_addition("bin/$toolset/debug/hello.exe") |
---|
50 | |
---|
51 | # Regression test. |
---|
52 | # Check if usage requirements are propagated via "alias" |
---|
53 | |
---|
54 | t.write("l.cpp", """ |
---|
55 | void |
---|
56 | #if defined(_WIN32) |
---|
57 | __declspec(dllexport) |
---|
58 | #endif |
---|
59 | foo() {} |
---|
60 | |
---|
61 | """) |
---|
62 | |
---|
63 | t.write("Jamfile", """ |
---|
64 | lib l : l.cpp : : : <define>WANT_MAIN ; |
---|
65 | alias la : l ; |
---|
66 | exe main : main.cpp la ; |
---|
67 | """) |
---|
68 | |
---|
69 | t.write("main.cpp", """ |
---|
70 | #ifdef WANT_MAIN |
---|
71 | int main() { return 0; } |
---|
72 | #endif |
---|
73 | |
---|
74 | """) |
---|
75 | |
---|
76 | t.write("project-root.jam", "") |
---|
77 | |
---|
78 | t.run_build_system() |
---|
79 | |
---|
80 | t.cleanup() |
---|
Note: See
TracBrowser
for help on using the repository browser.