gyptest-rebuild.py 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 app bundles are rebuilt correctly.
  7. """
  8. import TestGyp
  9. import sys
  10. if sys.platform == 'darwin':
  11. test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode'])
  12. CHDIR = 'rebuild'
  13. test.run_gyp('test.gyp', chdir=CHDIR)
  14. test.build('test.gyp', 'test_app', chdir=CHDIR)
  15. # Touch a source file, rebuild, and check that the app target is up-to-date.
  16. test.touch('rebuild/main.c')
  17. test.build('test.gyp', 'test_app', chdir=CHDIR)
  18. test.up_to_date('test.gyp', 'test_app', chdir=CHDIR)
  19. # Xcode runs postbuilds on every build, so targets with postbuilds are
  20. # never marked as up_to_date.
  21. if test.format != 'xcode':
  22. # Same for a framework bundle.
  23. test.build('test.gyp', 'test_framework_postbuilds', chdir=CHDIR)
  24. test.up_to_date('test.gyp', 'test_framework_postbuilds', chdir=CHDIR)
  25. # Test that an app bundle with a postbuild that touches the app binary needs
  26. # to be built only once.
  27. test.build('test.gyp', 'test_app_postbuilds', chdir=CHDIR)
  28. test.up_to_date('test.gyp', 'test_app_postbuilds', chdir=CHDIR)
  29. test.pass_test()