gyptest-crosscompile.py 851 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/usr/bin/env python
  2. # Copyright (c) 2014 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 tools are built correctly.
  7. """
  8. import TestGyp
  9. import TestMac
  10. import sys
  11. import os
  12. if sys.platform == 'darwin':
  13. test = TestGyp.TestGyp(formats=['ninja', 'xcode'])
  14. oldenv = os.environ.copy()
  15. try:
  16. os.environ['GYP_CROSSCOMPILE'] = '1'
  17. test.run_gyp('test-crosscompile.gyp', chdir='app-bundle')
  18. finally:
  19. os.environ.clear()
  20. os.environ.update(oldenv)
  21. test.set_configuration('Default')
  22. test.build('test-crosscompile.gyp', 'TestHost', chdir='app-bundle')
  23. result_file = test.built_file_path('TestHost', chdir='app-bundle')
  24. test.must_exist(result_file)
  25. TestMac.CheckFileType(test, result_file, ['x86_64'])
  26. test.pass_test()