using.py 741 B

1234567891011121314151617181920212223242526272829303132
  1. #!/usr/bin/python
  2. # Copyright (C) Vladimir Prus 2005.
  3. # Distributed under the Boost Software License, Version 1.0. (See
  4. # accompanying file LICENSE.txt or copy at
  5. # https://www.bfgroup.xyz/b2/LICENSE.txt)
  6. import BoostBuild
  7. t = BoostBuild.Tester(use_test_config=False)
  8. t.write("jamroot.jam", "using some_tool ;")
  9. t.write("some_tool.jam", """\
  10. import project ;
  11. project.initialize $(__name__) ;
  12. rule init ( ) { }
  13. """)
  14. t.write("some_tool.py", """\
  15. from b2.manager import get_manager
  16. get_manager().projects().initialize(__name__)
  17. def init():
  18. pass
  19. """)
  20. t.write("sub/a.cpp", "int main() {}\n")
  21. t.write("sub/jamfile.jam", "exe a : a.cpp ;")
  22. t.run_build_system(subdir="sub")
  23. t.expect_addition("sub/bin/$toolset/debug*/a.exe")
  24. t.cleanup()