Commit 63e3f72b authored by Jan Kiene's avatar Jan Kiene
Browse files

raise exception instead of pytest.fail for non-zero ret codes

this should fix the error reporting in html report
parent 95a776dd
Loading
Loading
Loading
Loading
+9 −24
Original line number Diff line number Diff line
@@ -680,19 +680,14 @@ class EncoderFrontend:
            stderr_str = textwrap.indent(self.stderr, prefix="\t")
            log_dbg_msg(f"{self._type} encoder stderr:\n{stderr_str}")
        if self.returncode:
            pytest.fail(
            raise RuntimeError(
                f"{self._type} encoder terminated with a non-0 return code: {self.returncode}"
            )
        if self.stderr and "UndefinedBehaviorSanitizer" in self.stderr:
            pytest.fail("Undefined Behaviour runtime error encountered")
            raise RuntimeError("Undefined Behaviour runtime error encountered")

    def _check_run(self):
        if self.returncode is not None:
            if self.returncode:
                pytest.fail(
                    f"{self._type} encoder terminated with a non-0 return code: {self.returncode}"
                )
        else:
        if self.returncode is None:
            logger.warning("%s encoder was set-up, but not run", self._type)
        # next assert is not OK since stderr contains messages even when encoding was successful
        # assert not self.stderr, self._type + " encoder stderr is not empty"
@@ -964,19 +959,14 @@ class DecoderFrontend:
            stderr_str = textwrap.indent(self.stderr, prefix="\t")
            log_dbg_msg(f"{self._type} decoder stderr:\n{stderr_str}")
        if self.returncode:
            pytest.fail(
            raise RuntimeError(
                f"{self._type} decoder terminated with a non-0 return code: {self.returncode}"
            )
        if self.stderr and "UndefinedBehaviorSanitizer" in self.stderr:
            pytest.fail("Undefined Behaviour runtime error encountered")
            raise RuntimeError("Undefined Behaviour runtime error encountered")

    def _check_run(self):
        if self.returncode is not None:
            if self.returncode:
                pytest.fail(
                    f"{self._type} decoder terminated with a non-0 return code: {self.returncode}"
                )
        else:
        if self.returncode is None:
            logger.warning("%s decoder was set-up, but not run", self._type)
        # next assert is not OK since stderr contains messages even when decoding was successful
        # assert not self.stderr, self._type + " decoder stderr is not empty"
@@ -1466,19 +1456,14 @@ class PostRendFrontend:
            stderr_str = textwrap.indent(self.stderr, prefix="\t")
            log_dbg_msg(f"{self._type} post-rend stderr:\n{stderr_str}")
        if self.returncode:
            pytest.fail(
            raise RuntimeError(
                f"{self._type} post-rend terminated with a non-0 return code: {self.returncode}"
            )
        if self.stderr and "UndefinedBehaviorSanitizer" in self.stderr:
            pytest.fail("Undefined Behaviour runtime error encountered")
            raise RuntimeError("Undefined Behaviour runtime error encountered")

    def _check_run(self):
        if self.returncode is not None:
            if self.returncode:
                pytest.fail(
                    f"{self._type} post-rend terminated with a non-0 return code: {self.returncode}"
                )
        else:
        if self.returncode is None:
            logger.warning("%s post-rend was set-up, but not run", self._type)
        # next assert is not OK since stderr contains messages even when decoding was successful
        # assert not self.stderr, self._type + " decoder stderr is not empty"