print.py 947 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/usr/bin/python
  2. # Copyright 2003 Douglas Gregor
  3. # Copyright 2005 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. import BoostBuild
  7. t = BoostBuild.Tester()
  8. t.write("jamroot.jam", "import gcc ;")
  9. t.write("jamfile.jam", """
  10. import print ;
  11. print.output foo ;
  12. print.text \\\"Something\\\" ;
  13. DEPENDS all : foo ;
  14. ALWAYS foo ;
  15. """)
  16. t.run_build_system()
  17. t.expect_content("foo", """\"Something\"""")
  18. t.write("jamfile.jam", """
  19. import print ;
  20. print.output foo ;
  21. print.text \\\n\\\"Somethingelse\\\" ;
  22. DEPENDS all : foo ;
  23. ALWAYS foo ;
  24. """)
  25. t.run_build_system()
  26. t.expect_content("foo", """\"Something\"
  27. \"Somethingelse\"""")
  28. t.write("jamfile.jam", """
  29. import print ;
  30. print.output foo ;
  31. print.text \\\"Different\\\" : true ;
  32. DEPENDS all : foo ;
  33. ALWAYS foo ;
  34. """)
  35. t.run_build_system()
  36. t.expect_content("foo", """\"Different\"""")
  37. t.cleanup()