summaryrefslogtreecommitdiff
path: root/tools/build/v2/test/m1-03.py
blob: 2f31ba27c86ccc0e17b7b28276363e294e2d530e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/python

# Copyright 2002 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)

# Tests that we can use objects from other projects, i.e. with other project
# root. Test also that we can refer to those target using project-id.

import BoostBuild

t = BoostBuild.Tester()

t.set_tree("test1")

t.run_build_system("-sTOOLSET=yfc", subdir="p1")

t.expect_addition("p1/bin/a.obj/yfc/debug/runtime-link-dynamic/a.obj")
t.expect_addition("p1/auxillary/bin/b.obj/yfc/debug/runtime-link-dynamic/optimization-space/b.obj")
t.expect_addition("p2/bin/c.obj/yfc/debug/runtime-link-dynamic/c.obj")
t.expect_addition("bin/a/yfc/debug/runtime-link-dynamic/a")
t.expect_nothing_more()

t.fail(t.read("p1/bin/a.obj/yfc/debug/runtime-link-dynamic/a.obj") !=\
"""
<optimization>off <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug
a.cpp
""")

t.fail(t.read("p1/auxillary/bin/b.obj/yfc/debug/runtime-link-dynamic/b.obj") !=\
"""
<optimization>space <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug
b.cpp
""")

t.fail(t.read("p2/bin/c.obj/yfc/debug/runtime-link-dynamic/c.obj") !=\
"""
<include>everything <optimization>off <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug
a.cpp
""")

t.fail(t.read("bin/a/yfc/debug/runtime-link-dynamic/a") !=\
"""
<optimization>off <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug
<optimization>off <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug
a.cpp
<optimization>space <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug
b.cpp
<include>everything <optimization>space <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug
c.cpp
""")

t.expect_nothing_more()

# TODO: need to write test cases for referring to targets using project-id.

t.pass_test()