diff --git a/Cargo.lock b/Cargo.lock index bc0d08a..e00478e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "aho-corasick" @@ -290,6 +290,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "diff" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" + [[package]] name = "dynasm" version = "1.2.3" @@ -573,6 +579,16 @@ version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc9c68a3f6da06753e9335d63e27f6b9754dd1920d941135b7ea8224f141adb2" +[[package]] +name = "pretty_assertions" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ae130e2f271fbc2ac3a40fb1d07180839cdbbe443c7a27e1e3c13c5cac0116d" +dependencies = [ + "diff", + "yansi", +] + [[package]] name = "prettyplease" version = "0.2.25" @@ -643,6 +659,7 @@ dependencies = [ "hip_runtime-sys", "llvm_zluda", "paste", + "pretty_assertions", "ptx_parser", "quick-error", "rustc-hash 2.0.0", @@ -1114,6 +1131,12 @@ dependencies = [ "serde_json", ] +[[package]] +name = "yansi" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" + [[package]] name = "zluda" version = "0.0.0" diff --git a/ptx/Cargo.toml b/ptx/Cargo.toml index 9f3fa02..08ae693 100644 --- a/ptx/Cargo.toml +++ b/ptx/Cargo.toml @@ -24,3 +24,4 @@ comgr = { path = "../comgr" } tempfile = "3" paste = "1.0" cuda-driver-sys = "0.3.0" +pretty_assertions = "1.4.1" \ No newline at end of file diff --git a/ptx/src/test/spirv_run/mod.rs b/ptx/src/test/spirv_run/mod.rs index 2ca6ad4..9131188 100644 --- a/ptx/src/test/spirv_run/mod.rs +++ b/ptx/src/test/spirv_run/mod.rs @@ -6,6 +6,7 @@ use std::fmt; use std::fmt::{Debug, Display, Formatter}; use std::mem; use std::{ptr, str}; +use pretty_assertions; macro_rules! test_ptx { ($fn_name:ident, $input:expr, $output:expr) => { @@ -242,7 +243,7 @@ fn test_llvm_assert< let ast = ptx_parser::parse_module_checked(ptx_text).unwrap(); let llvm_ir = pass::to_llvm_module(ast).unwrap(); let actual_ll = llvm_ir.llvm_ir.print_as_asm(); - assert_eq!(actual_ll, expected_ll); + pretty_assertions::assert_eq!(actual_ll, expected_ll); Ok(()) }