def _strip_flags_for_testing(flags):
    """Accepts the default configure/build flags and strips out those

    incompatible with the SQLite tests.

    When configuring SQLite to run tests this script uses a configuration
    as close to what Chromium ships as possible. Some flags need to be
    omitted for the tests to link and run correct. See comments below.
    """
    test_flags = []
    for flag in flags:
        # Omitting features can cause tests to hang/crash/fail because the
        # SQLite tests don't seem to detect feature omission. Keep them enabled.
        if flag.startswith('SQLITE_OMIT_'):
            continue

        # Some tests compile with specific SQLITE_DEFAULT_PAGE_SIZE so do
        # not hard-code.
        if flag.startswith('SQLITE_DEFAULT_PAGE_SIZE='):
            continue

        # Some tests compile with specific SQLITE_DEFAULT_MEMSTATUS so do
        # not hard-code.
        if flag.startswith('SQLITE_DEFAULT_MEMSTATUS='):
            continue

        # If enabled then get undefined reference to `uregex_open_63' and
        # other *_64 functions.
        if flag == 'SQLITE_ENABLE_ICU':
            continue

        # If defined then the fts4umlaut tests fail with the following error:
        #
        # Error: unknown tokenizer: unicode61
        if flag == 'SQLITE_DISABLE_FTS3_UNICODE':
            continue

        test_flags.append(flag)
    return test_flags