1 | #!/usr/bin/python |
---|
2 | # Test the very basic 'make' functionality. |
---|
3 | |
---|
4 | from BoostBuild import Tester, List |
---|
5 | |
---|
6 | t = Tester() |
---|
7 | t.set_tree("test1") |
---|
8 | |
---|
9 | |
---|
10 | # Check that we can build something |
---|
11 | |
---|
12 | t.run_build_system("-sTOOLSET=yfc") |
---|
13 | |
---|
14 | t.expect_addition("bin/a.obj/yfc/debug/runtime-link-dynamic/a.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("bin/a/yfc/debug/runtime-link-dynamic/a") !=\ |
---|
25 | """ |
---|
26 | <optimization>off <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug |
---|
27 | <optimization>off <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug |
---|
28 | a.cpp |
---|
29 | """) |
---|
30 | |
---|
31 | # Check that we have vanilla target names available |
---|
32 | |
---|
33 | t.touch("a.cpp") |
---|
34 | t.run_build_system("-sTOOLSET a.obj") |
---|
35 | t.expect_touch("bin/a.obj/yfc/debug/runtime-link-dynamic/a.obj") |
---|
36 | t.expect_no_modification("bin/a/yfc/debug/runtime-link-dynamic/a") |
---|
37 | |
---|
38 | |
---|
39 | # Check that if build request cannot be completely matches, a warning is |
---|
40 | # issued and subvariant with link-compatible properties is used |
---|
41 | |
---|
42 | t.write("Jamfile", t.read("Jamfile2")) |
---|
43 | stdout="""Warning: cannot exactly satisfy request for ./a with properties |
---|
44 | <optimization>off <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug |
---|
45 | Using |
---|
46 | <optimization>space <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug |
---|
47 | instead. |
---|
48 | """) |
---|
49 | t.run_build_system("-sTOOLSET=yfc", stdout=stdout) |
---|
50 | |
---|
51 | # Check that conflicting link-incompatible requirements prevent building. |
---|
52 | t.write("Jamfile", t.read("Jamfile3")) |
---|
53 | stdout="""Warning: cannot satisfy request for ./a with properties |
---|
54 | <optimization>off <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug |
---|
55 | Nothing will be built. |
---|
56 | """) |
---|
57 | t.run_build_system("-sTOOLSET=yfc", stdout=stdout, status=1) |
---|
58 | |
---|
59 | t.pass_test() |
---|
60 | |
---|