Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/tools/build/v2/test/expansion.py @ 32

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: 2.0 KB
Line 
1#!/usr/bin/python
2
3#  Copyright (C) Vladimir Prus 2003. Permission to copy, use, modify, sell and
4#  distribute this software is granted provided this copyright notice appears in
5#  all copies. This software is provided "as is" without express or implied
6#  warranty, and with no claim as to its suitability for any purpose.
7
8#  This file is template for Boost.Build tests. It creates a simple
9#  project that builds one exe from one source, and checks that the exe
10#  is really created.
11from BoostBuild import Tester, List
12
13
14t = Tester()
15
16t.write("a.cpp", """
17#ifdef CF_IS_OFF
18int main() { return 0; }
19#endif
20
21""")
22
23t.write("b.cpp", """
24#ifdef CF_1
25int main() { return 0; }
26#endif
27
28""")
29
30t.write("c.cpp", """
31#ifdef FOO
32int main() { return 0; }
33#endif
34
35""")
36
37
38t.write("Jamfile", """
39# See if default value of composite feature 'cf'
40# will be expanded to <define>CF_IS_OFF
41exe a : a.cpp ;
42
43# See if subfeature in requirements in expanded.
44exe b : b.cpp : <cf>on-1 ;
45
46# See if conditional requirements are recursively expanded.
47exe c : c.cpp : <toolset>$toolset:<variant>release <variant>release:<define>FOO ;
48""")
49
50t.write("project-root.jam", """
51import feature ;
52
53feature.feature cf : off on : composite incidental ;
54
55feature.compose <cf>off : <define>CF_IS_OFF ;
56
57feature.subfeature cf on : version : 1 2 : composite optional incidental ;
58
59feature.compose <cf-on:version>1 : <define>CF_1 ;
60       
61""")
62
63t.expand_toolset("Jamfile")
64
65t.run_build_system()
66t.expect_addition(["bin/$toolset/debug/a.exe",
67                   "bin/$toolset/debug/b.exe",
68                   "bin/$toolset/release/c.exe",
69                   ])
70
71t.rm("bin")
72
73# Test for issue BB60
74t.write("test.cpp", """
75#include "header.h"
76int main() { return 0; }
77""")
78t.write("Jamfile", """
79project
80    : requirements <toolset>$toolset:<include>foo
81    ;
82exe test : test.cpp : <toolset>$toolset ;
83""")
84t.expand_toolset("Jamfile")
85t.write("foo/header.h", """
86""")
87t.write("project-root.jam", "")
88t.run_build_system()
89t.expect_addition("bin/$toolset/debug/test.exe")
90
91t.cleanup()
92
Note: See TracBrowser for help on using the repository browser.