third_party/blink/renderer/build/scripts/writer_test_util.py
def compare_output_dir(reference_dir, output_dir):
    """
    Compares output files in both reference_dir and output_dir.

    Note: this function ignores subdirectory content in both reference
    dir and output_dir.

    Note: reference_dir should have all ref files ending with .ref suffix.
    '.ref' suffix is added to bypass code formatter on reference files.

    :returns {bool}: Whether files in output dir matches files in ref dir
    """
    ref_content = {
        f[:-4]
        for f in os.listdir(reference_dir) if f.endswith('.ref')
    }
    output_content = set(os.listdir(output_dir))

    if ref_content != output_content:
        print 'Output files does not match.'
        print 'Following files are extra: {}'.format(output_content -
                                                     ref_content)
        print 'Following files are missing: {}'.format(ref_content -
                                                       output_content)
        return False

    for file_name in ref_content:
        ref_file = os.path.join(reference_dir, file_name) + '.ref'
        output_file = os.path.join(output_dir, file_name)

        if os.path.isdir(ref_file) and os.path.isdir(output_file):
            continue
        elif os.path.isdir(ref_file) or os.path.isdir(output_file):
            return False
        elif not is_identical_file(ref_file, output_file):
            return False

    return True

    Compares output files in both reference_dir and output_dir.

    Note: this function ignores subdirectory content in both reference
    dir and output_dir.

    Note: reference_dir should have all ref files ending with .ref suffix.
    '.ref' suffix is added to bypass code formatter on reference files.

    :returns {bool}: Whether files in output dir matches files in ref dir
    
Compares output files in both reference_dir and output_dir.
Note: this function ignores subdirectory content in both reference
dir and output_dir.

reference_dir should have all ref files ending with .ref suffix.
'.ref' suffix is added to bypass code formatter on reference files.
Compares output files in both reference_dir and output_dir . Note : this function ignores subdirectory content in both reference dir and output_dir . reference_dir should have all ref files ending with . ref suffix . ' . ref ' suffix is added to bypass code formatter on reference files .
def compare_output_dir(reference_dir, output_dir):
    ref_content = {
        f[:-4]
        for f in os.listdir(reference_dir) if f.endswith('.ref')
    }
    output_content = set(os.listdir(output_dir))
    if ref_content != output_content:
        print 'Output files does not match.'
        print 'Following files are extra: {}'.format(output_content -
                                                     ref_content)
        print 'Following files are missing: {}'.format(ref_content -
                                                       output_content)
        return False
    for file_name in ref_content:
        ref_file = os.path.join(reference_dir, file_name) + '.ref'
        output_file = os.path.join(output_dir, file_name)
        if os.path.isdir(ref_file) and os.path.isdir(output_file):
            continue
        elif os.path.isdir(ref_file) or os.path.isdir(output_file):
            return False
        elif not is_identical_file(ref_file, output_file):
            return False
    return True
def compare_output_dir ( reference_dir , output_dir ) : ref_content = { f [ : - 4 ] for f in os . listdir ( reference_dir ) if f . endswith ( '.ref' ) } output_content = set ( os . listdir ( output_dir ) ) if ref_content != output_content : print 'Output files does not match.' print 'Following files are extra: {}' . format ( output_content - ref_content ) print 'Following files are missing: {}' . format ( ref_content - output_content ) return False for file_name in ref_content : ref_file = os . path . join ( reference_dir , file_name ) + '.ref' output_file = os . path . join ( output_dir , file_name ) if os . path . isdir ( ref_file ) and os . path . isdir ( output_file ) : continue elif os . path . isdir ( ref_file ) or os . path . isdir ( output_file ) : return False elif not is_identical_file ( ref_file , output_file ) : return False return True
Compares output files in both reference_dir and output_dir.
Compares output files in both reference_dir and output_dir .
"""
    Compares output files in both reference_dir and output_dir.

    Note: this function ignores subdirectory content in both reference
    dir and output_dir.

    Note: reference_dir should have all ref files ending with .ref suffix.
    '.ref' suffix is added to bypass code formatter on reference files.

    :returns {bool}: Whether files in output dir matches files in ref dir
    """
Whether files in output dir matches files in ref dir
Whether files in output dir matches files in ref dir
{bool}
reference_dir
output_dir