Skip to content

Commit

Permalink
Print result returned by compare_files.
Browse files Browse the repository at this point in the history
No differences on dependencies are shown with commit
https://crrev.com/29b5fd95fd5f5b1e815cca5ef12c596a4e609620.
That is because the code did not print difference at all.
Let me print it if exists.

Also, shows number of deps.

BUG=314403

Review-Url: https://codereview.chromium.org/2293383005
Cr-Commit-Position: refs/heads/master@{#415947}
  • Loading branch information
yoshisatoyanagisawa authored and Commit bot committed Sep 1, 2016
1 parent eae359b commit 6eff2be
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tools/determinism/compare_build_artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,19 +544,22 @@ def get_deps(build_dir, target):
def compare_deps(first_dir, second_dir, targets):
"""Print difference of dependent files."""
for target in targets:
print 'Checking %s difference:' % target
first_deps = get_deps(first_dir, target)
second_deps =get_deps(second_dir, target)
second_deps = get_deps(second_dir, target)
print 'Checking %s difference: (%s deps)' % (target, len(first_deps))
if set(first_deps) != set(second_deps):
# Since we do not thiks this case occur, we do not do anything special
# for this case.
print 'deps on %s are different: %s' % (
target, set(first_deps).symmetric_difference(set(second_deps)))
continue
max_filepath_len = max(len(n) for n in first_deps)
for d in first_deps:
first_file = os.path.join(first_dir, d)
second_file = os.path.join(second_dir, d)
compare_files(first_file, second_file)
result = compare_files(first_file, second_file)
if result:
print('%-*s: %s' % (max_filepath_len, d, result))


def compare_build_artifacts(first_dir, second_dir, target_platform,
Expand Down

0 comments on commit 6eff2be

Please sign in to comment.