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 bundles that have no 'sources' (pure resource containers) work.
      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='sourceless-module')
     19 
     20   # Just needs to build without errors.
     21   test.build('test.gyp', 'empty_bundle', chdir='sourceless-module')
     22   test.built_file_must_not_exist(
     23       'empty_bundle.bundle', chdir='sourceless-module')
     24 
     25   # Needs to build, and contain a resource.
     26   test.build('test.gyp', 'resource_bundle', chdir='sourceless-module')
     27 
     28   test.built_file_must_exist(
     29       'resource_bundle.bundle/Contents/Resources/foo.manifest',
     30       chdir='sourceless-module')
     31   test.built_file_must_not_exist(
     32       'resource_bundle.bundle/Contents/MacOS/resource_bundle',
     33       chdir='sourceless-module')
     34 
     35   # Needs to build and cause the bundle to be built.
     36   test.build(
     37       'test.gyp', 'dependent_on_resource_bundle', chdir='sourceless-module')
     38 
     39   test.built_file_must_exist(
     40       'resource_bundle.bundle/Contents/Resources/foo.manifest',
     41       chdir='sourceless-module')
     42   test.built_file_must_not_exist(
     43       'resource_bundle.bundle/Contents/MacOS/resource_bundle',
     44       chdir='sourceless-module')
     45 
     46   test.pass_test()
     47