Fix opencl tests when opencl is not enabled
MODIFY
ci/test-proj-clang-runtime/src/main.rs
ci/test-proj-clang-runtime/src/main.rs
@@ -2,5 +2,5 @@ use opencv::prelude::*;
fn main() {
let m = Mat::default().unwrap();
- println!("{}", opencv::core::type_to_str(m.typ().unwrap()).unwrap());
+ println!("{}", m.typ().unwrap());
}

MODIFY
tests/opencl.rs
tests/opencl.rs
@@ -5,11 +5,13 @@ use opencv::{
#[test]
fn convert_type_str() -> Result<()> {
+ if core::have_opencl()? {
// this function writes to buf argument and returns it
let mut test = "test".to_string();
assert_eq!("noconvert", core::convert_type_str(1, 1, 1, &mut test)?);
assert_eq!("", test);
assert_eq!("convert_ushort_sat", core::convert_type_str(1, 2, 1, &mut test)?);
assert_eq!("convert_ushort_sat", test);
+ }
Ok(())
}

Fix opencl tests when opencl is not enabled