Home | History | Annotate | Download | only in mac
      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 """
      8 Verifies that app bundles are built correctly.
      9 """
     10 
     11 import TestGyp
     12 
     13 import sys
     14 
     15 if sys.platform == 'darwin':
     16   test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode'])
     17 
     18   test.run_gyp('test.gyp', chdir='app-bundle')
     19 
     20   test.build('test.gyp', test.ALL, chdir='app-bundle')
     21 
     22   # Binary
     23   test.built_file_must_exist('Test App Gyp.app/Contents/MacOS/Test App Gyp',
     24                              chdir='app-bundle')
     25 
     26   # Info.plist
     27   info_plist = test.built_file_path('Test App Gyp.app/Contents/Info.plist',
     28                                     chdir='app-bundle')
     29   test.must_exist(info_plist)
     30   test.must_contain(info_plist, 'com.google.Test App Gyp')  # Variable expansion
     31   test.must_not_contain(info_plist, '${MACOSX_DEPLOYMENT_TARGET}');
     32 
     33   # Resources
     34   test.built_file_must_exist(
     35       'Test App Gyp.app/Contents/Resources/English.lproj/InfoPlist.strings',
     36       chdir='app-bundle')
     37   test.built_file_must_exist(
     38       'Test App Gyp.app/Contents/Resources/English.lproj/MainMenu.nib',
     39       chdir='app-bundle')
     40 
     41   # Packaging
     42   test.built_file_must_exist('Test App Gyp.app/Contents/PkgInfo',
     43                              chdir='app-bundle')
     44   test.built_file_must_match('Test App Gyp.app/Contents/PkgInfo', 'APPLause',
     45                              chdir='app-bundle')
     46 
     47 
     48   test.pass_test()
     49