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 'copies' with app bundles are handled correctly. 9""" 10 11import TestGyp 12 13import os 14import sys 15import time 16 17if sys.platform == 'darwin': 18 print "This test is currently disabled: https://crbug.com/483696." 19 sys.exit(0) 20 21 test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode']) 22 23 test.run_gyp('framework.gyp', chdir='framework') 24 25 test.build('framework.gyp', 'copy_target', chdir='framework') 26 27 # Check that the copy succeeded. 28 test.built_file_must_exist( 29 'Test Framework.framework/foo/Dependency Bundle.framework', 30 chdir='framework') 31 test.built_file_must_exist( 32 'Test Framework.framework/foo/Dependency Bundle.framework/Versions/A', 33 chdir='framework') 34 test.built_file_must_exist( 35 'Test Framework.framework/Versions/A/Libraries/empty.c', 36 chdir='framework') 37 38 # Verify BUILT_FRAMEWORKS_DIR is set and working. 39 test.build('framework.gyp', 'copy_embedded', chdir='framework') 40 41 test.built_file_must_exist( 42 'Embedded/Test Framework.framework', chdir='framework') 43 44 # Check that rebuilding the target a few times works. 45 dep_bundle = test.built_file_path('Dependency Bundle.framework', 46 chdir='framework') 47 mtime = os.path.getmtime(dep_bundle) 48 atime = os.path.getatime(dep_bundle) 49 for i in range(3): 50 os.utime(dep_bundle, (atime + i * 1000, mtime + i * 1000)) 51 test.build('framework.gyp', 'copy_target', chdir='framework') 52 53 54 # Check that actions ran. 55 test.built_file_must_exist('action_file', chdir='framework') 56 57 # Test that a copy with the "Code Sign on Copy" flag on succeeds. 58 test.build('framework.gyp', 'copy_target_code_sign', chdir='framework') 59 60 test.pass_test() 61