Chromium Code Reviews| Index: test/ios/gyptest-archs.py |
| diff --git a/test/ios/gyptest-archs.py b/test/ios/gyptest-archs.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..db8c0c2c92ba1556eb3c969397fee9192ffbf10f |
| --- /dev/null |
| +++ b/test/ios/gyptest-archs.py |
| @@ -0,0 +1,45 @@ |
| +#!/usr/bin/env python |
| + |
| +# Copyright (c) 2013 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 that device and simulator bundles are built correctly. |
| +""" |
| + |
| +import plistlib |
| +import TestGyp |
| +import os |
| +import struct |
| +import subprocess |
| +import sys |
| +import tempfile |
| + |
| + |
| +def CheckFileType(file, expected): |
| + proc = subprocess.Popen(['lipo', '-info', file], stdout=subprocess.PIPE) |
| + o = proc.communicate()[0].strip() |
| + assert not proc.returncode |
| + if not expected in o: |
| + print 'File: Expected %s, got %s' % (expected, o) |
| + test.fail_test() |
| + |
|
Nico
2013/11/25 19:39:07
2 newlines between toplevel things
sdefresne
2013/11/26 09:29:16
Done.
|
| +if sys.platform == 'darwin': |
| + test = TestGyp.TestGyp() |
| + |
| + test.run_gyp('test-archs.gyp', chdir='app-bundle') |
| + test.set_configuration('Default') |
| + test.build('test-archs.gyp', test.ALL, chdir='app-bundle') |
| + |
| + for filename in ['Test No Archs', 'Test Archs i386', 'Test Archs x86_64']: |
| + result_file = test.built_file_path( |
| + '%s.bundle/%s' % (filename, filename), chdir='app-bundle') |
| + test.must_exist(result_file) |
| + |
| + expected = 'i386' |
| + if 'x86_64' in filename: |
| + expected = 'x86_64' |
| + CheckFileType(result_file, expected) |
| + |
| + test.pass_test() |