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

Function test_include_scan

test/link.py:181–208  ·  view source on GitHub ↗

Make sure that the #include scanner finds the headers

()

Source from the content-addressed store, hash-verified

179 test_merge_recursive_existing(["dir4-link"], ["dir5-link", "dir4-link"])
180
181def test_include_scan():
182 """Make sure that the #include scanner finds the headers"""
183 t = BoostBuild.Tester()
184 t.write("jamroot.jam", """\
185 import link ;
186 link-directory dir1-link : src/dir1/include : <location>. ;
187 link-directory dir2-link : src/dir2/include : <location>. ;
188 obj test : test.cpp :
189 <include>include
190 <implicit-dependency>dir1-link
191 <implicit-dependency>dir2-link ;
192 """)
193
194 t.write("src/dir1/include/file1.h", "#include <file2.h>\n")
195 t.write("src/dir2/include/file2.h", "int f();\n")
196 t.write("test.cpp", """\
197 #include <file1.h>
198 int main() { f(); }
199 """);
200
201 t.run_build_system(["test"])
202
203 t.expect_addition("bin/$toolset/debug/test.obj")
204
205 t.run_build_system()
206 t.expect_nothing_more()
207
208 t.cleanup()
209
210def test_include_scan_merge_existing():
211 """Make sure that files are replaced if needed when merging in

Callers 1

link.pyFile · 0.85

Calls 5

writeMethod · 0.95
run_build_systemMethod · 0.95
expect_additionMethod · 0.95
expect_nothing_moreMethod · 0.95
cleanupMethod · 0.95

Tested by

no test coverage detected