Attribute Macro test_with::icmp

source[]
#[icmp]
Expand description

Run test case when the server online. Please make sure the role of test case runner have capability to open socket

#[cfg(test)]
mod tests {

    // localhost is online
    #[test_with::icmp(127.0.0.1)]
    #[test]
    fn test_works() {
        assert!(true);
    }

    // 193.194.195.196 is offline
    #[test_with::icmp(193.194.195.196)]
    #[test]
    fn test_ignored() {
        panic!("should be ignored")
    }
}