symlink.py 904 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/usr/bin/python
  2. # Copyright 2003 Dave Abrahams
  3. # Copyright 2003 Vladimir Prus
  4. # Distributed under the Boost Software License, Version 1.0.
  5. # (See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt)
  6. # Test the 'symlink' rule.
  7. from __future__ import print_function
  8. import os
  9. import BoostBuild
  10. if os.name != 'posix':
  11. print("The symlink tests can be run on posix only.")
  12. import sys
  13. sys.exit(1)
  14. t = BoostBuild.Tester(use_test_config=False)
  15. t.write("jamroot.jam", "import gcc ;")
  16. t.write("jamfile.jam", """
  17. exe hello : hello.cpp ;
  18. symlink hello_release : hello/<variant>release ;
  19. symlink hello_debug : hello/<variant>debug ;
  20. symlink links/hello_release : hello/<variant>release ;
  21. """)
  22. t.write("hello.cpp", """
  23. int main() {}
  24. """)
  25. t.run_build_system()
  26. t.expect_addition([
  27. 'hello_debug.exe',
  28. 'hello_release.exe',
  29. 'links/hello_release.exe'])
  30. t.cleanup()