| 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 | |
|---|
| 8 | from BoostBuild import Tester, List |
|---|
| 9 | import string |
|---|
| 10 | |
|---|
| 11 | t = Tester() |
|---|
| 12 | |
|---|
| 13 | t.write("Jamroot", """ |
|---|
| 14 | project : requirements <threading>multi <variant>debug:<link>static ; |
|---|
| 15 | |
|---|
| 16 | build-project sub ; |
|---|
| 17 | build-project sub2 ; |
|---|
| 18 | build-project sub3 ; |
|---|
| 19 | build-project sub4 ; |
|---|
| 20 | """) |
|---|
| 21 | |
|---|
| 22 | t.write("sub/Jamfile", """ |
|---|
| 23 | exe hello : hello.cpp : -<threading>multi ; |
|---|
| 24 | """) |
|---|
| 25 | |
|---|
| 26 | t.write("sub/hello.cpp", """ |
|---|
| 27 | int main() |
|---|
| 28 | { |
|---|
| 29 | return 0; |
|---|
| 30 | } |
|---|
| 31 | |
|---|
| 32 | """) |
|---|
| 33 | |
|---|
| 34 | t.write("sub2/Jamfile", """ |
|---|
| 35 | project : requirements -<threading>multi ; |
|---|
| 36 | exe hello : hello.cpp ; |
|---|
| 37 | """) |
|---|
| 38 | |
|---|
| 39 | t.write("sub2/hello.cpp", """ |
|---|
| 40 | int main() |
|---|
| 41 | { |
|---|
| 42 | return 0; |
|---|
| 43 | } |
|---|
| 44 | |
|---|
| 45 | """) |
|---|
| 46 | |
|---|
| 47 | t.write("sub3/hello.cpp", """ |
|---|
| 48 | int main() |
|---|
| 49 | { |
|---|
| 50 | return 0; |
|---|
| 51 | } |
|---|
| 52 | |
|---|
| 53 | """) |
|---|
| 54 | |
|---|
| 55 | t.write("sub3/Jamfile", """ |
|---|
| 56 | exe hello : hello.cpp : -<variant>debug:<link>static ; |
|---|
| 57 | """) |
|---|
| 58 | |
|---|
| 59 | t.write("sub4/hello.cpp", """ |
|---|
| 60 | int main() |
|---|
| 61 | { |
|---|
| 62 | return 0; |
|---|
| 63 | } |
|---|
| 64 | |
|---|
| 65 | """) |
|---|
| 66 | |
|---|
| 67 | t.write("sub4/Jamfile", """ |
|---|
| 68 | project : requirements -<variant>debug:<link>static ; |
|---|
| 69 | exe hello : hello.cpp ; |
|---|
| 70 | """) |
|---|
| 71 | |
|---|
| 72 | |
|---|
| 73 | |
|---|
| 74 | t.run_build_system() |
|---|
| 75 | |
|---|
| 76 | t.expect_addition("sub/bin/$toolset/debug/link-static/hello.exe") |
|---|
| 77 | t.expect_addition("sub2/bin/$toolset/debug/link-static/hello.exe") |
|---|
| 78 | t.expect_addition("sub3/bin/$toolset/debug/threading-multi/hello.exe") |
|---|
| 79 | t.expect_addition("sub4/bin/$toolset/debug/threading-multi/hello.exe") |
|---|
| 80 | |
|---|
| 81 | t.rm(".") |
|---|
| 82 | |
|---|
| 83 | # No test that path requirements can be removed as well. |
|---|
| 84 | t.write("Jamroot", """ |
|---|
| 85 | build-project sub ; |
|---|
| 86 | |
|---|
| 87 | """) |
|---|
| 88 | |
|---|
| 89 | t.write("sub/Jamfile", """ |
|---|
| 90 | project : requirements <include>broken ; |
|---|
| 91 | |
|---|
| 92 | exe hello : hello.cpp : -<include>broken ; |
|---|
| 93 | """) |
|---|
| 94 | |
|---|
| 95 | t.write("sub/hello.cpp", """ |
|---|
| 96 | #include "math.h" |
|---|
| 97 | |
|---|
| 98 | int main() |
|---|
| 99 | { |
|---|
| 100 | return 0; |
|---|
| 101 | } |
|---|
| 102 | |
|---|
| 103 | """) |
|---|
| 104 | |
|---|
| 105 | t.write("sub/broken/math.h", """ |
|---|
| 106 | Broken |
|---|
| 107 | """) |
|---|
| 108 | |
|---|
| 109 | |
|---|
| 110 | t.run_build_system() |
|---|
| 111 | |
|---|
| 112 | t.expect_addition("bin/$toolset/debug/hello.exe") |
|---|
| 113 | |
|---|
| 114 | t.cleanup() |
|---|
| 115 | |
|---|