1504538656db8f7c7c41acbff57f0c94e967a38e1thakis@chromium.org#!/usr/bin/env python
2504538656db8f7c7c41acbff57f0c94e967a38e1thakis@chromium.org
3504538656db8f7c7c41acbff57f0c94e967a38e1thakis@chromium.org# Copyright (c) 2012 Google Inc. All rights reserved.
4504538656db8f7c7c41acbff57f0c94e967a38e1thakis@chromium.org# Use of this source code is governed by a BSD-style license that can be
5504538656db8f7c7c41acbff57f0c94e967a38e1thakis@chromium.org# found in the LICENSE file.
6504538656db8f7c7c41acbff57f0c94e967a38e1thakis@chromium.org
7504538656db8f7c7c41acbff57f0c94e967a38e1thakis@chromium.org"""
8504538656db8f7c7c41acbff57f0c94e967a38e1thakis@chromium.orgVerifies that a dependency on a bundle causes the whole bundle to be built.
9504538656db8f7c7c41acbff57f0c94e967a38e1thakis@chromium.org"""
10504538656db8f7c7c41acbff57f0c94e967a38e1thakis@chromium.org
11504538656db8f7c7c41acbff57f0c94e967a38e1thakis@chromium.orgimport TestGyp
12504538656db8f7c7c41acbff57f0c94e967a38e1thakis@chromium.org
13504538656db8f7c7c41acbff57f0c94e967a38e1thakis@chromium.orgimport sys
14504538656db8f7c7c41acbff57f0c94e967a38e1thakis@chromium.org
15504538656db8f7c7c41acbff57f0c94e967a38e1thakis@chromium.orgif sys.platform == 'darwin':
16504538656db8f7c7c41acbff57f0c94e967a38e1thakis@chromium.org  test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode'])
17504538656db8f7c7c41acbff57f0c94e967a38e1thakis@chromium.org
18504538656db8f7c7c41acbff57f0c94e967a38e1thakis@chromium.org  test.run_gyp('test.gyp', chdir='depend-on-bundle')
19504538656db8f7c7c41acbff57f0c94e967a38e1thakis@chromium.org
20504538656db8f7c7c41acbff57f0c94e967a38e1thakis@chromium.org  test.build('test.gyp', 'dependent_on_bundle', chdir='depend-on-bundle')
21504538656db8f7c7c41acbff57f0c94e967a38e1thakis@chromium.org
22504538656db8f7c7c41acbff57f0c94e967a38e1thakis@chromium.org  # Binary itself.
23504538656db8f7c7c41acbff57f0c94e967a38e1thakis@chromium.org  test.built_file_must_exist('dependent_on_bundle', chdir='depend-on-bundle')
24504538656db8f7c7c41acbff57f0c94e967a38e1thakis@chromium.org
25504538656db8f7c7c41acbff57f0c94e967a38e1thakis@chromium.org  # Bundle dependency.
26504538656db8f7c7c41acbff57f0c94e967a38e1thakis@chromium.org  test.built_file_must_exist(
27504538656db8f7c7c41acbff57f0c94e967a38e1thakis@chromium.org      'my_bundle.framework/Versions/A/my_bundle',
28504538656db8f7c7c41acbff57f0c94e967a38e1thakis@chromium.org      chdir='depend-on-bundle')
29504538656db8f7c7c41acbff57f0c94e967a38e1thakis@chromium.org  test.built_file_must_exist(  # package_framework
30504538656db8f7c7c41acbff57f0c94e967a38e1thakis@chromium.org      'my_bundle.framework/my_bundle',
31504538656db8f7c7c41acbff57f0c94e967a38e1thakis@chromium.org      chdir='depend-on-bundle')
32504538656db8f7c7c41acbff57f0c94e967a38e1thakis@chromium.org  test.built_file_must_exist(  # plist
33504538656db8f7c7c41acbff57f0c94e967a38e1thakis@chromium.org      'my_bundle.framework/Versions/A/Resources/Info.plist',
34504538656db8f7c7c41acbff57f0c94e967a38e1thakis@chromium.org      chdir='depend-on-bundle')
35504538656db8f7c7c41acbff57f0c94e967a38e1thakis@chromium.org  test.built_file_must_exist(
36504538656db8f7c7c41acbff57f0c94e967a38e1thakis@chromium.org      'my_bundle.framework/Versions/A/Resources/English.lproj/'  # Resources
37504538656db8f7c7c41acbff57f0c94e967a38e1thakis@chromium.org      'InfoPlist.strings',
38504538656db8f7c7c41acbff57f0c94e967a38e1thakis@chromium.org      chdir='depend-on-bundle')
39504538656db8f7c7c41acbff57f0c94e967a38e1thakis@chromium.org
40504538656db8f7c7c41acbff57f0c94e967a38e1thakis@chromium.org  test.pass_test()
41