builtin_exit.py 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/usr/bin/python
  2. # Copyright 2012 Steven Watanabe
  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. # This tests the EXIT rule.
  6. import BoostBuild
  7. def test_exit(name):
  8. t = BoostBuild.Tester(["-ffile.jam"], pass_toolset=0)
  9. t.write("file.jam", "%s ;" % name)
  10. t.run_build_system(status=1, stdout="\n")
  11. t.rm(".")
  12. t.write("file.jam", "%s : 0 ;" % name)
  13. t.run_build_system(stdout="\n")
  14. t.rm(".")
  15. t.write("file.jam", "%s : 1 ;" % name)
  16. t.run_build_system(status=1, stdout="\n")
  17. t.rm(".")
  18. t.write("file.jam", "%s : 2 ;" % name)
  19. t.run_build_system(status=2, stdout="\n")
  20. t.rm(".")
  21. t.write("file.jam", "%s a message ;" % name)
  22. t.run_build_system(status=1, stdout="a message\n")
  23. t.rm(".")
  24. t.write("file.jam", "%s a message : 0 ;" % name)
  25. t.run_build_system(stdout="a message\n")
  26. t.rm(".")
  27. t.cleanup()
  28. test_exit("EXIT")
  29. test_exit("Exit")
  30. test_exit("exit")