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

fix --filter to accept multiple space-separated tokens

parent 690f2be4
Loading
Loading
Loading
Loading
+21 −7
Original line number Diff line number Diff line
@@ -1714,14 +1714,28 @@ if __name__ == "__main__":

    parser.add_argument(
        "--filter",
        type=str,
        nargs="+",
        default=None,
        metavar="TOKEN",
        help=(
            "Filter tests. Supports levels LEVEL1 LEVEL2 LEVEL3 and tags ENC DEC REND ISAR ISAR_ENC "
            "(comma/space-separated), decoder formats EXT MONO STEREO, "
            "and case-insensitive command substring filtering. Plain terms are restrictive (AND). "
            "Use +TERM to add matches and -TERM to remove matches. "
            "LEVEL3 is default. LEVEL2 is currently unsupported."
            "Select which tests to run. Accepts any combination of the following tokens: "
            "(1) Level: LEVEL1, LEVEL3 (default: LEVEL3 = no restrictions). "
            "LEVEL1 restricts ENC to <=80 kbps and DEC to EXT<=80 kbps, MONO and STEREO outputs. "
            "(2) Tag: ENC, DEC, REND, ISAR, ISAR_ENC — selects specific test groups. "
            "Under LEVEL1, +REND or +ISAR adds those groups to the default ENC+DEC set. "
            "(3) Decoder format (LEVEL1 DEC only): EXT, MONO, STEREO — further restricts which "
            "output formats are included within the already-restricted LEVEL1 DEC set. "
            "(4) Substring: any other plain token is matched case-insensitively against the test "
            "command line. Multiple plain tokens are combined with logical AND. "
            "Prefix a token with + to add matching tests to the selection, "
            "or with - to remove matching tests from the selection. "
            "Examples: "
            "'--filter LEVEL1' — run LEVEL1 ENC+DEC; "
            "'--filter LEVEL1 DEC MONO' — run only MONO tests from the LEVEL1 DEC set; "
            "'--filter LEVEL1 +REND' — run LEVEL1 ENC+DEC and also all REND tests; "
            "'--filter DEC JBM' — run DEC tests containing 'JBM'; "
            "'--filter DEC +BINAURAL' — run all DEC tests plus those containing 'BINAURAL'; "
            "'--filter DEC -voip' — run all DEC tests except those containing 'voip'."
        ),
    )
    parser.add_argument(
@@ -1774,7 +1788,7 @@ if __name__ == "__main__":
        validate_build_binaries(parser, args.cut_build_path, "CUT")

    # Parse --filter into level + optional tag selection + optional format/substring filters.
    raw_filter = args.filter or ""
    raw_filter = " ".join(args.filter) if args.filter else ""
    filter_tokens = [tok for tok in re.split(r"[\s,]+", raw_filter.strip()) if tok]

    valid_tags = set(IVAS_Bins.keys())