1#!/usr/bin/env python 2 3# Copyright (c) 2012 Google Inc. All rights reserved. 4# Use of this source code is governed by a BSD-style license that can be 5# found in the LICENSE file. 6 7""" 8Verifies that app bundles are rebuilt correctly. 9""" 10 11import TestGyp 12 13import sys 14 15if sys.platform == 'darwin': 16 print "This test is currently disabled: https://crbug.com/483696." 17 sys.exit(0) 18 19 test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode']) 20 21 CHDIR = 'rebuild' 22 test.run_gyp('test.gyp', chdir=CHDIR) 23 24 test.build('test.gyp', 'test_app', chdir=CHDIR) 25 26 # Touch a source file, rebuild, and check that the app target is up-to-date. 27 test.touch('rebuild/main.c') 28 test.build('test.gyp', 'test_app', chdir=CHDIR) 29 30 test.up_to_date('test.gyp', 'test_app', chdir=CHDIR) 31 32 # Xcode runs postbuilds on every build, so targets with postbuilds are 33 # never marked as up_to_date. 34 if test.format != 'xcode': 35 # Same for a framework bundle. 36 test.build('test.gyp', 'test_framework_postbuilds', chdir=CHDIR) 37 test.up_to_date('test.gyp', 'test_framework_postbuilds', chdir=CHDIR) 38 39 # Test that an app bundle with a postbuild that touches the app binary needs 40 # to be built only once. 41 test.build('test.gyp', 'test_app_postbuilds', chdir=CHDIR) 42 test.up_to_date('test.gyp', 'test_app_postbuilds', chdir=CHDIR) 43 44 test.pass_test() 45