Run tests with GitHub actions

This commit is contained in:
B. Blechschmidt 2023-03-22 15:39:08 +01:00
parent e509a81d67
commit 5cbb13247f
4 changed files with 36 additions and 4 deletions

View file

@ -148,15 +148,21 @@ mod tests {
}
}
fn require_var(var: &str) {
env::var(var).expect(format!("{var} environment variable required").as_str());
}
#[serial]
#[test_with::env(SOCKS5_SERVER)]
#[test]
fn test_socks5() {
require_var("SOCKS5_SERVER");
run_test(|test| test.proxy.proxy_type == ProxyType::Socks5)
}
#[serial]
#[test_with::env(HTTP_SERVER)]
#[test]
fn test_http() {
require_var("HTTP_SERVER");
run_test(|test| test.proxy.proxy_type == ProxyType::Http)
}
}