Compare two files, allowing absolute and relative floating-point tolerance.
Declared in <llvm/Support/FileUtilities.h>
int
DiffFilesWithTolerance(
StringRef FileA,
StringRef FileB,
double AbsTol,
double RelTol,
std::string* Error = nullptr);
Returns 0 if the files match, 1 if they are different, and 2 if there is a file error. Absolute and relative FP error may be specified; if they differ by more than those tolerances, the files are considered different. If Error is non-null, it is set to an error message when an error occurs or the files differ.
0 if the files match, 1 if they differ, and 2 on file error.
| Name | Description |
|---|---|
| FileA | Path of the first file to compare. |
| FileB | Path of the second file to compare. |
| AbsTol | Absolute floating-point difference allowed between values. |
| RelTol | Relative floating-point difference allowed between values. |
| Error | Optional string filled with an error or difference message. |