Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/tools/build/v2/test/m1-02.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: 2.9 KB
Line 
1#!/usr/bin/python
2
3# Tests that 'make' accepts target from other directories and that
4# build request for those targets can be overriden.
5
6from BoostBuild import Tester, List
7
8t = Tester()
9t.set_tree("test1")
10
11t.run_build_system("-sTOOLSET=yfc")
12
13t.expect_addition("bin/a.obj/yfc/debug/runtime-link-dynamic/a.obj")
14t.expect_addition("auxillary/bin/b.obj/yfc/debug/runtime-link-dynamic/optimization-space/b.obj")
15t.expect_addition("bin/a/yfc/debug/runtime-link-dynamic/a")
16t.expect_nothing_more()
17
18t.fail(t.read("bin/a.obj/yfc/debug/runtime-link-dynamic/a.obj") !=\
19"""
20<optimization>off <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug
21a.cpp
22""")
23
24t.fail(t.read("auxillary/bin/b.obj/yfc/debug/runtime-link-dynamic/b.obj") !=\
25"""
26<optimization>space <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug
27b.cpp
28""")
29
30
31t.fail(t.read("bin/a/yfc/debug/runtime-link-dynamic/a") !=\
32"""
33<optimization>off <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug
34<optimization>off <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug
35a.cpp
36<optimization>space <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug
37b.cpp
38""")
39
40# Check that we have vanilla target names available in subdirs
41
42t.touch("auxillary/b.cpp")
43t.run_build_system("-sTOOLSET b.obj", subdir="auxillary")
44t.expect_touch("auxillary/bin/b.obj/yfc/debug/runtime-link-dynamic/optimization-space/b.obj")
45t.expect_no_modification("bin/a.obj/yfc/debug/runtime-link-dynamic/a.obj")
46t.expect_no_modification("bin/a/yfc/debug/runtime-link-dynamic/a")
47
48
49# Check that we cannot request link-incompatible property for source target
50
51t.write('Jamfile', t.read('Jamfile2'))
52stdout="""Error: subvariant of target ./a with properties
53    <optimization>off <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug
54requests link-incompatible property
55    <rtti>off
56for source @auxillary/b.obj
57"""
58t.run_build_system("-sTOOLSET=yfc", stdout=stdout)
59
60# Check that if we request link-compatible property then requirement for
61# the source target will override it, with warning. This is similar to
62# the way build requests are satisfied (see the first test)
63# CONSIDER: should be print the main target which requests this one
64# (and modifies requiremenets)?
65
66t.write('Jamfile3', t.read('Jamfile3'))
67t.write('auxillary/Jamfile3', t.read('auxillary/Jamfile3'))
68stdout="""Warning: cannot exactly satisfy request for auxillary/b.obj with properties
69    <optimization>space <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug
70Using
71    <optimization>speed <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug
72instead.
73"""
74t.run_build_system("-sTOOLSET=yfc", stdout=stdout)
75
76
77# Check for link-incompatible properties
78
79t.write('Jamfile4', t.read('Jamfile4'))
80t.write('auxillary/Jamfile4', t.read('auxillary/Jamfile4'))
81stdout="""Warning: cannot satisfy request for auxillary/b.obj with properties
82    <optimization>space <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug
83Nothing will be built.
84""")
85
86
87t.pass_test()
88
Note: See TracBrowser for help on using the repository browser.