Commit e1bd0148 authored by Jan Kiene's avatar Jan Kiene
Browse files

add environment-variable control for writing to dev/null

parent 7f779796
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -45,6 +45,8 @@ import pytest
logger = logging.getLogger(__name__)
USE_LOGGER_FOR_DBG = False  # current tests do not make use of the logger feature

# hack for not writing to disk -> useful for measuring coverage of exhaustive tests
WRITE_TO_NULL = True if "WRITE_TO_NULL" in os.environ else False

def log_dbg_msg(message):
    """
@@ -268,7 +270,7 @@ class EncoderFrontend:
            str(bitrate),
            str(input_sampling_rate),
            str(input_path),
            str(output_bitstream_path),
            str(output_bitstream_path) if not WRITE_TO_NULL else "/dev/null",
        ]

        cmd_str = textwrap.indent(" ".join(command), prefix="\t")
@@ -430,7 +432,7 @@ class DecoderFrontend:
        command += [
            str(output_sampling_rate),
            str(input_bitstream_path),
            str(output_path),
            str(output_path) if not WRITE_TO_NULL else "/dev/null",
        ]

        cmd_str = textwrap.indent(" ".join(command), prefix="\t")