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