try to fix travis build (6)
MODIFY
tests/callback.rs
tests/callback.rs
@@ -4,7 +4,14 @@ use opencv::highgui;
#[test]
fn callback() {
- if let Ok(..) = highgui::named_window("test", 0) {
+ #[cfg(target_os = "linux")]
+ {
+ // only run under X11 if on linux
+ if std::env::var("DISPLAY").is_err() {
+ return;
+ }
+ }
+ highgui::named_window("test", 0).unwrap();
let mut value = 50;
let cb_value = Arc::new(Mutex::new(0));
highgui::create_trackbar("test_track", "test", &mut value, 100, Some(Box::new({
@@ -17,5 +24,4 @@ fn callback() {
assert_eq!(value, 10);
assert_eq!(*cb_value.lock().unwrap(), 10);
}
-}

try to fix travis build (6)