A test rule that compares two binary files.

The rule uses a Bash command (diff) on Linux/macOS/non-Windows, and a cmd.exe command (fc.exe) on Windows (no Bash is required).

diff_test


load("@bazel_skylib//rules:diff_test.bzl", "diff_test") diff_test(<a href="#diff_test-name">name</a>, <a href="#diff_test-failure_message">failure_message</a>, <a href="#diff_test-file1">file1</a>, <a href="#diff_test-file2">file2</a>)

A test that compares two files.

The test succeeds if the files' contents match.

ATTRIBUTES

NameDescriptionTypeMandatoryDefault
nameA unique name for this target.Namerequired
failure_messageAdditional message to log if the files' contents do not match.Stringoptional""
file1Label of the file to compare to file2.Labelrequired
file2Label of the file to compare to file1.Labelrequired