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

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

Issue 12476002: Create msvs_large_pdb workaround. (Closed) Base URL: https://git.chromium.org/git/external/gyp.git@master
Patch Set: Addressed scottmg's nits. Created 7 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
« no previous file with comments | « pylib/gyp/generator/ninja.py ('k') | test/win/large-pdb/dllmain.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 msvs_large_pdb works correctly.
9 """
10
11 import TestGyp
12
13 import struct
14 import sys
15
16
17 CHDIR = 'large-pdb'
18
19
20 def CheckImageAndPdb(test, image_basename, expected_page_size):
21 pdb_basename = image_basename + '.pdb'
22 test.built_file_must_exist(image_basename, chdir=CHDIR)
23 test.built_file_must_exist(pdb_basename, chdir=CHDIR)
24
25 # We expect the PDB to have the given page size. For full details of the
26 # header look here: https://code.google.com/p/pdbparser/wiki/MSF_Format
27 # We read the little-endian 4-byte unsigned integer at position 32 of the
28 # file.
29 pdb_path = test.built_file_path(pdb_basename, chdir=CHDIR)
30 pdb_file = open(pdb_path, 'rb')
31 pdb_file.seek(32, 0)
32 page_size = struct.unpack('<I', pdb_file.read(4))[0]
33 if page_size != expected_page_size:
34 print "Expected page size of %d, got %d for PDB file `%s'." % (
35 expected_page_size, page_size, pdb_path)
36
37
38 if sys.platform == 'win32':
39 test = TestGyp.TestGyp(formats=['msvs', 'ninja'])
40
41 test.run_gyp('large-pdb.gyp', chdir=CHDIR)
42 test.build('large-pdb.gyp', test.ALL, chdir=CHDIR)
43
44 CheckImageAndPdb(test, 'large_pdb_exe.exe', 4096)
45 CheckImageAndPdb(test, 'small_pdb_exe.exe', 1024)
46 CheckImageAndPdb(test, 'large_pdb_dll.dll', 4096)
47 CheckImageAndPdb(test, 'small_pdb_dll.dll', 1024)
48
49 test.pass_test()
OLDNEW
« no previous file with comments | « pylib/gyp/generator/ninja.py ('k') | test/win/large-pdb/dllmain.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698