当前位置: 首页>>代码示例>>Python>>正文


Python mozcrash.check_for_java_exception函数代码示例

本文整理汇总了Python中mozcrash.check_for_java_exception函数的典型用法代码示例。如果您正苦于以下问题:Python check_for_java_exception函数的具体用法?Python check_for_java_exception怎么用?Python check_for_java_exception使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了check_for_java_exception函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: check_for_crashes

 def check_for_crashes(self):
     if self.logcat:
         if mozcrash.check_for_java_exception(self.logcat, self.test_name):
             return True
     symbols_path = self.options.symbols_path
     try:
         dump_dir = tempfile.mkdtemp()
         remote_dir = posixpath.join(self.remote_profile, 'minidumps')
         if not self.dm.dirExists(remote_dir):
             # If crash reporting is enabled (MOZ_CRASHREPORTER=1), the
             # minidumps directory is automatically created when the app
             # (first) starts, so its lack of presence is a hint that
             # something went wrong.
             print "Automation Error: No crash directory (%s) found on remote device" % \
                 remote_dir
             # Whilst no crash was found, the run should still display as a failure
             return True
         self.dm.getDirectory(remote_dir, dump_dir)
         crashed = mozcrash.log_crashes(self.log, dump_dir, symbols_path, test=self.test_name)
     finally:
         try:
             shutil.rmtree(dump_dir)
         except:
             self.log.warn("unable to remove directory: %s" % dump_dir)
     return crashed
开发者ID:Wafflespeanut,项目名称:gecko-dev,代码行数:25,代码来源:rungeckoview.py

示例2: checkForCrashes

    def checkForCrashes(self, directory, symbolsPath):
        self.checkForANRs()

        logcat = self._devicemanager.getLogcat(filterOutRegexps=fennecLogcatFilters)
        javaException = mozcrash.check_for_java_exception(logcat)
        if javaException:
            return True

        # If crash reporting is disabled (MOZ_CRASHREPORTER!=1), we can't say
        # anything.
        if not self.CRASHREPORTER:
            return False

        try:
            dumpDir = tempfile.mkdtemp()
            remoteCrashDir = self._remoteProfile + '/minidumps/'
            if not self._devicemanager.dirExists(remoteCrashDir):
                # If crash reporting is enabled (MOZ_CRASHREPORTER=1), the
                # minidumps directory is automatically created when Fennec
                # (first) starts, so its lack of presence is a hint that
                # something went wrong.
                print "Automation Error: No crash directory (%s) found on remote device" % remoteCrashDir
                # Whilst no crash was found, the run should still display as a failure
                return True
            self._devicemanager.getDirectory(remoteCrashDir, dumpDir)
            crashed = Automation.checkForCrashes(self, dumpDir, symbolsPath)

        finally:
            try:
                shutil.rmtree(dumpDir)
            except:
                print "WARNING: unable to remove directory: %s" % dumpDir
        return crashed
开发者ID:MrKeiKun,项目名称:mozilla-central,代码行数:33,代码来源:remoteautomation.py

示例3: test_unchecked_exception

 def test_unchecked_exception(self):
         """
         Test for an exception which should not be caught
         """
         passable_log = list(self.test_log)
         passable_log[0] = "01-30 20:15:41.937 E/GeckoAppShell( 1703): >>> NOT-SO-BAD EXCEPTION FROM THREAD 9 (\"GeckoBackgroundThread\")"
         self.assert_(not mozcrash.check_for_java_exception(passable_log))
开发者ID:samjain1994,项目名称:gecko-dev,代码行数:7,代码来源:test.py

示例4: test_fatal_exception

 def test_fatal_exception(self):
         """
         Test for an exception which should be caught
         """
         fatal_log = list(self.test_log)
         fatal_log[0] = "01-30 20:15:41.937 E/GeckoAppShell( 1703): >>> FATAL EXCEPTION FROM THREAD 9 (\"GeckoBackgroundThread\")"
         self.assert_(mozcrash.check_for_java_exception(fatal_log))
开发者ID:samjain1994,项目名称:gecko-dev,代码行数:7,代码来源:test.py

示例5: cleanupAndCheckForCrashes

    def cleanupAndCheckForCrashes(self, browser_config, profile_dir, test_name):
        """cleanup browser processes and process crashes if found"""

        # cleanup processes
        self._ffprocess.cleanupProcesses(browser_config['process'],
                                         browser_config['child_process'],
                                         browser_config['browser_wait'])

        # find stackwalk binary
        if platform.system() in ('Windows', 'Microsoft'):
            stackwalkpaths = ['win32', 'minidump_stackwalk.exe']
        elif platform.system() == 'Linux':
            # are we 64 bit?
            if '64' in platform.architecture()[0]:
                stackwalkpaths = ['linux64', 'minidump_stackwalk']
            else:
                stackwalkpaths = ['linux', 'minidump_stackwalk']
        elif platform.system() == 'Darwin':
            stackwalkpaths = ['osx', 'minidump_stackwalk']
        else:
            # no minidump_stackwalk available for your platform
            return
        stackwalkbin = os.path.join(os.path.dirname(__file__), 'breakpad', *stackwalkpaths)
        assert os.path.exists(stackwalkbin), "minidump_stackwalk binary not found: %s" % stackwalkbin

        if browser_config['remote'] is True:
            # favour using Java exceptions in the logcat over minidumps
            if os.path.exists('logcat.log'):
                with open('logcat.log') as f:
                    logcat = f.read().split('\r')
                found = mozcrash.check_for_java_exception(logcat)

            remoteminidumpdir = profile_dir + '/minidumps/'
            if not found:
                # check for minidumps
                minidumpdir = tempfile.mkdtemp()
                try:
                    if self._ffprocess.testAgent.dirExists(remoteminidumpdir):
                        self._ffprocess.testAgent.getDirectory(remoteminidumpdir, minidumpdir)
                except mozdevice.DMError:
                    print "Remote Device Error: Error getting crash minidumps from device"
                    raise
                found = mozcrash.check_for_crashes(minidumpdir,
                                                   browser_config['symbols_path'],
                                                   stackwalk_binary=stackwalkbin,
                                                   test_name=test_name)
                self._hostproc.removeDirectory(minidumpdir)

            # cleanup dumps on remote
            self._ffprocess.testAgent.removeDir(remoteminidumpdir)
        else:
            # check for minidumps
            minidumpdir = os.path.join(profile_dir, 'minidumps')
            found = mozcrash.check_for_crashes(minidumpdir,
                                               browser_config['symbols_path'],
                                               stackwalk_binary=stackwalkbin,
                                               test_name=test_name)

        if found:
            raise talosCrash("Found crashes after test run, terminating test")
开发者ID:lundjordan,项目名称:build-talos,代码行数:60,代码来源:ttest.py

示例6: test_truncated_exception

 def test_truncated_exception(self):
         """
         Test for an exception which should be caught which
         was truncated
         """
         truncated_log = list(self.test_log)
         truncated_log[0], truncated_log[1] = truncated_log[1], truncated_log[0]
         self.assert_(mozcrash.check_for_java_exception(truncated_log))
开发者ID:samjain1994,项目名称:gecko-dev,代码行数:8,代码来源:test.py

示例7: test_unchecked_exception

 def test_unchecked_exception(self):
     """
            Test for an exception which should not be caught
            """
     passable_log = list(self.test_log)
     passable_log[
         0
     ] = '01-30 20:15:41.937 E/GoannaAppShell( 1703): >>> NOT-SO-BAD EXCEPTION FROM THREAD 9 ("GoannaBackgroundThread")'
     self.assert_(not mozcrash.check_for_java_exception(passable_log, quiet=True))
开发者ID:Antonius32,项目名称:Pale-Moon,代码行数:9,代码来源:test.py

示例8: test_fatal_exception

 def test_fatal_exception(self):
     """
            Test for an exception which should be caught
            """
     fatal_log = list(self.test_log)
     fatal_log[
         0
     ] = '01-30 20:15:41.937 E/GoannaAppShell( 1703): >>> FATAL EXCEPTION FROM THREAD 9 ("GoannaBackgroundThread")'
     self.assert_(mozcrash.check_for_java_exception(fatal_log, quiet=True))
开发者ID:Antonius32,项目名称:Pale-Moon,代码行数:9,代码来源:test.py

示例9: checkForCrashes

    def checkForCrashes(self, directory, symbolsPath):
        self.checkForANRs()
        self.checkForTombstones()

        logcat = self._devicemanager.getLogcat(filterOutRegexps=fennecLogcatFilters)
        javaException = mozcrash.check_for_java_exception(logcat)
        if javaException:
            return True

        # No crash reporting
        return False
开发者ID:AOSC-Dev,项目名称:Pale-Moon,代码行数:11,代码来源:remoteautomation.py

示例10: checkForCrashes

    def checkForCrashes(self, directory, symbolsPath):
        self.checkForANRs()
        self.checkForTombstones()

        logcat = self._device.get_logcat(
            filter_out_regexps=fennecLogcatFilters)

        javaException = mozcrash.check_for_java_exception(
            logcat, test_name=self.lastTestSeen)
        if javaException:
            return True

        # If crash reporting is disabled (MOZ_CRASHREPORTER!=1), we can't say
        # anything.
        if not self.CRASHREPORTER:
            return False

        try:
            dumpDir = tempfile.mkdtemp()
            remoteCrashDir = posixpath.join(self._remoteProfile, 'minidumps')
            if not self._device.is_dir(remoteCrashDir):
                # If crash reporting is enabled (MOZ_CRASHREPORTER=1), the
                # minidumps directory is automatically created when Fennec
                # (first) starts, so its lack of presence is a hint that
                # something went wrong.
                print("Automation Error: No crash directory (%s) found on remote device" %
                      remoteCrashDir)
                return True
            self._device.pull(remoteCrashDir, dumpDir)

            logger = get_default_logger()
            crashed = mozcrash.log_crashes(
                logger, dumpDir, symbolsPath, test=self.lastTestSeen)

        finally:
            try:
                shutil.rmtree(dumpDir)
            except Exception as e:
                print("WARNING: unable to remove directory %s: %s" % (
                    dumpDir, str(e)))
        return crashed
开发者ID:marcoscaceres,项目名称:gecko-dev,代码行数:41,代码来源:remoteautomation.py

示例11: test_uncaught_exception

 def test_uncaught_exception(self):
         """
         Test for an exception which should be caught
         """
         self.assert_(mozcrash.check_for_java_exception(self.test_log))
开发者ID:samjain1994,项目名称:gecko-dev,代码行数:5,代码来源:test.py


注:本文中的mozcrash.check_for_java_exception函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。