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 | |
---|
6 | from BoostBuild import Tester, List |
---|
7 | |
---|
8 | t = Tester() |
---|
9 | t.set_tree("test1") |
---|
10 | |
---|
11 | t.run_build_system("-sTOOLSET=yfc") |
---|
12 | |
---|
13 | t.expect_addition("bin/a.obj/yfc/debug/runtime-link-dynamic/a.obj") |
---|
14 | t.expect_addition("auxillary/bin/b.obj/yfc/debug/runtime-link-dynamic/optimization-space/b.obj") |
---|
15 | t.expect_addition("bin/a/yfc/debug/runtime-link-dynamic/a") |
---|
16 | t.expect_nothing_more() |
---|
17 | |
---|
18 | t.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 |
---|
21 | a.cpp |
---|
22 | """) |
---|
23 | |
---|
24 | t.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 |
---|
27 | b.cpp |
---|
28 | """) |
---|
29 | |
---|
30 | |
---|
31 | t.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 |
---|
35 | a.cpp |
---|
36 | <optimization>space <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug |
---|
37 | b.cpp |
---|
38 | """) |
---|
39 | |
---|
40 | # Check that we have vanilla target names available in subdirs |
---|
41 | |
---|
42 | t.touch("auxillary/b.cpp") |
---|
43 | t.run_build_system("-sTOOLSET b.obj", subdir="auxillary") |
---|
44 | t.expect_touch("auxillary/bin/b.obj/yfc/debug/runtime-link-dynamic/optimization-space/b.obj") |
---|
45 | t.expect_no_modification("bin/a.obj/yfc/debug/runtime-link-dynamic/a.obj") |
---|
46 | t.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 | |
---|
51 | t.write('Jamfile', t.read('Jamfile2')) |
---|
52 | stdout="""Error: subvariant of target ./a with properties |
---|
53 | <optimization>off <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug |
---|
54 | requests link-incompatible property |
---|
55 | <rtti>off |
---|
56 | for source @auxillary/b.obj |
---|
57 | """ |
---|
58 | t.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 | |
---|
66 | t.write('Jamfile3', t.read('Jamfile3')) |
---|
67 | t.write('auxillary/Jamfile3', t.read('auxillary/Jamfile3')) |
---|
68 | stdout="""Warning: cannot exactly satisfy request for auxillary/b.obj with properties |
---|
69 | <optimization>space <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug |
---|
70 | Using |
---|
71 | <optimization>speed <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug |
---|
72 | instead. |
---|
73 | """ |
---|
74 | t.run_build_system("-sTOOLSET=yfc", stdout=stdout) |
---|
75 | |
---|
76 | |
---|
77 | # Check for link-incompatible properties |
---|
78 | |
---|
79 | t.write('Jamfile4', t.read('Jamfile4')) |
---|
80 | t.write('auxillary/Jamfile4', t.read('auxillary/Jamfile4')) |
---|
81 | stdout="""Warning: cannot satisfy request for auxillary/b.obj with properties |
---|
82 | <optimization>space <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug |
---|
83 | Nothing will be built. |
---|
84 | """) |
---|
85 | |
---|
86 | |
---|
87 | t.pass_test() |
---|
88 | |
---|