示例#1
0
 def _onSilent(self):
     """Proxy function to guarantee the base implementation of onSilent is
     called.
     """
     record = self._current_record
     test_name = record.test_name
     begin_time = logger.epochToLogLineTimestamp(record.begin_time)
     if self.web.enabled:
         self.web.SetTestResult(None)
     self.onSilent(test_name, begin_time)
示例#2
0
 def _onSkip(self):
     """Proxy function to guarantee the base implementation of onSkip is
     called.
     """
     record = self._current_record
     test_name = record.test_name
     begin_time = logger.epochToLogLineTimestamp(record.begin_time)
     logging.info(RESULT_LINE_TEMPLATE, test_name, record.result)
     logging.info("Reason to skip: %s", record.details)
     if self.web.enabled:
         self.web.SetTestResult(ReportMsg.TEST_CASE_RESULT_SKIP)
     self.onSkip(test_name, begin_time)
    def _onSilent(self, record):
        """Proxy function to guarantee the base implementation of onSilent is
        called.

        Args:
            record: The records.TestResultRecord object for the skipped test
                    case.
        """
        test_name = record.test_name
        begin_time = logger.epochToLogLineTimestamp(record.begin_time)
        if self.web.enabled:
            self.web.SetTestResult(None)
        self.onSilent(test_name, begin_time)
示例#4
0
文件: base_test.py 项目: vchong/vts
 def _onException(self):
     """Proxy function to guarantee the base implementation of onException
     is called.
     """
     record = self._current_record
     test_name = record.test_name
     logging.exception(record.details)
     begin_time = logger.epochToLogLineTimestamp(record.begin_time)
     if self.web.enabled:
         self.web.SetTestResult(ReportMsg.TEST_CASE_RESULT_EXCEPTION)
     self.onException(test_name, begin_time)
     if self._bug_report_on_failure:
         self.CatchBugReport('%s-%s' % (self.TAG, record.test_name))
示例#5
0
文件: base_test.py 项目: vchong/vts
 def _onFail(self):
     """Proxy function to guarantee the base implementation of onFail is
     called.
     """
     record = self._current_record
     logging.error(record.details)
     begin_time = logger.epochToLogLineTimestamp(record.begin_time)
     logging.info(RESULT_LINE_TEMPLATE, record.test_name, record.result)
     if self.web.enabled:
         self.web.SetTestResult(ReportMsg.TEST_CASE_RESULT_FAIL)
     self.onFail(record.test_name, begin_time)
     if self._bug_report_on_failure:
         self.CatchBugReport('%s-%s' % (self.TAG, record.test_name))
示例#6
0
 def _onPass(self):
     """Proxy function to guarantee the base implementation of onPass is
     called.
     """
     record = self._current_record
     test_name = record.test_name
     begin_time = logger.epochToLogLineTimestamp(record.begin_time)
     msg = record.details
     if msg:
         logging.info(msg)
     logging.info(RESULT_LINE_TEMPLATE, test_name, record.result)
     if self.web.enabled:
         self.web.SetTestResult(ReportMsg.TEST_CASE_RESULT_PASS)
     self.onPass(test_name, begin_time)
    def _onException(self, record):
        """Proxy function to guarantee the base implementation of onException
        is called.

        Args:
            record: The records.TestResultRecord object for the failed test
                    case.
        """
        test_name = record.test_name
        logging.exception(record.details)
        begin_time = logger.epochToLogLineTimestamp(record.begin_time)
        if self.web.enabled:
            self.web.SetTestResult(ReportMsg.TEST_CASE_RESULT_EXCEPTION)
        self.onException(test_name, begin_time)
    def _onFail(self, record):
        """Proxy function to guarantee the base implementation of onFail is
        called.

        Args:
            record: The records.TestResultRecord object for the failed test
                    case.
        """
        test_name = record.test_name
        logging.error(record.details)
        begin_time = logger.epochToLogLineTimestamp(record.begin_time)
        logging.info(RESULT_LINE_TEMPLATE, test_name, record.result)
        if self.web.enabled:
            self.web.SetTestResult(ReportMsg.TEST_CASE_RESULT_FAIL)
        self.onFail(test_name, begin_time)