EXIT CODES: 0 - Matching files 1 - Mismatching files 2 - Error while loading, decoding or processing an input file
| 443 | /// 1 - Mismatching files |
| 444 | /// 2 - Error while loading, decoding or processing an input file |
| 445 | int main(int argc, char* argv[]) { |
| 446 | InitUTF8CLI(argc, argv); |
| 447 | |
| 448 | if (argc < 3) { |
| 449 | fmt::print("Missing input file arguments\n"); |
| 450 | fmt::print("Usage: ktxdiff <expected-ktx2> <received-ktx2> [tolerance]\n"); |
| 451 | return EXIT_FAILURE; |
| 452 | } |
| 453 | |
| 454 | const float tolerance = argc > 3 ? std::stof(argv[3]) : 0.05f; |
| 455 | |
| 456 | Texture lhs(argv[1]); |
| 457 | Texture rhs(argv[2]); |
| 458 | const auto match = compare(lhs, rhs, tolerance); |
| 459 | |
| 460 | return match ? 0 : 1; |
| 461 | } |
nothing calls this directly
no test coverage detected