Skip to content

Commit 2dcb63b

Browse files
committed
update ut error mesagges
1 parent badc732 commit 2dcb63b

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

src/lib.rs

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2665,20 +2665,22 @@ mod tests {
26652665

26662666
#[test]
26672667
fn test_library_load() {
2668-
// This test is not yet implemented for Windows
2669-
let check_path = match std::env::consts::OS {
2670-
// "linux" => Some("test_resources/library/linux/test_op.so"),
2671-
// TODO: The test op needs to be recompiled for macos.
2672-
// "macos" => Some("test_resources/library/macos/test_op.so"),
2673-
_ => Some("test_resources/library/test_op.so"),
2674-
};
2675-
if let Some(path) = check_path {
2676-
let lib = Library::load(path).unwrap();
2677-
let ops: Vec<OpDef> = lib.op_list().clone().into();
2678-
assert!(ops.len() == 1);
2679-
let op = &ops[0];
2680-
assert!(op.name() == "TestOpList");
2681-
};
2668+
// This test is implemented for linux only
2669+
if std::env::consts::OS != "linux" {
2670+
return;
2671+
}
2672+
let lib_path = "test_resources/library/test_op.so";
2673+
assert!(
2674+
std::path::Path::new(lib_path).exists(),
2675+
"`{}` was not found. Build the lib and try again : `{}`",
2676+
lib_path,
2677+
"(cd test_resources/library && ./build-test-op)"
2678+
);
2679+
let lib = Library::load(lib_path).unwrap();
2680+
let ops: Vec<OpDef> = lib.op_list().clone().into();
2681+
assert!(ops.len() == 1);
2682+
let op = &ops[0];
2683+
assert!(op.name() == "TestOpList");
26822684
}
26832685

26842686
#[test]

0 commit comments

Comments
 (0)