make_rule.py 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/usr/bin/python
  2. # Copyright 2003 Dave Abrahams
  3. # Copyright 2003, 2006 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 'make' rule.
  7. import BoostBuild
  8. import string
  9. t = BoostBuild.Tester(pass_toolset=1)
  10. t.write("jamroot.jam", """\
  11. import feature ;
  12. feature.feature test_feature : : free ;
  13. import toolset ;
  14. toolset.flags creator STRING : <test_feature> ;
  15. actions creator
  16. {
  17. echo $(STRING) > $(<)
  18. }
  19. make foo.bar : : creator : <test_feature>12345678 ;
  20. """)
  21. t.run_build_system()
  22. t.expect_addition("bin/foo.bar")
  23. t.fail_test(t.read("bin/foo.bar").find("12345678") == -1)
  24. # Regression test. Make sure that if a main target is requested two times, and
  25. # build requests differ only in incidental properties, the main target is
  26. # created only once. The bug was discovered by Kirill Lapshin.
  27. t.write("jamroot.jam", """\
  28. exe a : dir//hello1.cpp ;
  29. exe b : dir//hello1.cpp/<hardcode-dll-paths>true ;
  30. """)
  31. t.write("dir/jamfile.jam", """\
  32. import common ;
  33. make hello1.cpp : hello.cpp : common.copy ;
  34. """)
  35. t.write("dir/hello.cpp", "int main() {}\n")
  36. # Show only action names.
  37. t.run_build_system(["-d1", "-n"])
  38. t.fail_test(t.stdout().count("copy") != 1)
  39. t.cleanup()