From 19772bd0a38bf66ad2f6ad0566bfdf37d98781dd Mon Sep 17 00:00:00 2001 From: Oystein Tveit Date: Wed, 17 Apr 2024 13:50:01 +0200 Subject: [PATCH 1/2] tests: add dependencies for capturing log output --- Cargo.toml | 2 ++ tests/mdns_test.rs | 1 + 2 files changed, 3 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index a4fab9b..e91ee8d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,4 +24,6 @@ polling = "2.1" # select/poll sockets socket2 = { version = "0.5.5", features = ["all"] } # socket APIs [dev-dependencies] +env_logger = "0.11.3" fastrand = "1.8" +test-log = "0.2.15" diff --git a/tests/mdns_test.rs b/tests/mdns_test.rs index e5a54ea..5f44bc8 100644 --- a/tests/mdns_test.rs +++ b/tests/mdns_test.rs @@ -8,6 +8,7 @@ use std::net::{IpAddr, Ipv4Addr, Ipv6Addr}; use std::sync::{Arc, Mutex}; use std::thread::sleep; use std::time::{Duration, SystemTime}; +use test_log::test; /// This test covers: /// register(announce), browse(query), response, unregister, shutdown. From 6ab8e16c955540cd471a5743d33ca857cee7d380 Mon Sep 17 00:00:00 2001 From: Oystein Tveit Date: Wed, 17 Apr 2024 13:50:42 +0200 Subject: [PATCH 2/2] tests: rename clashing service name between two tests --- Cargo.toml | 5 +++-- tests/mdns_test.rs | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e91ee8d..a1bd5f9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,6 +24,7 @@ polling = "2.1" # select/poll sockets socket2 = { version = "0.5.5", features = ["all"] } # socket APIs [dev-dependencies] -env_logger = "0.11.3" +env_logger = { version = "= 0.10.2", default-features = false, features= ["humantime"] } fastrand = "1.8" -test-log = "0.2.15" +test-log = "= 0.2.14" +test-log-macros = "= 0.2.14" diff --git a/tests/mdns_test.rs b/tests/mdns_test.rs index 5f44bc8..851eaa3 100644 --- a/tests/mdns_test.rs +++ b/tests/mdns_test.rs @@ -1066,7 +1066,7 @@ fn test_hostname_resolution() { .unwrap(); let my_service = ServiceInfo::new( - "_test._tcp.local.", + "_host_res_test._tcp.local.", "my_instance", hostname, &[service_ip_addr] as &[IpAddr],