double_loading.py 986 B

12345678910111213141516171819202122232425262728293031
  1. #!/usr/bin/python
  2. # Copyright 2003 Vladimir Prus
  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. import BoostBuild
  7. t = BoostBuild.Tester()
  8. # Regression test for double loading of the same Jamfile.
  9. t.write("jamroot.jam", "")
  10. t.write("jamfile.jam", "build-project subdir ;")
  11. t.write("subdir/jamfile.jam", 'ECHO "Loaded subdir" ;')
  12. t.run_build_system(subdir="subdir")
  13. t.expect_output_lines("Loaded subdir")
  14. # Regression test for a more contrived case. The top-level Jamfile refers to
  15. # subdir via use-project, while subdir's Jamfile is being loaded. The
  16. # motivation why use-project referring to subprojects is useful can be found
  17. # at: http://article.gmane.org/gmane.comp.lib.boost.build/3906
  18. t.write("jamroot.jam", "")
  19. t.write("jamfile.jam", "use-project /subdir : subdir ;")
  20. t.write("subdir/jamfile.jam", "project subdir ;")
  21. t.run_build_system(subdir="subdir");
  22. t.cleanup()