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

Side by Side Diff: test/win/gyptest-link-ltcg.py

Issue 82703007: Support Visual C++ PGO in Ninja generator (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 1 month 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) 2013 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 LTCG setting is extracted properly.
9 """
10
11 import TestGyp
12
13 import sys
14 import time
15
16 if sys.platform == 'win32':
17 test = TestGyp.TestGyp(formats=['msvs', 'ninja'])
18
19 CHDIR = 'linker-flags'
20 test.run_gyp('ltcg.gyp', chdir=CHDIR)
21
22 if test.format == 'ninja':
scottmg 2013/11/23 17:15:13 would it be possible to test some effect, rather t
yukawa 2013/11/25 14:04:12 OK. Added some working samples as pgo.gyp. PTAL?
23 def GetNinjaFile(ltcg_option):
24 return test.built_file_path('obj/test_ltcg_%s.ninja' % ltcg_option,
25 chdir=CHDIR)
26 test.must_not_contain(GetNinjaFile('default'), '/LTCG')
27 test.must_contain(GetNinjaFile('use'), '/LTCG')
28 test.must_contain(GetNinjaFile('instrument'), '/LTCG:PGINSTRUMENT')
29 test.must_contain(GetNinjaFile('optimize'), '/LTCG:PGOPTIMIZE')
30 test.must_contain(GetNinjaFile('update'), '/LTCG:PGUPDATE')
31 elif test.format == 'msvs':
32 def AssertLTCGOption(ltcg_option, value):
33 return test.built_file_path('test_ltcg_%s.vcxproj' % ltcg_option,
34 chdir=CHDIR)
35 LTCG_FORMAT = '<LinkTimeCodeGeneration>%s</LinkTimeCodeGeneration>'
36 test.must_contain(vcproj, LTCG_FORMAT % ltcg_option)
37 AssertLTCGOption('default', 'Default')
38 AssertLTCGOption('use', 'UseLinkTimeCodeGeneration')
39 AssertLTCGOption('instrument', 'PGInstrument')
40 AssertLTCGOption('optimize', 'PGOptimization')
41 AssertLTCGOption('update', 'PGUpdate')
42 test.pass_test()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698