Index: test/win/gyptest-masm.py |
diff --git a/test/win/gyptest-masm.py b/test/win/gyptest-masm.py |
new file mode 100644 |
index 0000000000000000000000000000000000000000..23a69fd4c6d1bc9c3fcd2e4b7f1af89cfa27af42 |
--- /dev/null |
+++ b/test/win/gyptest-masm.py |
@@ -0,0 +1,55 @@ |
+#!/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. |
+ |
+""" |
+Make sure .asm files can be compiled with MASM. |
+""" |
+ |
+import TestGyp |
+ |
+import sys |
+import os |
+ |
+if sys.platform == 'win32': |
+ test = TestGyp.TestGyp(formats=['msvs', 'ninja']) |
+ |
+ if test.format == 'msvs' and not test.uses_msbuild: |
+ test.skip_test('Skipping test; MASM build rules are not supported for ' \ |
+ 'MSVS versions < 2010') |
+ |
+ CHDIR = 'masm' |
+ test.run_gyp('masm.gyp', chdir=CHDIR) |
+ test.build('masm.gyp', 'hello_x86', chdir=CHDIR) |
+ |
+ test.run_built_executable('hello_x86', status=1, chdir=CHDIR) |
+ |
+ # Test that defines are passed through |
+ test.run_gyp('masm.gyp', '-D', 'test_defines=1', chdir=CHDIR) |
+ test.build('masm.gyp', 'hello_x86', chdir=CHDIR) |
+ |
+ test.run_built_executable('hello_x86', status=42, chdir=CHDIR) |
+ |
+ # While 64-bit executables can be compiled on any architecture, they can only |
+ # be run on truly 64-bit systems. Try to determine if the system supports x64. |
+ if (os.environ.get('PROCESSOR_ARCHITECTURE', '').find('64') >= 0 or |
+ os.environ.get('PROCESSOR_ARCHITEW6432', '').find('64') >= 0): |
+ native_64bit_supported = True |
+ else: |
+ native_64bit_supported = False |
+ |
+ test.run_gyp('masm.gyp', chdir=CHDIR) |
+ test.build('masm.gyp', 'hello_x64', chdir=CHDIR) |
+ |
+ if native_64bit_supported: |
+ test.run_built_executable('hello_x64', status=1, chdir=CHDIR) |
+ |
+ test.run_gyp('masm.gyp', '-D', 'test_defines=1', chdir=CHDIR) |
+ test.build('masm.gyp', 'hello_x64', chdir=CHDIR) |
+ |
+ if native_64bit_supported: |
+ test.run_built_executable('hello_x64', status=42, chdir=CHDIR) |
+ |
+ test.pass_test() |