Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Unified Diff: test/win/gyptest-masm.py

Issue 11742015: Support MASM in MSBuild and Winja (Closed) Base URL: https://chromium.googlesource.com/external/gyp.git@master
Patch Set: With tests Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pylib/gyp/win_tool.py ('k') | test/win/masm/dummyfunc-x64.asm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()
« no previous file with comments | « pylib/gyp/win_tool.py ('k') | test/win/masm/dummyfunc-x64.asm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698