コード例 #1
0
    def _run_reftest(self):
        test_output = self._driver.run_test(self._driver_input(), self._stop_when_done)
        total_test_time = 0
        reference_output = None
        test_result = None

        # A reftest can have multiple match references and multiple mismatch references;
        # the test fails if any mismatch matches and all of the matches don't match.
        # To minimize the number of references we have to check, we run all of the mismatches first,
        # then the matches, and short-circuit out as soon as we can.
        # Note that sorting by the expectation sorts "!=" before "==" so this is easy to do.

        putAllMismatchBeforeMatch = sorted
        reference_test_names = []
        for expectation, reference_filename in putAllMismatchBeforeMatch(self._reference_files):
            reference_test_name = self._port.relative_test_filename(reference_filename)
            reference_test_names.append(reference_test_name)
            reference_output = self._driver.run_test(DriverInput(reference_test_name, self._timeout, None, should_run_pixel_test=True), self._stop_when_done)
            test_result = self._compare_output_with_reference(reference_output, test_output, reference_filename, expectation == '!=')

            if (expectation == '!=' and test_result.failures) or (expectation == '==' and not test_result.failures):
                break
            total_test_time += test_result.test_run_time

        assert(reference_output)
        test_result_writer.write_test_result(self._filesystem, self._port, self._results_directory, self._test_name, test_output, reference_output, test_result.failures)
        reftest_type = set([reference_file[0] for reference_file in self._reference_files])
        return TestResult(self._test_name, test_result.failures, total_test_time + test_result.test_run_time, test_result.has_stderr, reftest_type=reftest_type, pid=test_result.pid, references=reference_test_names)
コード例 #2
0
 def _driver_input(self):
     # The image hash is used to avoid doing an image dump if the
     # checksums match, so it should be set to a blank value if we
     # are generating a new baseline.  (Otherwise, an image from a
     # previous run will be copied into the baseline."""
     image_hash = None
     if self._should_fetch_expected_checksum():
         image_hash = self._port.expected_checksum(self._test_name, device_type=self._driver.host.device_type)
     return DriverInput(self._test_name, self._timeout, image_hash, self._should_run_pixel_test, self._should_dump_jsconsolelog_in_stderr)
コード例 #3
0
ファイル: mock_drt.py プロジェクト: tackelua/Qt
    def input_from_line(self, line):
        vals = line.strip().split()
        if len(vals) == 3:
            uri, timeout, checksum = vals
        else:
            uri, timeout = vals
            checksum = None

        test_name = self._driver.uri_to_test(uri)
        return DriverInput(test_name, timeout, checksum, self._options.pixel_tests)
コード例 #4
0
 def run_single(self,
                driver,
                test_path,
                time_out_ms,
                should_run_pixel_test=False):
     return driver.run_test(DriverInput(
         test_path,
         time_out_ms,
         image_hash=None,
         should_run_pixel_test=should_run_pixel_test),
                            stop_when_done=False)
コード例 #5
0
ファイル: mock_drt.py プロジェクト: tackelua/Qt
    def input_from_line(self, line):
        vals = line.strip().split("'")
        if len(vals) == 1:
            uri = vals[0]
            checksum = None
        else:
            uri = vals[0]
            checksum = vals[1]
        if uri.startswith('http://') or uri.startswith('https://'):
            test_name = self._driver.uri_to_test(uri)
        else:
            test_name = self._port.relative_test_filename(uri)

        return DriverInput(test_name, 0, checksum, self._options.pixel_tests)