prebuilt.py 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/usr/bin/python
  2. # Copyright 2002, 2003, 2004 Vladimir Prus
  3. # Distributed under the Boost Software License, Version 1.0.
  4. # (See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt)
  5. # Test that we can use already built sources
  6. import BoostBuild
  7. t = BoostBuild.Tester(["debug", "release"], use_test_config=False)
  8. t.set_tree('prebuilt')
  9. t.expand_toolset("ext/jamroot.jam")
  10. t.expand_toolset("jamroot.jam")
  11. # First, build the external project.
  12. t.run_build_system(subdir="ext")
  13. # Then pretend that we do not have the sources for the external project, and
  14. # can only use compiled binaries.
  15. t.copy("ext/jamfile2.jam", "ext/jamfile.jam")
  16. t.expand_toolset("ext/jamfile.jam")
  17. # Now check that we can build the main project, and that correct prebuilt file
  18. # is picked, depending of variant. This also checks that correct includes for
  19. # prebuilt libraries are used.
  20. t.run_build_system()
  21. t.expect_addition("bin/$toolset/debug*/hello.exe")
  22. t.expect_addition("bin/$toolset/release*/hello.exe")
  23. t.rm("bin")
  24. # Now test that prebuilt file specified by absolute name works too.
  25. t.copy("ext/jamfile3.jam", "ext/jamfile.jam")
  26. t.expand_toolset("ext/jamfile.jam")
  27. t.run_build_system()
  28. t.expect_addition("bin/$toolset/debug*/hello.exe")
  29. t.expect_addition("bin/$toolset/release*/hello.exe")
  30. t.cleanup()