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