2022-12-03 19:32:37 +00:00
|
|
|
<!-- Generated with Stardoc: http://skydoc.bazel.build -->
|
|
|
|
|
|
|
|
A test rule that compares two binary files or two directories.
|
|
|
|
|
|
|
|
Similar to `bazel-skylib`'s [`diff_test`](https://github.com/bazelbuild/bazel-skylib/blob/main/rules/diff_test.bzl)
|
|
|
|
but also supports comparing directories.
|
|
|
|
|
|
|
|
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).
|
|
|
|
|
2024-08-08 19:56:11 +00:00
|
|
|
See also: [rules_diff](https://gitlab.arm.com/bazel/rules_diff)
|
2022-12-03 19:32:37 +00:00
|
|
|
|
|
|
|
<a id="diff_test"></a>
|
|
|
|
|
|
|
|
## diff_test
|
|
|
|
|
|
|
|
<pre>
|
2024-07-19 19:50:50 +00:00
|
|
|
diff_test(<a href="#diff_test-name">name</a>, <a href="#diff_test-file1">file1</a>, <a href="#diff_test-file2">file2</a>, <a href="#diff_test-size">size</a>, <a href="#diff_test-kwargs">kwargs</a>)
|
2022-12-03 19:32:37 +00:00
|
|
|
</pre>
|
|
|
|
|
|
|
|
A test that compares two files.
|
|
|
|
|
|
|
|
The test succeeds if the files' contents match.
|
|
|
|
|
|
|
|
|
|
|
|
**PARAMETERS**
|
|
|
|
|
|
|
|
|
|
|
|
| Name | Description | Default Value |
|
|
|
|
| :------------- | :------------- | :------------- |
|
|
|
|
| <a id="diff_test-name"></a>name | The name of the test rule. | none |
|
2024-08-08 19:56:11 +00:00
|
|
|
| <a id="diff_test-file1"></a>file1 | Label of the file to compare to <code>file2</code>. | none |
|
|
|
|
| <a id="diff_test-file2"></a>file2 | Label of the file to compare to <code>file1</code>. | none |
|
|
|
|
| <a id="diff_test-size"></a>size | standard attribute for tests | `"small"` |
|
|
|
|
| <a id="diff_test-kwargs"></a>kwargs | The <a href="https://docs.bazel.build/versions/main/be/common-definitions.html#common-attributes-tests">common attributes for tests</a>. | none |
|
2022-12-03 19:32:37 +00:00
|
|
|
|
|
|
|
|