#!/usr/bin/env python # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import concurrent.futures import mock import mozunit import os import platform import shutil import struct import subprocess import sys import tempfile import unittest import buildconfig from mock import patch from mozpack.manifests import InstallManifest import mozpack.path as mozpath import symbolstore from symbolstore import normpath # Some simple functions to mock out files that the platform-specific dumpers will accept. # dump_syms itself will not be run (we mock that call out), but we can't override # the ShouldProcessFile method since we actually want to test that. def write_elf(filename): open(filename, "wb").write(struct.pack("<7B45x", 0x7f, ord("E"), ord("L"), ord("F"), 1, 1, 1)) def write_macho(filename): open(filename, "wb").write(struct.pack("= 1, 'should have a FILE line for ' + match) # Skip this check for local git repositories. if not os.path.isdir(mozpath.join(self.topsrcdir, '.hg')): return for line in match_lines: filename = line.split(None, 2)[2] self.assertEqual('hg:', filename[:3]) # Check that nsBrowserApp.cpp is listed as a FILE line, and that # it was properly mapped to the source repo. check_hg_path(file_lines, 'nsBrowserApp.cpp') # Also check Assertions.h to verify that files from dist/include # are properly mapped. check_hg_path(file_lines, 'mfbt/Assertions.h') if __name__ == '__main__': mozunit.main()