#!/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 msvs_large_pdb works correctly. """ import TestGyp import struct import sys if sys.platform == 'win32': print "This test is currently disabled: https://crbug.com/483696." sys.exit(0) CHDIR = 'large-pdb' def CheckImageAndPdb(test, image_basename, expected_page_size, pdb_basename=None): if not pdb_basename: pdb_basename = image_basename + '.pdb' test.built_file_must_exist(image_basename, chdir=CHDIR) test.built_file_must_exist(pdb_basename, chdir=CHDIR) # We expect the PDB to have the given page size. For full details of the # header look here: https://code.google.com/p/pdbparser/wiki/MSF_Format # We read the little-endian 4-byte unsigned integer at position 32 of the # file. pdb_path = test.built_file_path(pdb_basename, chdir=CHDIR) pdb_file = open(pdb_path, 'rb') pdb_file.seek(32, 0) page_size = struct.unpack('