Chromium Code Reviews| Index: test/mac/gyptest-archs.py |
| =================================================================== |
| --- test/mac/gyptest-archs.py (revision 0) |
| +++ test/mac/gyptest-archs.py (revision 0) |
| @@ -0,0 +1,37 @@ |
| +#!/usr/bin/env python |
| + |
| +# Copyright (c) 2011 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. |
| + |
| +""" |
| +Tests things related to ARCHS. |
| +""" |
| + |
| +import TestGyp |
| + |
| +import subprocess |
| +import sys |
| + |
| +if sys.platform == 'darwin': |
| + def CheckFileType(file, expected): |
| + proc = subprocess.Popen(['file', '-b', file], stdout=subprocess.PIPE) |
| + o = proc.communicate()[0].strip() |
| + assert not proc.returncode |
| + if o != expected: |
| + print 'File: Expected %s, got %s' % (expected, o) |
| + test.fail_test() |
|
Nico
2012/02/14 06:25:46
Is test in scope here?
ukai
2012/02/14 06:38:39
move L25 before def CheckFileType
|
| + |
| + test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode']) |
| + |
|
Nico
2012/02/14 06:25:46
Nit: 2 space indent
ukai
2012/02/14 06:38:39
Done.
|
| + test.run_gyp('test-no-archs.gyp', chdir='archs') |
| + test.build('test-no-archs.gyp', test.ALL, chdir='archs') |
| + result_file = test.built_file_path('Test', chdir='archs') |
| + test.must_exist(result_file) |
| + CheckFileType(result_file, 'Mach-O executable i386') |
| + |
| + test.run_gyp('test-archs-x86_64.gyp', chdir='archs') |
| + test.build('test-archs-x86_64.gyp', test.ALL, chdir='archs') |
| + result_file = test.built_file_path('Test64', chdir='archs') |
| + test.must_exist(result_file) |
| + CheckFileType(result_file, 'Mach-O 64-bit executable x86_64') |