Home | History | Annotate | Download | only in mac
      1 #!/usr/bin/env python
      2 
      3 # Copyright (c) 2011 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 postbuild steps 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='postbuilds')
     19 
     20   test.build('test.gyp', test.ALL, chdir='postbuilds')
     21 
     22   # See comment in test/subdirectory/gyptest-subdir-default.py
     23   if test.format == 'xcode':
     24     chdir = 'postbuilds/subdirectory'
     25   else:
     26     chdir = 'postbuilds'
     27 
     28   # Created by the postbuild scripts
     29   test.built_file_must_exist('el.a_touch',
     30                              type=test.STATIC_LIB,
     31                              chdir='postbuilds')
     32   test.built_file_must_exist('el.a_gyp_touch',
     33                              type=test.STATIC_LIB,
     34                              chdir='postbuilds')
     35   test.built_file_must_exist('nest_el.a_touch',
     36                              type=test.STATIC_LIB,
     37                              chdir=chdir)
     38   test.built_file_must_exist(
     39       'dyna.framework/Versions/A/dyna_touch',
     40       chdir='postbuilds')
     41   test.built_file_must_exist(
     42       'dyna.framework/Versions/A/dyna_gyp_touch',
     43       chdir='postbuilds')
     44   test.built_file_must_exist(
     45       'nest_dyna.framework/Versions/A/nest_dyna_touch',
     46       chdir=chdir)
     47   test.built_file_must_exist('dyna_standalone.dylib_gyp_touch',
     48                              type=test.SHARED_LIB,
     49                              chdir='postbuilds')
     50   test.built_file_must_exist('copied_file.txt', chdir='postbuilds')
     51   test.built_file_must_exist('copied_file_2.txt', chdir=chdir)
     52 
     53   test.pass_test()
     54