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

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

Issue 9443044: Beginnings of some msvs_... emulation (windows ninja) (Closed) Base URL: https://gyp.googlecode.com/svn/trunk
Patch Set: better place for normpath to remove need for $!-no-escape Created 8 years, 9 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
Index: test/win/gyptest-link_target_machine.py
diff --git a/test/win/gyptest-link_target_machine.py b/test/win/gyptest-link_target_machine.py
new file mode 100644
index 0000000000000000000000000000000000000000..fc59ccabf81dc55cbf0d9ce87d75316e58fe96d9
--- /dev/null
+++ b/test/win/gyptest-link_target_machine.py
@@ -0,0 +1,54 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2012 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 target machine setting is extracted properly.
+"""
+
+import TestGyp
+
+import os
+import subprocess
+import sys
+
+# Find /third_party/pefile based on current directory and script path.
+sys.path.append(os.path.join(
+ os.path.dirname(__file__), '..', '..', '..', '..', 'third_party', 'pefile'))
+sys.path.append(os.path.join(
+ os.path.dirname(__file__), '..', '..', '..', '..', '..',
+ 'third_party', 'pefile'))
+import pefile
+
+if sys.platform == 'win32':
+ test = TestGyp.TestGyp(formats=['ninja', 'msvs'])
+
+ CHDIR = 'linker_flags'
+ test.run_gyp('target-machine.gyp', chdir=CHDIR)
+ test.build('target-machine.gyp', test.ALL, chdir=CHDIR)
+
+ MACHINE_TYPE_X86 = 0x14c
+ MACHINE_TYPE_AMD64 = 0x8664
+ x86 = pefile.PE(test.built_file_path('test_tm_x86.exe', chdir=CHDIR))
+ if x86.FILE_HEADER.Machine != MACHINE_TYPE_X86:
+ print 'Incorrect machine type.'
+ test.fail_test()
+ # TODO(scottmg): Toolchain doesn't support if x86 hosted, and we don't
+ # control which compiler we use very well right now.
+ #x64 = pefile.PE(test.built_file_path('test_tm_x64.exe', chdir=CHDIR))
+ #if x64.FILE_HEADER.Machine != MACHINE_TYPE_AMD64:
+ #print 'Incorrect machine type.'
+ #test.fail_test()
+
+ if test.format == 'ninja':
+ ninja_file = test.built_file_path('obj/test_tm_x86.ninja', chdir=CHDIR)
+ test.must_contain(ninja_file, '/MACHINE:X86')
+
+ #ninja_file = test.built_file_path('obj/test_tm_x64.ninja', chdir=CHDIR)
+ #test.must_contain(ninja_file, '/MACHINE:X64')
+
+ # TODO(scottmg): There's a bunch of targets, but we don't use any of them.
+
+ test.pass_test()

Powered by Google App Engine
This is Rietveld 408576698