Commit a89e902a authored by Vladimir Malenovsky's avatar Vladimir Malenovsky
Browse files

corrections to MASA MD parsing

parent 67b05595
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -1136,6 +1136,30 @@ class MLDConformance:
    def analyseOneCommandFromTuple(self, args):
        return self.analyseOneCommand(*args)

    def _expectedMasaMDMetFiles(self, tag: str) -> list[str]:
        """Return expected DUT-side .met files for a tag's selected tests."""
        if tag not in {"ENC", "DEC", "REND"}:
            return []

        met_files = []
        for pyTestsTag in self.getSelectedTestsForTag(tag):
            testDesc = self.TestDesc[tag][pyTestsTag]

            if tag == "ENC":
                if not isinstance(testDesc, BitstreamTestDescriptor):
                    continue
                dut_dec_output = testDesc.dutOutput.replace(".192", "_CUT_REFDECODED.wav")
                met_files.append(dut_dec_output + ".met")
            else:
                if not isinstance(testDesc, TestDescriptor):
                    continue
                met_files.append(testDesc.dutOutput + ".met")

        return met_files

    def _hasAnyProducedMasaMDMetFile(self, tag: str) -> bool:
        return any(os.path.exists(path) for path in self._expectedMasaMDMetFiles(tag))

    def _outputFormatsInCommand(self, rawCmdline: str) -> set[str]:
        text = rawCmdline.upper()
        formats = set()