Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/tools/build/v2/test/indirect_conditional.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: 1.4 KB
Line 
1#!/usr/bin/python
2
3#  Copyright (C) Vladimir Prus 2006.
4#  Distributed under the Boost Software License, Version 1.0. (See
5#  accompanying file LICENSE_1_0.txt or copy at
6#  http://www.boost.org/LICENSE_1_0.txt)
7
8from BoostBuild import Tester, List
9import string
10
11t = Tester()
12
13t.write("Jamroot", """
14exe a1 : a1.cpp : <conditional>@a1-rule ;
15
16rule a1-rule ( properties * )
17{
18    if <variant>debug in $(properties)
19    {
20        return <define>OK ;
21    }
22}
23
24exe a2 : a2.cpp : <conditional>@$(__name__).a2-rule <variant>debug:<optimization>speed ;
25
26rule a2-rule ( properties * )
27{
28    if <optimization>speed in $(properties)
29    {
30        return <define>OK ;
31    }
32}
33
34exe a3 : a3.cpp : <conditional>@$(__name__).a3-rule-1 <conditional>@$(__name__).a3-rule-2 ;
35
36rule a3-rule-1 ( properties * )
37{
38    if <optimization>speed in $(properties)
39    {
40        return <define>OK ;
41    }
42}
43
44rule a3-rule-2 ( properties * )
45{
46    if <variant>debug in $(properties)
47    {
48        return <optimization>speed ;
49    }
50}
51
52""")
53
54t.write("a1.cpp", """
55#ifdef OK
56int main() {}
57#endif
58
59""")
60
61t.write("a2.cpp", """
62#ifdef OK
63int main() {}
64#endif
65
66""")
67
68t.write("a3.cpp", """
69#ifdef OK
70int main() {}
71#endif
72
73""")
74
75
76
77t.run_build_system()
78
79t.expect_addition("bin/$toolset/debug/a1.exe")
80t.expect_addition("bin/$toolset/debug/optimization-speed/a2.exe")
81t.expect_addition("bin/$toolset/debug/optimization-speed/a3.exe")
82
83t.cleanup()
84
Note: See TracBrowser for help on using the repository browser.