20
if sys.platform in ('darwin', 'win32'):
21
print "This test is currently disabled: https://crbug.com/483696."
25
def CheckFileXMLPropertyList(file):
26
output = subprocess.check_output(['file', file])
27
# The double space after XML is intentional.
28
if not 'XML document text' in output:
29
print 'File: Expected XML document text, got %s' % output
32
def ExpectEq(expected, actual):
33
if expected != actual:
34
print >>sys.stderr, 'Expected "%s", got "%s"' % (expected, actual)
18
38
'''Returns a list of all files in a directory, relative to the directory.'''
38
58
info_plist = test.built_file_path('Test App Gyp.app/Contents/Info.plist',
39
59
chdir='app-bundle')
40
60
test.must_exist(info_plist)
41
test.must_contain(info_plist, 'com.google.Test App Gyp') # Variable expansion
61
test.must_contain(info_plist, 'com.google.Test-App-Gyp') # Variable expansion
42
62
test.must_not_contain(info_plist, '${MACOSX_DEPLOYMENT_TARGET}');
63
CheckFileXMLPropertyList(info_plist)
65
if test.format != 'make':
66
# TODO: Synthesized plist entries aren't hooked up in the make generator.
67
machine = subprocess.check_output(['sw_vers', '-buildVersion']).rstrip('\n')
68
plist = plistlib.readPlist(info_plist)
69
ExpectEq(machine, plist['BuildMachineOSBuild'])
71
# Prior to Xcode 5.0.0, SDKROOT (and thus DTSDKName) was only defined if
72
# set in the Xcode project file. Starting with that version, it is always
75
if TestMac.Xcode.Version() >= '0500':
76
version = TestMac.Xcode.SDKVersion()
77
expected = 'macosx' + version
78
ExpectEq(expected, plist['DTSDKName'])
79
sdkbuild = TestMac.Xcode.SDKBuild()
81
# Above command doesn't work in Xcode 4.2.
82
sdkbuild = plist['BuildMachineOSBuild']
83
ExpectEq(sdkbuild, plist['DTSDKBuild'])
84
ExpectEq(TestMac.Xcode.Version(), plist['DTXcode'])
85
ExpectEq(TestMac.Xcode.Build(), plist['DTXcodeBuild'])
45
88
strings_files = ['InfoPlist.strings', 'utf-16be.strings', 'utf-16le.strings']