예제 #1
0
    def output_compare(self, testid):
        """Sets .reason to True iff either:
            a. The RC is 0, there is no .err file for this test, and the
               filtered .stdout contents are equal to the filtered standard
               file; or
            b. The RC is non-zero, there is a .err file for this test, and
               the filtered error output equals the filtered standard error
               output.
        and otherwise sets .reason to error message."""

        self.reason = True
        if self.standard_error_file(testid):
            if self.rc == 0:
                self.reason = "Program did not detect error---exit code 0."
            else:
                std_err_output = \
                      testing.contents(self.standard_error_file(testid))
                if self.stderr is None or \
                   self.error_filter(testid, self.stderr) != std_err_output:
                    self.reason = "Missing error message or extra error output"
        elif self.rc != 0:
            self.reason = "Execution error---exit code not 0."
        else:
            std = self.to_lines(
                testing.contents(self.standard_output_file(testid)))
            test_out = self.to_lines(self.stdout)
            if set(std) != set(test_out):
                self.reason = "Wrong set of rebuilding command issued"
예제 #2
0
    def output_compare(self, testid):
        """Sets .reason to True iff either:
            a. The RC is 0, there is no .err file for this test, and the
               filtered .stdout contents are equal to the filtered standard
               file; or
            b. The RC is non-zero, there is a .err file for this test, and
               the filtered error output equals the filtered standard error
               output.
        and otherwise sets .reason to error message."""

        self.reason = True
        if self.standard_error_file(testid):
            if self.rc == 0:
                self.reason = "Program did not detect error---exit code 0."
            else:
                std_err_output = \
                      testing.contents(self.standard_error_file(testid))
                if self.stderr is None or \
                   self.error_filter(testid, self.stderr) != std_err_output:
                    self.reason = "Missing error message or extra error output"
        elif self.rc != 0:
            self.reason = "Execution error---exit code not 0."
        else:
            std = self.to_lines(testing.contents(self.standard_output_file
                                                 (testid)))
            test_out = self.to_lines(self.stdout)
            if set(std) != set(test_out):
                self.reason = "Wrong set of rebuilding command issued"
            elif not ordered(test_out):
                self.reason = "Rebuilding commands have invalid ordering"
예제 #3
0
파일: tester.py 프로젝트: ezw1215/repo2
 def output_compare(self, id):
     if self.rc == 0:
         self.reason = True
         for (_, output, _), (_, std, _) \
                 in zip(self.output_files(id),
                        self.standard_output_files(id)):
             if self.output_filter(id, contents(output)) \
                    != self.output_filter(id, contents(std)):
                 self.reason = "Output(s) do not all match expected output(s)."
                 return
     elif not self.stderr.strip():
         self.reason = "unknown error"
     else:
         self.reason = self.stderr.strip()
예제 #4
0
 def input_files(self, id):
     result = list(super().input_files(id))
     content = testing.contents(self.standard_input_file(id))
     for db in re.findall(r'(?:^\s*load|;\s*load)\s+(\w+)', content):
         result.append((db + ".db", join(self.base_dir(id),
                                         db + ".db"), None))
     return result
예제 #5
0
파일: tester.py 프로젝트: uptownfunk/db61b
 def input_files(self, id):
     result = list(super().input_files(id))
     content = testing.contents(self.standard_input_file(id))
     for db in re.findall(r'(?:^\s*load|;\s*load)\s+(\w+)', content):
         result.append((db + ".db",
                        join(self.base_dir(id), db + ".db"), None))
     return result
예제 #6
0
 def output_compare(self, testid):
     standard = self.standard_output_file(testid)
     if self.rc != 0:
         self.reason = "Program exited abnormally: {}" \
                           .format(interpret_problem(self.rc, self.stderr))
         return
     elif self.stdout is not None and standard:
         self.reason = compare_loose(self.output_filter(testid, self.stdout),
                                     self.output_filter(testid,
                                                        contents(standard)))
         if self.reason is not True:
             return
     if self.stderr:
         self.reason = "Error output is not empty."
     else:
         self.reason = True
예제 #7
0
    def output_compare(self, testid):
        """Sets .reason to True iff either:
            a. The RC is 0, there is no .err file for this test, and the
               filtered .stdout contents are equal to the filtered standard
               file; or
            b. The RC is non-zero, there is a .err file for this test, and
               the filtered error output equals the filtered standard error
               output.
        and otherwise sets .reason to error message."""

        self.reason = True
        if self.standard_error_file(testid):
            if self.rc == 0:
                self.reason = "Program did not detect error---exit code 0."
            else:
                std_err_output = \
                      testing.contents(self.standard_error_file(testid))
                if self.stderr is None or \
                   self.error_filter(testid, self.stderr) != std_err_output:
                    self.reason = "Missing error message or extra error output"
        else:
            super().output_compare(testid)
예제 #8
0
    def output_compare(self, testid):
        """Sets .reason to True iff either:
            a. The RC is 0, there is no .err file for this test, and the
               filtered .stdout contents are equal to the filtered standard
               file; or
            b. The RC is non-zero, there is a .err file for this test, and
               the filtered error output equals the filtered standard error
               output.
        and otherwise sets .reason to error message."""

        self.reason = True
        if self.standard_error_file(testid):
            if self.rc == 0:
                self.reason = "Program did not detect error---exit code 0."
            else:
                std_err_output = \
                      testing.contents(self.standard_error_file(testid))
                if self.stderr is None or \
                   self.error_filter(testid, self.stderr) != std_err_output:
                    self.reason = "Missing error message or extra error output"
        else:
            super().output_compare(testid)