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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: test/win/gyptest-link-ltcg.py
===================================================================
--- test/win/gyptest-link-ltcg.py (revision 0)
+++ test/win/gyptest-link-ltcg.py (revision 0)
@@ -0,0 +1,42 @@
+#!/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 LTCG setting is extracted properly.
+"""
+
+import TestGyp
+
+import sys
+import time
+
+if sys.platform == 'win32':
+ test = TestGyp.TestGyp(formats=['msvs', 'ninja'])
+
+ CHDIR = 'linker-flags'
+ test.run_gyp('ltcg.gyp', chdir=CHDIR)
+
+ 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?
+ def GetNinjaFile(ltcg_option):
+ return test.built_file_path('obj/test_ltcg_%s.ninja' % ltcg_option,
+ chdir=CHDIR)
+ test.must_not_contain(GetNinjaFile('default'), '/LTCG')
+ test.must_contain(GetNinjaFile('use'), '/LTCG')
+ test.must_contain(GetNinjaFile('instrument'), '/LTCG:PGINSTRUMENT')
+ test.must_contain(GetNinjaFile('optimize'), '/LTCG:PGOPTIMIZE')
+ test.must_contain(GetNinjaFile('update'), '/LTCG:PGUPDATE')
+ elif test.format == 'msvs':
+ def AssertLTCGOption(ltcg_option, value):
+ return test.built_file_path('test_ltcg_%s.vcxproj' % ltcg_option,
+ chdir=CHDIR)
+ LTCG_FORMAT = '<LinkTimeCodeGeneration>%s</LinkTimeCodeGeneration>'
+ test.must_contain(vcproj, LTCG_FORMAT % ltcg_option)
+ AssertLTCGOption('default', 'Default')
+ AssertLTCGOption('use', 'UseLinkTimeCodeGeneration')
+ AssertLTCGOption('instrument', 'PGInstrument')
+ AssertLTCGOption('optimize', 'PGOptimization')
+ AssertLTCGOption('update', 'PGUpdate')
+ test.pass_test()

Powered by Google App Engine
This is Rietveld 408576698