wrapper.py 790 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/usr/bin/python
  2. # Copyright 2004 Vladimir Prus
  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. # Test that the user can define his own rule that will call built-in main target
  6. # rule and that this will work.
  7. import BoostBuild
  8. t = BoostBuild.Tester(use_test_config=False)
  9. t.write("jamfile.jam", """
  10. my-test : test.cpp ;
  11. """)
  12. t.write("test.cpp", """
  13. int main() {}
  14. """)
  15. t.write("jamroot.jam", """
  16. using testing ;
  17. rule my-test ( name ? : sources + )
  18. {
  19. name ?= test ;
  20. unit-test $(name) : $(sources) ; # /site-config//cppunit /util//testMain ;
  21. }
  22. IMPORT $(__name__) : my-test : : my-test ;
  23. """)
  24. t.run_build_system()
  25. t.expect_addition("bin/$toolset/debug*/test.passed")
  26. t.cleanup()