MCPcopy Create free account
hub / github.com/boostorg/build / test_paths_set_by_indirect_conditionals

Function test_paths_set_by_indirect_conditionals

v2/test/path_features.py:98–146  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

96
97
98def 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", """\
105import remote/remote ;
106
107# If we set the <include>folder_to_include property directly, it will work
108obj x1 : x.cpp : <conditional>@attach-include-local ;
109obj x2 : x.cpp : <conditional>@remote/remote.attach-include-remote ;
110
111rule attach-include-local ( properties * )
112{
113 return <include>folder_to_include ;
114}
115""")
116 t.write("child_dir/remote/remote.jam", """\
117rule 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>
124int 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
149test_basic()

Callers 1

path_features.pyFile · 0.85

Calls 6

writeMethod · 0.95
run_build_systemMethod · 0.95
expect_additionMethod · 0.95
touchMethod · 0.95
expect_touchMethod · 0.95
cleanupMethod · 0.95

Tested by

no test coverage detected