summaryrefslogtreecommitdiff
path: root/gyp/test/mac/gyptest-infoplist-process.py
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2014-09-19 12:04:47 +0200
committerPatrick Ohly <patrick.ohly@intel.com>2014-09-19 12:13:21 +0200
commit390c369f081a5601e18fdb44b9054d9d29e1356d (patch)
treeb32ae4505bb6690fac4d0672d8b165ee25ef3ec5 /gyp/test/mac/gyptest-infoplist-process.py
parent6bcc194aec4d5d51c3856826198c203f58a10de0 (diff)
downloadpycrosswalk-390c369f081a5601e18fdb44b9054d9d29e1356d.tar.gz
pycrosswalk-390c369f081a5601e18fdb44b9054d9d29e1356d.tar.bz2
pycrosswalk-390c369f081a5601e18fdb44b9054d9d29e1356d.zip
bundle gyp
This is the same approach as used in other Crosswalk projects. Could be replaced with a Tizen gyp package if someone was willing to maintain it.
Diffstat (limited to 'gyp/test/mac/gyptest-infoplist-process.py')
-rwxr-xr-xgyp/test/mac/gyptest-infoplist-process.py51
1 files changed, 51 insertions, 0 deletions
diff --git a/gyp/test/mac/gyptest-infoplist-process.py b/gyp/test/mac/gyptest-infoplist-process.py
new file mode 100755
index 0000000..20874a3
--- /dev/null
+++ b/gyp/test/mac/gyptest-infoplist-process.py
@@ -0,0 +1,51 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2012 Google Inc. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""
+Verifies the Info.plist preprocessor functionality.
+"""
+
+import TestGyp
+
+import sys
+
+if sys.platform == 'darwin':
+ test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode'])
+
+ CHDIR = 'infoplist-process'
+ INFO_PLIST_PATH = 'Test.app/Contents/Info.plist'
+
+ # First process both keys.
+ test.set_configuration('One')
+ test.run_gyp('test1.gyp', chdir=CHDIR)
+ test.build('test1.gyp', test.ALL, chdir=CHDIR)
+ info_plist = test.built_file_path(INFO_PLIST_PATH, chdir=CHDIR)
+ test.must_exist(info_plist)
+ test.must_contain(info_plist, 'Foo')
+ test.must_contain(info_plist, 'Bar')
+
+ # Then process a single key.
+ test.set_configuration('Two')
+ test.run_gyp('test2.gyp', chdir=CHDIR)
+ test.build('test2.gyp', chdir=CHDIR)
+ info_plist = test.built_file_path(INFO_PLIST_PATH, chdir=CHDIR)
+ test.must_exist(info_plist)
+ test.must_contain(info_plist, 'com.google.Test') # Normal expansion works.
+ test.must_contain(info_plist, 'Foo (Bar)')
+ test.must_contain(info_plist, 'PROCESSED_KEY2')
+
+ # Then turn off the processor.
+ test.set_configuration('Three')
+ test.run_gyp('test3.gyp', chdir=CHDIR)
+ test.build('test3.gyp', chdir=CHDIR)
+ info_plist = test.built_file_path('Test App.app/Contents/Info.plist',
+ chdir=CHDIR)
+ test.must_exist(info_plist)
+ test.must_contain(info_plist, 'com.google.Test') # Normal expansion works.
+ test.must_contain(info_plist, 'PROCESSED_KEY1')
+ test.must_contain(info_plist, 'PROCESSED_KEY2')
+
+ test.pass_test()