notfile.py 816 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/usr/bin/python
  2. # Copyright (C) Vladimir Prus 2005.
  3. # Distributed under the Boost Software License, Version 1.0.
  4. # (See accompanying file LICENSE.txt or copy at
  5. # https://www.bfgroup.xyz/b2/LICENSE.txt)
  6. # Basic tests for the 'notfile' rule.
  7. import BoostBuild
  8. import os
  9. t = BoostBuild.Tester()
  10. t.write("jamroot.jam", """\
  11. import notfile ;
  12. notfile say : "echo hi" ;
  13. exe hello : hello.cpp ;
  14. notfile hello_valgrind : @valgrind : hello ;
  15. actions valgrind { valgrind $(>[1]) }
  16. """)
  17. t.write("hello.cpp", """\
  18. #include <iostream>
  19. int main() { std::cout << "Hello!\\n"; }
  20. """)
  21. t.run_build_system(["-n", "-d+2"])
  22. t.fail_test(t.stdout().find("echo hi") == -1)
  23. name = t.adjust_names("bin/$toolset/debug*/hello.exe")[0]
  24. name = os.path.join(*name.split("/"))
  25. t.expect_output_lines(" valgrind *%s " % name)
  26. t.cleanup()