()
| 96 | |
| 97 | |
| 98 | def test_paths_set_by_indirect_conditionals(): |
| 99 | t = BoostBuild.Tester(pass_d0=False, use_test_config=False) |
| 100 | |
| 101 | header = "child_dir/folder_to_include/some_header.h" |
| 102 | |
| 103 | t.write("jamroot.jam", "build-project child_dir ;") |
| 104 | t.write("child_dir/jamfile.jam", """\ |
| 105 | import remote/remote ; |
| 106 | |
| 107 | # If we set the <include>folder_to_include property directly, it will work |
| 108 | obj x1 : x.cpp : <conditional>@attach-include-local ; |
| 109 | obj x2 : x.cpp : <conditional>@remote/remote.attach-include-remote ; |
| 110 | |
| 111 | rule attach-include-local ( properties * ) |
| 112 | { |
| 113 | return <include>folder_to_include ; |
| 114 | } |
| 115 | """) |
| 116 | t.write("child_dir/remote/remote.jam", """\ |
| 117 | rule attach-include-remote ( properties * ) |
| 118 | { |
| 119 | return <include>folder_to_include ; |
| 120 | } |
| 121 | """) |
| 122 | t.write("child_dir/x.cpp", """\ |
| 123 | #include <some_header.h> |
| 124 | int main() {} |
| 125 | """) |
| 126 | t.write(header, "int some_func();\n") |
| 127 | t.write("child_dir/folder_to_include/jamfile.jam", "") |
| 128 | |
| 129 | expected_x1 = "child_dir/bin/$toolset/debug/x1.obj" |
| 130 | expected_x2 = "child_dir/bin/$toolset/debug/x2.obj" |
| 131 | |
| 132 | t.run_build_system() |
| 133 | t.expect_addition(expected_x1) |
| 134 | t.expect_addition(expected_x2) |
| 135 | |
| 136 | t.touch(header) |
| 137 | t.run_build_system(subdir="child_dir") |
| 138 | t.expect_touch(expected_x1) |
| 139 | t.expect_touch(expected_x2) |
| 140 | |
| 141 | t.touch(header) |
| 142 | t.run_build_system(["..", "-d2"], subdir="child_dir/folder_to_include") |
| 143 | t.expect_touch(expected_x1) |
| 144 | t.expect_touch(expected_x2) |
| 145 | |
| 146 | t.cleanup() |
| 147 | |
| 148 | |
| 149 | test_basic() |
no test coverage detected