Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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