Loading scripts/ivas_conformance/runConformance.py +15 −9 Original line number Diff line number Diff line Loading @@ -37,8 +37,8 @@ import re import numpy as np import subprocess import tempfile import threading import sys from multiprocessing import Value from concurrent.futures import ThreadPoolExecutor from itertools import repeat import shutil Loading Loading @@ -115,10 +115,13 @@ class MLDConformance: self.testvecDir = args.testvecDir self.toolsdir = os.path.join(self.scriptsDir, "tools") self.testvDir = os.path.join(self.testvecDir, "testv") self.executedTests = Value("i", 0) self.failedTests = Value("i", 0) self.executedTests = 0 self.failedTests = 0 self.setup() # synchronize all writes to state variables self.lock = threading.Lock() def accumulateCommands(self): for root, _, files in os.walk(self.testvecDir): for file_name in files: Loading Loading @@ -207,7 +210,8 @@ class MLDConformance: + [refEncOutput, refDecOutputFile] ) self.process(command=" ".join(refDecCmd)) self.executedTests.value += 1 with self.lock: self.executedTests += 1 self.stats() def runReferenceGeneration(self): Loading Loading @@ -386,7 +390,8 @@ class MLDConformance: self.runOneRendererTest(tag, command) else: assert False, f"Un-implemented Tag {tag}" self.executedTests.value += 1 with self.lock: self.executedTests += 1 self.stats() def runTag(self, tag: str): Loading Loading @@ -430,13 +435,14 @@ class MLDConformance: if c.returncode: with open(self.failedCmdsFile, "a") as f: f.write(command + "\n") self.failedTests.value += 1 with self.lock: self.failedTests += 1 # c.check_returncode() return 0 def stats(self): print( f"Executed: {self.executedTests.value} / {self.totalTests} Failed: {self.failedTests.value}", f"Executed: {self.executedTests} / {self.totalTests} Failed: {self.failedTests}", end="\r", ) Loading Loading @@ -619,6 +625,6 @@ if __name__ == "__main__": # final \n makes sure that the output from stat() is readable after the command terminates print() if conformance.failedTests.value != 0: print(f"Error: {conformance.failedTests.value} tests failed") if conformance.failedTests != 0: print(f"Error: {conformance.failedTests} tests failed") sys.exit(1) Loading
scripts/ivas_conformance/runConformance.py +15 −9 Original line number Diff line number Diff line Loading @@ -37,8 +37,8 @@ import re import numpy as np import subprocess import tempfile import threading import sys from multiprocessing import Value from concurrent.futures import ThreadPoolExecutor from itertools import repeat import shutil Loading Loading @@ -115,10 +115,13 @@ class MLDConformance: self.testvecDir = args.testvecDir self.toolsdir = os.path.join(self.scriptsDir, "tools") self.testvDir = os.path.join(self.testvecDir, "testv") self.executedTests = Value("i", 0) self.failedTests = Value("i", 0) self.executedTests = 0 self.failedTests = 0 self.setup() # synchronize all writes to state variables self.lock = threading.Lock() def accumulateCommands(self): for root, _, files in os.walk(self.testvecDir): for file_name in files: Loading Loading @@ -207,7 +210,8 @@ class MLDConformance: + [refEncOutput, refDecOutputFile] ) self.process(command=" ".join(refDecCmd)) self.executedTests.value += 1 with self.lock: self.executedTests += 1 self.stats() def runReferenceGeneration(self): Loading Loading @@ -386,7 +390,8 @@ class MLDConformance: self.runOneRendererTest(tag, command) else: assert False, f"Un-implemented Tag {tag}" self.executedTests.value += 1 with self.lock: self.executedTests += 1 self.stats() def runTag(self, tag: str): Loading Loading @@ -430,13 +435,14 @@ class MLDConformance: if c.returncode: with open(self.failedCmdsFile, "a") as f: f.write(command + "\n") self.failedTests.value += 1 with self.lock: self.failedTests += 1 # c.check_returncode() return 0 def stats(self): print( f"Executed: {self.executedTests.value} / {self.totalTests} Failed: {self.failedTests.value}", f"Executed: {self.executedTests} / {self.totalTests} Failed: {self.failedTests}", end="\r", ) Loading Loading @@ -619,6 +625,6 @@ if __name__ == "__main__": # final \n makes sure that the output from stat() is readable after the command terminates print() if conformance.failedTests.value != 0: print(f"Error: {conformance.failedTests.value} tests failed") if conformance.failedTests != 0: print(f"Error: {conformance.failedTests} tests failed") sys.exit(1)