conditionals2.py 960 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/usr/bin/python
  2. # Copyright 2003 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. # Regression test: it was possible that due to evaluation of conditional
  6. # requirements, two different values of non-free features were present in a
  7. # property set.
  8. import BoostBuild
  9. t = BoostBuild.Tester()
  10. t.write("a.cpp", "")
  11. t.write("jamroot.jam", """
  12. import feature ;
  13. import common ;
  14. feature.feature the_feature : false true : propagated ;
  15. rule maker ( targets * : sources * : properties * )
  16. {
  17. if <the_feature>false in $(properties) &&
  18. <the_feature>true in $(properties)
  19. {
  20. EXIT "Oops, two different values of non-free feature" ;
  21. }
  22. CMD on $(targets) = [ common.file-creation-command ] ;
  23. }
  24. actions maker
  25. {
  26. $(CMD) $(<) ;
  27. }
  28. make a : a.cpp : maker : <variant>debug:<the_feature>true ;
  29. """)
  30. t.run_build_system()
  31. t.cleanup()