wrong_project.py 932 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/usr/bin/python
  2. # Copyright Vladimir Prus 2005.
  3. # Distributed under the Boost Software License, Version 1.0.
  4. # (See accompanying file LICENSE.txt or copy at
  5. # https://www.bfgroup.xyz/b2/LICENSE.txt)
  6. # Regression test. When Jamfile contained "using whatever ; " and the 'whatever'
  7. # module declared a project, then all targets in Jamfile were considered to be
  8. # declared in the project associated with 'whatever', not with the Jamfile.
  9. import BoostBuild
  10. t = BoostBuild.Tester(use_test_config=False)
  11. t.write("a.cpp", "int main() {}\n")
  12. t.write("jamroot.jam", """\
  13. using some_tool ;
  14. exe a : a.cpp ;
  15. """)
  16. t.write("some_tool.jam", """\
  17. import project ;
  18. project.initialize $(__name__) ;
  19. rule init ( ) { }
  20. """)
  21. t.write("some_tool.py", """\
  22. from b2.manager import get_manager
  23. get_manager().projects().initialize(__name__)
  24. def init():
  25. pass
  26. """)
  27. t.run_build_system()
  28. t.expect_addition("bin/$toolset/debug*/a.exe")
  29. t.cleanup()