gyptest-postbuild-static-library.py 819 B

12345678910111213141516171819202122232425262728
  1. #!/usr/bin/env python
  2. # Copyright (c) 2012 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 a postbuilds on static libraries work, and that sourceless
  7. libraries don't cause failures at gyp time.
  8. """
  9. import TestGyp
  10. import sys
  11. if sys.platform == 'darwin':
  12. test = TestGyp.TestGyp(formats=['make', 'xcode'])
  13. CHDIR = 'postbuild-static-library'
  14. test.run_gyp('test.gyp', chdir=CHDIR)
  15. test.build('test.gyp', 'my_lib', chdir=CHDIR)
  16. # Building my_sourceless_lib doesn't work with make. gyp should probably
  17. # forbid sourceless static libraries, since they're pretty pointless.
  18. # But they shouldn't cause gyp time exceptions.
  19. test.built_file_must_exist('postbuild-file', chdir=CHDIR)
  20. test.pass_test()