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

Unified Diff: test/win/gyptest-cl_function_level_linking.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-cl_function_level_linking.py
diff --git a/test/win/gyptest-cl_function_level_linking.py b/test/win/gyptest-cl_function_level_linking.py
new file mode 100644
index 0000000000000000000000000000000000000000..69a091d5510a1a02fd4174652912eb68d8adc6c7
--- /dev/null
+++ b/test/win/gyptest-cl_function_level_linking.py
@@ -0,0 +1,53 @@
+#!/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 function-level linking setting is extracted properly.
+"""
+
+import TestGyp
+
+import subprocess
+import sys
+
+if sys.platform == 'win32':
+ test = TestGyp.TestGyp(formats=['ninja', 'msvs'])
+
+ CHDIR = 'compiler_flags'
+ test.run_gyp('function-level-linking.gyp', chdir=CHDIR)
+ test.build('function-level-linking.gyp', test.ALL, chdir=CHDIR)
+
+ def CheckForSectionString(binary, string):
+ proc = subprocess.Popen(['dumpbin', '/headers', binary],
+ stdout=subprocess.PIPE)
+ output = proc.communicate()[0]
+ assert not proc.returncode
+ if string not in output:
+ print 'Did not find "%s" in %s' % (string, binary)
+ test.fail_test()
+
+ def ObjName(proj, obj):
+ if test.format == 'ninja':
+ sep = '.'
+ else:
+ sep = '\\'
+ return 'obj\\%s%s%s' % (proj, sep, obj)
+
+ look_for = '''COMDAT; sym= "int __cdecl stripped_function'''
+ CheckForSectionString(
+ test.built_file_path(ObjName('test_fll_on', 'function_level_linking.obj'),
+ chdir=CHDIR),
+ look_for)
+
+ if test.format == 'ninja':
+ ninja_file = test.built_file_path('obj/test_fll_off.ninja', chdir=CHDIR)
+ test.must_contain(ninja_file, 'cflags = /Gy-')
+
+ ninja_file = test.built_file_path('obj/test_fll_on.ninja', chdir=CHDIR)
+ test.must_contain(ninja_file, 'cflags = /Gy')
+ test.must_not_contain(ninja_file, '/Gy-')
+
+ test.pass_test()

Powered by Google App Engine
This is Rietveld 408576698