PageRenderTime 40ms CodeModel.GetById 14ms RepoModel.GetById 1ms app.codeStats 0ms

/Src/Dependencies/Boost/tools/build/v2/test/module_actions.py

http://hadesmem.googlecode.com/
Python | 53 lines | 39 code | 6 blank | 8 comment | 0 complexity | 0f1be33856543ccce420d4e3c01c489c MD5 | raw file
Possible License(s): GPL-3.0, LGPL-2.0, Apache-2.0, LGPL-3.0
  1. #!/usr/bin/python
  2. # Copyright 2003 Dave Abrahams
  3. # Copyright 2006 Rene Rivera
  4. # Copyright 2003 Vladimir Prus
  5. # Distributed under the Boost Software License, Version 1.0.
  6. # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
  7. import BoostBuild
  8. import os
  9. import re
  10. spaces_re = re.compile("\ \ +")
  11. trailing_spaces_re = re.compile("\ +\n")
  12. t = BoostBuild.Tester("-d+1", pass_toolset=0)
  13. t.set_tree('module-actions')
  14. # Note that the following string contains some trailing spaces that should not
  15. # be removed.
  16. expected_output = """...found 4 targets...
  17. ...updating 3 targets...
  18. A.act t1
  19. A.act t1: X1-t1
  20. B.act t1
  21. B.act t1: X1-t1 X2-B
  22. act t1
  23. act t1: X1-t1 X2-global X3-global
  24. A.act t2
  25. A.act t2: X1-A X2-t2
  26. B.act t2
  27. B.act t2: X2-t2
  28. act t2
  29. act t2: X1-global X2-t2 X3-global
  30. A.act t3
  31. A.act t3: X1-A X3-t3
  32. B.act t3
  33. B.act t3: X2-B X3-t3
  34. act t3
  35. act t3: X1-global X2-global X3-t3
  36. ...updated 3 targets...
  37. """
  38. # On Unixes, call to 'echo 1 2 3' produces '1 2 3' (note the spacing)
  39. # Accomodate for that fact.
  40. if os.name != 'nt':
  41. expected_output = re.sub(spaces_re, " ", expected_output)
  42. expected_output = re.sub(trailing_spaces_re, "\n", expected_output)
  43. t.run_build_system(stdout=expected_output)
  44. t.expect_nothing_more()
  45. t.cleanup()