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.1 KB
|
Line | |
---|
1 | #!/usr/bin/python |
---|
2 | |
---|
3 | # Test conditional properties |
---|
4 | |
---|
5 | from BoostBuild import Tester, List |
---|
6 | import os |
---|
7 | from string import strip |
---|
8 | |
---|
9 | t = Tester() |
---|
10 | |
---|
11 | # Arrange a project which will build only if |
---|
12 | # 'a.cpp' is compiled with "STATIC" define. |
---|
13 | t.write("project-root.jam", "import gcc ;") |
---|
14 | t.write("a.cpp", """ |
---|
15 | #ifdef STATIC |
---|
16 | int main() { return 0; } |
---|
17 | #endif |
---|
18 | """) |
---|
19 | t.write("Jamfile", "exe a : a.cpp : <link>static:<define>STATIC ;") |
---|
20 | t.run_build_system("link=static") |
---|
21 | t.expect_addition("bin/$toolset/debug/link-static/a.exe") |
---|
22 | |
---|
23 | t.write("Jamfile", """ |
---|
24 | project : requirements <link>static:<define>STATIC ; |
---|
25 | exe a : a.cpp ; |
---|
26 | """) |
---|
27 | t.rm("bin") |
---|
28 | t.run_build_system("link=static") |
---|
29 | t.expect_addition("bin/$toolset/debug/link-static/a.exe") |
---|
30 | |
---|
31 | # Regression test for a bug found by Ali Azarbayejani. |
---|
32 | # Conditionals inside usage requirement were not evaluated. |
---|
33 | # This breaks |
---|
34 | |
---|
35 | t.write("Jamfile", """ |
---|
36 | lib l : l.cpp : : : <link>static:<define>STATIC ; |
---|
37 | exe a : a.cpp l ; |
---|
38 | """) |
---|
39 | t.write("l.cpp", "") |
---|
40 | t.write("l.cpp", """ |
---|
41 | int i; |
---|
42 | """) |
---|
43 | |
---|
44 | t.rm("bin") |
---|
45 | t.run_build_system("link=static") |
---|
46 | t.expect_addition("bin/$toolset/debug/link-static/a.exe") |
---|
47 | |
---|
48 | |
---|
49 | |
---|
50 | t.cleanup() |
---|
Note: See
TracBrowser
for help on using the repository browser.