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 a postbuilds on static libraries work, and that sourceless
9libraries don't cause failures at gyp time.
10"""
11
12import TestGyp
13
14import sys
15
16if sys.platform == 'darwin':
17  test = TestGyp.TestGyp(formats=['make', 'xcode'])
18
19  CHDIR = 'postbuild-static-library'
20  test.run_gyp('test.gyp', chdir=CHDIR)
21  test.build('test.gyp', 'my_lib', chdir=CHDIR)
22  # Building my_sourceless_lib doesn't work with make. gyp should probably
23  # forbid sourceless static libraries, since they're pretty pointless.
24  # But they shouldn't cause gyp time exceptions.
25
26  test.built_file_must_exist('postbuild-file', chdir=CHDIR)
27
28  test.pass_test()
29