gyptest-toolsets.py 746 B

12345678910111213141516171819202122232425262728293031
  1. #!/usr/bin/env python
  2. # Copyright (c) 2009 Google Inc. All rights reserved.
  3. # Use of this source code is governed by a BSD-style license that can be
  4. # found in the LICENSE file.
  5. """
  6. Verifies that toolsets are correctly applied
  7. """
  8. import os
  9. import sys
  10. import TestGyp
  11. if sys.platform.startswith('linux'):
  12. test = TestGyp.TestGyp(formats=['make', 'ninja'])
  13. oldenv = os.environ.copy()
  14. try:
  15. os.environ['GYP_CROSSCOMPILE'] = '1'
  16. test.run_gyp('toolsets.gyp')
  17. finally:
  18. os.environ.clear()
  19. os.environ.update(oldenv)
  20. test.build('toolsets.gyp', test.ALL)
  21. test.run_built_executable('host-main', stdout="Host\nShared: Host\n")
  22. test.run_built_executable('target-main', stdout="Target\nShared: Target\n")
  23. test.pass_test()