Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 | 2 |
| 3 # Copyright (c) 2012 Google Inc. All rights reserved. | 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 | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 """ | 7 """ |
| 8 Verifies that app bundles are built correctly. | 8 Verifies that app bundles are built correctly. |
| 9 """ | 9 """ |
| 10 | 10 |
| 11 import TestGyp | 11 import TestGyp |
| 12 | 12 |
| 13 import os | |
| 13 import sys | 14 import sys |
| 14 | 15 |
| 16 | |
| 17 def ls(path): | |
| 18 '''Returns a list of all files in a directory, relative to the directory.''' | |
| 19 result = [] | |
| 20 for dirpath, _, files in os.walk(path): | |
| 21 for f in files: | |
| 22 result.append(os.path.join(dirpath, f)[len(path) + 1:]) | |
| 23 return result | |
| 24 | |
| 25 | |
| 15 if sys.platform == 'darwin': | 26 if sys.platform == 'darwin': |
| 16 test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode']) | 27 test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode']) |
| 17 | 28 |
| 18 test.run_gyp('framework.gyp', chdir='framework') | 29 test.run_gyp('framework.gyp', chdir='framework') |
| 19 | 30 |
| 20 test.build('framework.gyp', 'test_framework', chdir='framework') | 31 test.build('framework.gyp', 'test_framework', chdir='framework') |
| 21 | 32 |
| 22 # Binary | 33 # Binary |
| 23 test.built_file_must_exist( | 34 test.built_file_must_exist( |
| 24 'Test Framework.framework/Versions/A/Test Framework', | 35 'Test Framework.framework/Versions/A/Test Framework', |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 40 chdir='framework') | 51 chdir='framework') |
| 41 test.built_file_must_exist('Test Framework.framework/Resources', | 52 test.built_file_must_exist('Test Framework.framework/Resources', |
| 42 chdir='framework') | 53 chdir='framework') |
| 43 test.built_file_must_exist('Test Framework.framework/Test Framework', | 54 test.built_file_must_exist('Test Framework.framework/Test Framework', |
| 44 chdir='framework') | 55 chdir='framework') |
| 45 # PkgInfo. | 56 # PkgInfo. |
| 46 test.built_file_must_not_exist( | 57 test.built_file_must_not_exist( |
| 47 'Test Framework.framework/Versions/A/Resources/PkgInfo', | 58 'Test Framework.framework/Versions/A/Resources/PkgInfo', |
| 48 chdir='framework') | 59 chdir='framework') |
| 49 | 60 |
| 61 # Check that no other files get added to the bundle. | |
| 62 print set(ls(test.built_file_path('Test Framework.framework', | |
| 63 chdir='framework'))) | |
| 64 if set(ls(test.built_file_path('Test Framework.framework', | |
| 65 chdir='framework'))) != \ | |
| 66 set(['Versions/A/Test Framework', | |
| 67 'Versions/A/Resources/Info.plist', | |
| 68 'Versions/A/Resources/English.lproj/InfoPlist.strings', | |
| 69 'Test Framework', | |
|
Mark Mentovai
2013/08/27 21:40:45
There are no symlinks in here?
Nico
2013/08/27 21:42:35
"Test Framework" is a symlink to the binary (point
Mark Mentovai
2013/08/27 21:44:35
Hmph. I was expecting to see Versions/Current and
Nico
2013/08/27 21:45:56
The existence of the symlinks is checked explicitl
| |
| 70 'Versions/A/Libraries/empty.c', # Written by a gyp action. | |
| 71 ]): | |
| 72 test.fail_test() | |
| 73 | |
| 50 test.pass_test() | 74 test.pass_test() |
| OLD | NEW |