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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 #!/usr/bin/env python
2
3 # Copyright (c) 2012 Google Inc. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
6
7 """
8 Make sure function-level linking setting is extracted properly.
9 """
10
11 import TestGyp
12
13 import subprocess
14 import sys
15
16 if sys.platform == 'win32':
17 test = TestGyp.TestGyp(formats=['ninja', 'msvs'])
18
19 CHDIR = 'compiler_flags'
20 test.run_gyp('function-level-linking.gyp', chdir=CHDIR)
21 test.build('function-level-linking.gyp', test.ALL, chdir=CHDIR)
22
23 def CheckForSectionString(binary, string):
24 proc = subprocess.Popen(['dumpbin', '/headers', binary],
25 stdout=subprocess.PIPE)
26 output = proc.communicate()[0]
27 assert not proc.returncode
28 if string not in output:
29 print 'Did not find "%s" in %s' % (string, binary)
30 test.fail_test()
31
32 def ObjName(proj, obj):
33 if test.format == 'ninja':
34 sep = '.'
35 else:
36 sep = '\\'
37 return 'obj\\%s%s%s' % (proj, sep, obj)
38
39 look_for = '''COMDAT; sym= "int __cdecl stripped_function'''
40 CheckForSectionString(
41 test.built_file_path(ObjName('test_fll_on', 'function_level_linking.obj'),
42 chdir=CHDIR),
43 look_for)
44
45 if test.format == 'ninja':
46 ninja_file = test.built_file_path('obj/test_fll_off.ninja', chdir=CHDIR)
47 test.must_contain(ninja_file, 'cflags = /Gy-')
48
49 ninja_file = test.built_file_path('obj/test_fll_on.ninja', chdir=CHDIR)
50 test.must_contain(ninja_file, 'cflags = /Gy')
51 test.must_not_contain(ninja_file, '/Gy-')
52
53 test.pass_test()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698