template.py 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/usr/bin/python
  2. # Copyright (C) FILL SOMETHING HERE 2006.
  3. # Distributed under the Boost Software License, Version 1.0. (See
  4. # accompanying file LICENSE.txt or copy at
  5. # https://www.bfgroup.xyz/b2/LICENSE.txt)
  6. # This file is template for B2 tests. It creates a simple project that
  7. # builds one exe from one source, and checks that the exe is really created.
  8. import BoostBuild
  9. # Create a temporary working directory.
  10. t = BoostBuild.Tester()
  11. # Create the needed files.
  12. t.write("jamroot.jam", """
  13. exe hello : hello.cpp ;
  14. """)
  15. t.write("hello.cpp", """
  16. int main() {}
  17. """
  18. # Run the build.
  19. t.run_build_system()
  20. # First, create a list of three pathnames.
  21. file_list = BoostBuild.List("bin/$toolset/debug*/") * \
  22. BoostBuild.List("hello.exe hello.obj")
  23. # Second, assert that those files were added as result of the last build system
  24. # invocation.
  25. t.expect_addition(file_list)
  26. # Invoke the build system once again.
  27. t.run_build_system("clean")
  28. # Check if the files added previously were removed.
  29. t.expect_removal(file_list)
  30. # Remove temporary directories.
  31. t.cleanup()